diff --git a/.changelog/2372.txt b/.changelog/2372.txt new file mode 100644 index 0000000000..0422ed3cfe --- /dev/null +++ b/.changelog/2372.txt @@ -0,0 +1,3 @@ +```release-note:bug +`data_source/kubernetes_resources`: fix an issue where the provider exit with an error when the data source `kubernetes_resources` receives multiple Kubernetes objects containing tuples with different numbers of elements. +``` diff --git a/.changelog/2402.txt b/.changelog/2402.txt new file mode 100644 index 0000000000..0189f8a56b --- /dev/null +++ b/.changelog/2402.txt @@ -0,0 +1,3 @@ +```release-note:bug +`resource/kubernetes_node_taint`: Fix the error check for nonexistant nodes so that terraform does not fail if there is a taint in the state file for a node that has been deleted. +``` diff --git a/.changelog/2428.txt b/.changelog/2428.txt new file mode 100644 index 0000000000..be5ab0e92c --- /dev/null +++ b/.changelog/2428.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +Add provider defined functions: `manifest_encode`, `manifest_decode`, `manifest_decode_multi` +``` \ No newline at end of file diff --git a/.changelog/2461.txt b/.changelog/2461.txt new file mode 100644 index 0000000000..3baeab4851 --- /dev/null +++ b/.changelog/2461.txt @@ -0,0 +1,3 @@ +```release-note:bug +`manifest_decode()`: fix handling of manifests containing null values +``` diff --git a/.changelog/2464.txt b/.changelog/2464.txt new file mode 100644 index 0000000000..02b51ca220 --- /dev/null +++ b/.changelog/2464.txt @@ -0,0 +1,3 @@ +```release-note:bug +data-sources: revert a recently introduced deviation on datasources where querying a non-existent resource would cause an error (#2434). +``` diff --git a/.changelog/2470.txt b/.changelog/2470.txt new file mode 100644 index 0000000000..37de97687a --- /dev/null +++ b/.changelog/2470.txt @@ -0,0 +1,3 @@ +```release-note:doc +Migrate legacy structure to new tfplugindocs template structure +``` \ No newline at end of file diff --git a/.changelog/2485.txt b/.changelog/2485.txt new file mode 100644 index 0000000000..3447f3542d --- /dev/null +++ b/.changelog/2485.txt @@ -0,0 +1,3 @@ +```release-note:bug +`kubernetes_manifest`: fix issue preventing KUBE_PROXY_URL environment variable from being used in client configuration (#1733) +``` \ No newline at end of file diff --git a/.changelog/2488.txt b/.changelog/2488.txt new file mode 100644 index 0000000000..349e803a94 --- /dev/null +++ b/.changelog/2488.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +`resource/kubernetes_persistent_volume_v1`: support `ReadWriteOncePod` access mode for PVs +``` \ No newline at end of file diff --git a/.changelog/2494.txt b/.changelog/2494.txt new file mode 100644 index 0000000000..3add9250d6 --- /dev/null +++ b/.changelog/2494.txt @@ -0,0 +1,3 @@ +```release-note:improvement +`resource/resource_kubernetes_network_policy_v1`: add support for `end_port` +``` diff --git a/.changelog/2510.txt b/.changelog/2510.txt new file mode 100644 index 0000000000..2d81d5cd2b --- /dev/null +++ b/.changelog/2510.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +Add support for Terraform's experimental deferred actions +``` \ No newline at end of file diff --git a/.copywrite.hcl b/.copywrite.hcl index 77b8828e9f..5c2ba58ec0 100644 --- a/.copywrite.hcl +++ b/.copywrite.hcl @@ -11,5 +11,6 @@ project { ".markdownlint.yml", ".release/**", "vendor/**", + "examples/**" ] } diff --git a/.github/labeler-pull-request-triage.yml b/.github/labeler-pull-request-triage.yml index 19f0cf1f76..ee1ab1edf9 100644 --- a/.github/labeler-pull-request-triage.yml +++ b/.github/labeler-pull-request-triage.yml @@ -1,4 +1,6 @@ -dependencies: - - vendor/**/* -documentation: - - website/**/* +Dependencies: +- changed-files: + - any-glob-to-any-file: 'vendor/*' +Documentation: +- changed-files: + - any-glob-to-any-file: 'docs/*' diff --git a/.github/workflows/acceptance_test_dfa.yaml b/.github/workflows/acceptance_test_dfa.yaml new file mode 100644 index 0000000000..d5fb96213f --- /dev/null +++ b/.github/workflows/acceptance_test_dfa.yaml @@ -0,0 +1,33 @@ +name: Deferred Actions + +on: + pull_request: + branches: + - main + paths: + - "manifest/**/*.go" + - 'kubernetes/**/*.go' + - "go.mod" + workflow_dispatch: + inputs: + terraformVersion: + description: Terraform version + default: 1.9.0-alpha20240516 + +jobs: + acceptance_tests: + if: ${{ github.repository_owner == 'hashicorp' }} + runs-on: custom-linux-medium + steps: + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set up Go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + with: + go-version-file: 'go.mod' + - name: Run Tests + env: + TF_ACC: 1 + TF_ACC_TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || '1.9.0-alpha20240516' }} + run: | + go test -v -run '^TestAccKubernetesDeferredActions' ./kubernetes/test-dfa diff --git a/.github/workflows/acceptance_tests_aks.yaml b/.github/workflows/acceptance_tests_aks.yaml index 0a0c4b3e7a..2408f6fa14 100644 --- a/.github/workflows/acceptance_tests_aks.yaml +++ b/.github/workflows/acceptance_tests_aks.yaml @@ -38,10 +38,11 @@ env: jobs: acceptance_tests_aks: - runs-on: [custom, linux, medium] + if: ${{ github.repository_owner == 'hashicorp' }} + runs-on: custom-linux-medium steps: - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: diff --git a/.github/workflows/acceptance_tests_eks.yaml b/.github/workflows/acceptance_tests_eks.yaml index 003b040ba2..7c9c9dd0e9 100644 --- a/.github/workflows/acceptance_tests_eks.yaml +++ b/.github/workflows/acceptance_tests_eks.yaml @@ -43,10 +43,11 @@ env: jobs: acceptance_tests_eks: - runs-on: [custom, linux, medium] + if: ${{ github.repository_owner == 'hashicorp' }} + runs-on: custom-linux-medium steps: - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: diff --git a/.github/workflows/acceptance_tests_gke.yaml b/.github/workflows/acceptance_tests_gke.yaml index bb50c3adee..53dcce3fe6 100644 --- a/.github/workflows/acceptance_tests_gke.yaml +++ b/.github/workflows/acceptance_tests_gke.yaml @@ -44,10 +44,11 @@ env: jobs: acceptance_tests_gke: - runs-on: [custom, linux, medium] + if: ${{ github.repository_owner == 'hashicorp' }} + runs-on: custom-linux-medium steps: - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: diff --git a/.github/workflows/acceptance_tests_kind.yaml b/.github/workflows/acceptance_tests_kind.yaml index d2f0605d79..dcc318708d 100644 --- a/.github/workflows/acceptance_tests_kind.yaml +++ b/.github/workflows/acceptance_tests_kind.yaml @@ -26,16 +26,17 @@ on: env: KUBECONFIG: ${{ github.workspace }}/.kube/config - KIND_VERSION: ${{ github.event.inputs.kindVersion || vars.KIND_VERSION }} - PARALLEL_RUNS: ${{ github.event.inputs.parallelRuns || vars.PARALLEL_RUNS }} - TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || vars.TERRAFORM_VERSION }} + KIND_VERSION: ${{ github.event.inputs.kindVersion || vars.KIND_VERSION || '0.23.0' }} + PARALLEL_RUNS: ${{ github.event.inputs.parallelRuns || vars.PARALLEL_RUNS || '8' }} + TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || vars.TERRAFORM_VERSION || '1.9.2' }} jobs: acceptance_tests_kind: - runs-on: [custom, linux, medium] + if: ${{ github.repository_owner == 'hashicorp' }} + runs-on: custom-linux-medium steps: - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: diff --git a/.github/workflows/changelog-checker.yml b/.github/workflows/changelog-checker.yml index bf0c8cd8b0..ea37c36eda 100644 --- a/.github/workflows/changelog-checker.yml +++ b/.github/workflows/changelog-checker.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 # by default the checkout action doesn't checkout all branches diff --git a/.github/workflows/check_examples.yaml b/.github/workflows/check_examples.yaml index b965a043b7..1135d2fa39 100644 --- a/.github/workflows/check_examples.yaml +++ b/.github/workflows/check_examples.yaml @@ -28,7 +28,8 @@ jobs: - "1.3.9" - "1.4.0" - "1.6.0" - - "1.7.5" + - "1.7.0" + - "1.8.0" env: TF_X_KUBERNETES_MANIFEST_RESOURCE: 1 TERM: linux @@ -36,7 +37,7 @@ jobs: - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 with: terraform_version: ${{ matrix.terraform_version }} - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: diff --git a/.github/workflows/checkers-and-linters.yml b/.github/workflows/checkers-and-linters.yml index e81d51a91a..8fdfa81a6e 100644 --- a/.github/workflows/checkers-and-linters.yml +++ b/.github/workflows/checkers-and-linters.yml @@ -14,15 +14,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: 'go.mod' # Secrets are not available on pull requests. - name: Login to Docker Hub if: github.ref == 'refs/heads/main' - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 + uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 with: username: ${{ secrets.RO_DOCKERHUB_USER }} password: ${{ secrets.RO_DOCKERHUB_TOKEN }} @@ -36,5 +36,5 @@ jobs: make vet - name: Run linters run: | - make website-lint + make docs-lint make tests-lint diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index babd1b8657..f91dafd3e6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -38,7 +38,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a # codeql-bundle-v2.13.4 + uses: github/codeql-action/init@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -49,7 +49,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@cdcdbb579706841c47f7063dda365e292e5cad7a # codeql-bundle-v2.13.4 + uses: github/codeql-action/autobuild@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -63,4 +63,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@cdcdbb579706841c47f7063dda365e292e5cad7a # codeql-bundle-v2.13.4 + uses: github/codeql-action/analyze@c4fb451437765abf5018c6fbf22cce1a7da1e5cc # codeql-bundle-v2.17.1 diff --git a/.github/workflows/documentation-check.yaml b/.github/workflows/documentation-check.yaml new file mode 100644 index 0000000000..bdc29395f1 --- /dev/null +++ b/.github/workflows/documentation-check.yaml @@ -0,0 +1,42 @@ +name: "Documentation Updates" + +on: + pull_request: + paths: + - 'docs/**' + types: [opened, synchronize, labeled] + + push: + branches: + - main + +jobs: + check-docs: + runs-on: ubuntu-latest + + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-documentation') }} + + steps: + - name: Checkout repository + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Set up Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + + - name: Install tfplugindocs command + run: go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest + + - name: Run tfplugindocs command + run: tfplugindocs generate + + - name: Check for changes + run: | + git diff --exit-code + + - name: Undocumented changes + run: | + echo "Documentation is not up to date. Please refer to the `Making Changes` in the Contribution Guide on how to properly update documentation." + exit 1 + if: failure() \ No newline at end of file diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 77897b87f1..f715117439 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -14,13 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: 'go.mod' - name: golangci-lint - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 + uses: golangci/golangci-lint-action@82d40c283aeb1f2b6595839195e95c2d6a49081b # v5.0.0 with: version: 'v1.55.2' skip-pkg-cache: true diff --git a/.github/workflows/hc-copywrite.yml b/.github/workflows/hc-copywrite.yml index 2d19c1e982..86b8a7b645 100644 --- a/.github/workflows/hc-copywrite.yml +++ b/.github/workflows/hc-copywrite.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Install copywrite - uses: hashicorp/setup-copywrite@3ace06ad72e6ec679ea8572457b17dbc3960b8ce # v1.0.0 + uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 - name: Validate Header Compliance run: copywrite headers --plan diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml index 31f6144ea0..53e5cf61b4 100644 --- a/.github/workflows/issue-opened.yml +++ b/.github/workflows/issue-opened.yml @@ -8,9 +8,48 @@ jobs: issue_triage: runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - uses: github/issue-labeler@e24a3eb6b2e28c8904d086302a2b760647f5f45c # v3.1 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-triage.yml enable-versioned-regex: 0 + oncall_review_assigner: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + - run: npm install @pagerduty/pdjs + - uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 # v7.0.0 + env: + PAGERDUTY_TOKEN: ${{ secrets.PAGERDUTY_TOKEN }} + with: + script: | + const { PAGERDUTY_TOKEN } = process.env + const { api } = require('@pagerduty/pdjs'); + const pd = api({token: PAGERDUTY_TOKEN}); + const reviewerList = new Map([ + ["Sheneska Williams", "sheneska"], + ["Mauricio Alvarez Leon", "BBBmau"], + ["Alex Somesan", "alexsomesan"], + ["Alex Pilon", "appilon"], + ["John Houston", "jrhouston"], + ["Sacha Rybolovlev", "arybolovlev"], + ]); + + let resp = await pd.get('oncalls?escalation_policy_ids%5B%5D=PH8IF3M') + if (resp.status != 200){ + core.setFailed("PagerDuty Error: " + resp.statusText) + } + const reviewer = resp.data.oncalls[0].user.summary + const reviewerGH = reviewerList.get(reviewer) + console.log("Assigning issue to " + reviewerGH); + + resp = await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + assignees: reviewerGH, + issue_number: context.issue.number, + }) + if (resp.status != 201){ + core.setFailed("error assigning reviewer: user doesn't have the appropriate permissions to be assigned an issue.") + } diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 0147730316..697265b291 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -8,7 +8,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21 # v4.0.1 + - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: github-token: ${{ github.token }} issue-lock-comment: > diff --git a/.github/workflows/manifest_acc.yaml b/.github/workflows/manifest_acc.yaml index 1a9530f49e..bb9e5d8ba6 100644 --- a/.github/workflows/manifest_acc.yaml +++ b/.github/workflows/manifest_acc.yaml @@ -28,10 +28,13 @@ jobs: matrix: kubernetes_version: # kind images: https://github.com/kubernetes-sigs/kind/releases + - v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e + - v1.28.9@sha256:dca54bc6a6079dd34699d53d7d4ffa2e853e46a20cd12d619a09207e35300bd0 - v1.26.6@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1 - v1.25.11@sha256:577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315 - v1.23.15@sha256:ef453bb7c79f0e3caba88d2067d4196f427794086a7d0df8df4f019d5e336b61 terraform_version: + - 1.8.0 - 1.5.7 - 1.4.7 - 1.3.10 @@ -43,13 +46,13 @@ jobs: - kubernetes_version: v1.27.3@sha256:691e24bd2417609db7e589e1a479b902d2e209892a10ce375fab60a8407c7352 terraform_version: 1.6.1 steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: 'go.mod' - name: Setup kind - uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0 + uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 with: version: v0.20.0 node_image: kindest/node:${{ matrix.kubernetes_version }} diff --git a/.github/workflows/manifest_unit.yaml b/.github/workflows/manifest_unit.yaml index 87dc5076f6..a90a6390b7 100644 --- a/.github/workflows/manifest_unit.yaml +++ b/.github/workflows/manifest_unit.yaml @@ -20,9 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: 'go.mod' - name: Go mod verify diff --git a/.github/workflows/markdown-link-check.yaml b/.github/workflows/markdown-link-check.yaml index 79930f9bf4..5fd146e691 100644 --- a/.github/workflows/markdown-link-check.yaml +++ b/.github/workflows/markdown-link-check.yaml @@ -8,7 +8,7 @@ on: branches: - main paths: - - 'website/docs/**' + - 'docs/**' workflow_dispatch: jobs: @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Run Markdown links checker uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # 1.0.15 @@ -24,7 +24,7 @@ jobs: base-branch: main config-file: '.github/workflows/markdown.links.config.json' file-extension: '.markdown' - folder-path: 'website/docs' + folder-path: 'docs' use-verbose-mode: yes use-quiet-mode: yes max-depth: 2 diff --git a/.github/workflows/markdown.links.config.json b/.github/workflows/markdown.links.config.json index 149bfd0a28..94ea531284 100644 --- a/.github/workflows/markdown.links.config.json +++ b/.github/workflows/markdown.links.config.json @@ -18,15 +18,15 @@ }, { "pattern": "^/docs/providers/kubernetes/", - "replacement": "file:///github/workspace/website/docs/" + "replacement": "file:///github/workspace/docs/" }, { "pattern": "^(getting-started).html.markdown(#.*)?$", - "replacement": "file:///github/workspace/website/docs/guides/$1.html.md$2" + "replacement": "file:///github/workspace/docs/guides/$1.html.md$2" }, { - "pattern": "^file:///github/workspace/website/docs/guides/(.*)\\.markdown(#.*)?$", - "replacement": "file:///github/workspace/website/docs/guides/$1.md$2" + "pattern": "^file:///github/workspace/docs/guides/(.*)\\.markdown(#.*)?$", + "replacement": "file:///github/workspace/docs/guides/$1.md$2" } ] } diff --git a/.github/workflows/provider_functions_unit.yaml b/.github/workflows/provider_functions_unit.yaml new file mode 100644 index 0000000000..d2b2428685 --- /dev/null +++ b/.github/workflows/provider_functions_unit.yaml @@ -0,0 +1,32 @@ +name: Provider Functions Unit Tests + +on: + push: + branches: + - main + paths: + - "internal/framework/provider/functions/**/*.go" + pull_request: + branches: + - main + paths: + - "internal/framework/provider/functions/**/*.go" + workflow_dispatch: + +jobs: + unit_tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Set up Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + - name: Go mod verify + run: go mod verify + - name: Run unit tests + env: + TF_ACC_TERRAFORM_VERSION: 1.8.0 + run: | + make testfuncs diff --git a/.github/workflows/prune_stale_issues.yml b/.github/workflows/prune_stale_issues.yml index 8bfad2950e..21898e5c97 100644 --- a/.github/workflows/prune_stale_issues.yml +++ b/.github/workflows/prune_stale_issues.yml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!' diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1dded161fd..1e40a98db2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -6,7 +6,10 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@9fcb2c2f5584144ca754f8bfe8c6f81e77753375 # v4.1.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + repository: "hashicorp/terraform-provider-kubernetes" + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: configuration-path: .github/labeler-pull-request-triage.yml repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 27007fba7c..99986a0294 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,12 +12,12 @@ jobs: release-notes: runs-on: ubuntu-latest steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: fetch-depth: 0 - name: Generate Release Notes - run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git tag --list 'v*' --sort=-version:refname | head -n 2 | tail -n 1 | tr -d v)/q;p" CHANGELOG.md > release-notes.txt + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: release-notes path: release-notes.txt @@ -25,7 +25,7 @@ jobs: terraform-provider-release: name: 'Terraform Provider Release' needs: [release-notes] - uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@01981baad5d35ce2342924e60ae91cf69fe31fd0 # v2.3.0 + uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v3.0.1 secrets: hc-releases-key-prod: '${{ secrets.HC_RELEASES_KEY_PROD }}' hc-releases-key-staging: '${{ secrets.HC_RELEASES_KEY_STAGING }}' diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2c1eff18b0..91c6bb973b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -16,9 +16,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: 'go.mod' - name: Run unit tests diff --git a/.goreleaser.yml b/.goreleaser.yml index 4eff5747aa..c3b96d53db 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,8 @@ archives: - files: - # Ensure only built binary is archived - - 'none*' + # Ensure only built binary and license file are archived + - src: 'LICENSE' + dst: 'LICENSE.txt' format: zip name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' before: diff --git a/.markdownlinkcheck.json b/.markdownlinkcheck.json index 149bfd0a28..94ea531284 100644 --- a/.markdownlinkcheck.json +++ b/.markdownlinkcheck.json @@ -18,15 +18,15 @@ }, { "pattern": "^/docs/providers/kubernetes/", - "replacement": "file:///github/workspace/website/docs/" + "replacement": "file:///github/workspace/docs/" }, { "pattern": "^(getting-started).html.markdown(#.*)?$", - "replacement": "file:///github/workspace/website/docs/guides/$1.html.md$2" + "replacement": "file:///github/workspace/docs/guides/$1.html.md$2" }, { - "pattern": "^file:///github/workspace/website/docs/guides/(.*)\\.markdown(#.*)?$", - "replacement": "file:///github/workspace/website/docs/guides/$1.md$2" + "pattern": "^file:///github/workspace/docs/guides/(.*)\\.markdown(#.*)?$", + "replacement": "file:///github/workspace/docs/guides/$1.md$2" } ] } diff --git a/.markdownlint.yml b/.markdownlint.yml index 0ae15e39d0..07eede2c67 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -16,9 +16,15 @@ MD010: false MD012: false MD013: false MD014: false +MD018: false MD022: false MD024: false +MD029: false +MD032: false +MD033: false MD034: false +MD037: false MD038: false MD040: false +MD046: false MD047: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 13f8461627..ae40908d2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,35 @@ +## 2.30.0 (May 8, 2024) + +BUG FIXES: + +* `data_source/kubernetes_resources`: fix an issue where the provider exit with an error when the data source `kubernetes_resources` receives multiple Kubernetes objects containing tuples with different numbers of elements. [[GH-2372](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2372)] +* `kubernetes_manifest`: fix issue preventing KUBE_PROXY_URL environment variable from being used in client configuration (#1733) [[GH-2485](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2485)] +* `resource/kubernetes_node_taint`: Fix the error check for nonexistant nodes so that terraform does not fail if there is a taint in the state file for a node that has been deleted. [[GH-2402](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2402)] + +DOCS: + +* Migrate legacy structure to new tfplugindocs template structure [[GH-2470](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2470)] + +## 2.29.0 (April 11, 2024) + +BUG FIXES: + +* data-sources: revert a recently introduced deviation on datasources where querying a non-existent resource would cause an error (#2434). [[GH-2464](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2464)] + +## 2.28.1 (April 9, 2024) + +HOTFIX: + +* `manifest_decode()`: fix handling of manifests containing null values [[GH-2461](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2461)] + +## 2.28.0 (April 8, 2024) + +ENHANCEMENTS: + +**NOTE: Using [Provider Defined Functions](https://developer.hashicorp.com/terraform/plugin/framework/functions/concepts) requires Terraform version 1.8.0.** + +* Add provider defined functions: `manifest_encode`, `manifest_decode`, `manifest_decode_multi` [[GH-2428](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2428)] + ## 2.27.0 (Mar, 6 2024) ENHANCEMENTS: diff --git a/GNUmakefile b/GNUmakefile index ad45824f9c..ee22bc5da4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,11 +3,12 @@ PROVIDER_DIR := $(abspath $(lastword $(dir $(MAKEFILE_LIST)))) TEST := "$(PROVIDER_DIR)/kubernetes" GOFMT_FILES := $$(find $(PROVIDER_DIR) -name '*.go') -WEBSITE_REPO := github.com/hashicorp/terraform-website PKG_NAME := kubernetes OS_ARCH := $(shell go env GOOS)_$(shell go env GOARCH) TF_PROV_DOCS := $(PWD)/kubernetes/test-infra/tfproviderdocs +PROVIDER_FUNCTIONS_DIR := "$(PROVIDER_DIR)/internal/framework/provider/functions" + ifneq ($(PWD),$(PROVIDER_DIR)) $(error "Makefile must be run from the provider directory") endif @@ -22,7 +23,7 @@ PARALLEL_RUNS?=8 default: build -all: build depscheck fmtcheck test testacc test-compile tests-lint tests-lint-fix tools vet website-lint website-lint-fix +all: build depscheck fmtcheck test testacc test-compile tests-lint tests-lint-fix tools vet docs-lint docs-lint-fix build: fmtcheck go install @@ -75,6 +76,9 @@ test: fmtcheck vet testacc: fmtcheck vet TF_ACC=1 go test $(TEST) -v -vet=off $(TESTARGS) -parallel $(PARALLEL_RUNS) -timeout 3h +testfuncs: fmtcheck + go test $(PROVIDER_FUNCTIONS_DIR) -v -vet=off $(TESTARGS) -parallel $(PARALLEL_RUNS) + test-compile: @if [ "$(TEST)" = "./..." ]; then \ echo "ERROR: Set TEST to a specific package. For example,"; \ @@ -99,8 +103,8 @@ tests-lint-fix: tools tools: go install github.com/client9/misspell/cmd/misspell@v0.3.4 go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@v0.28.1 - go install github.com/bflad/tfproviderdocs@v0.9.1 - go install github.com/katbyte/terrafmt@v0.5.2 + go install github.com/bflad/tfproviderdocs@v0.12.0 + go install github.com/katbyte/terrafmt@v0.5.3 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest go install github.com/hashicorp/go-changelog/cmd/changelog-entry@latest @@ -120,8 +124,8 @@ vet: # The docker command and run options may be overridden using env variables DOCKER and DOCKER_RUN_OPTS. # Example: -# DOCKER="podman --cgroup-manager=cgroupfs" make website-lint -# DOCKER_RUN_OPTS="--userns=keep-id" make website-lint +# DOCKER="podman --cgroup-manager=cgroupfs" make docs-lint +# DOCKER_RUN_OPTS="--userns=keep-id" make docs-lint # This option is needed for systems using SELinux and rootless containers. # DOCKER_VOLUME_OPTS="rw,Z" # For more info, see https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label @@ -135,40 +139,40 @@ ifeq ($(.SHELLSTATUS),0) DOCKER_VOLUME_OPTS="rw,Z" endif -website-lint: tools +docs-lint: tools @echo "==> Checking website against linters..." - @misspell -error -source=text ./website || (echo; \ + @misspell -error -source=text ./docs || (echo; \ echo "Unexpected mispelling found in website files."; \ - echo "To automatically fix the misspelling, run 'make website-lint-fix' and commit the changes."; \ + echo "To automatically fix the misspelling, run 'make docs-lint-fix' and commit the changes."; \ exit 1) @echo "==> Running markdownlint-cli using DOCKER='$(DOCKER)', DOCKER_RUN_OPTS='$(DOCKER_RUN_OPTS)' and DOCKER_VOLUME_OPTS='$(DOCKER_VOLUME_OPTS)'" - @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli ./website || (echo; \ + @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli ./docs || (echo; \ echo "Unexpected issues found in website Markdown files."; \ - echo "To apply any automatic fixes, run 'make website-lint-fix' and commit the changes."; \ + echo "To apply any automatic fixes, run 'make docs-lint-fix' and commit the changes."; \ exit 1) @echo "==> Running terrafmt diff..." - @terrafmt diff ./website --check --pattern '*.markdown' --quiet || (echo; \ + @terrafmt diff ./docs --check --pattern '*.markdown' --quiet || (echo; \ echo "Unexpected differences in website HCL formatting."; \ - echo "To see the full differences, run: terrafmt diff ./website --pattern '*.markdown'"; \ - echo "To automatically fix the formatting, run 'make website-lint-fix' and commit the changes."; \ + echo "To see the full differences, run: terrafmt diff ./docs --pattern '*.markdown'"; \ + echo "To automatically fix the formatting, run 'make docs-lint-fix' and commit the changes."; \ exit 1) @echo "==> Statically compiling provider for tfproviderdocs..." @env CGO_ENABLED=0 GOOS=$$(go env GOOS) GOARCH=$$(go env GOARCH) go build -a -o $(TF_PROV_DOCS)/terraform-provider-kubernetes @echo "==> Getting provider schema for tfproviderdocs..." - @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:0.12.29 init - @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:0.12.29 providers schema -json > $(TF_PROV_DOCS)/schema.json + @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:1.8.2 init + @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(TF_PROV_DOCS):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace hashicorp/terraform:1.8.2 providers schema -json > $(TF_PROV_DOCS)/schema.json @echo "==> Running tfproviderdocs..." @tfproviderdocs check -providers-schema-json $(TF_PROV_DOCS)/schema.json -provider-name kubernetes @rm -f $(TF_PROV_DOCS)/schema.json $(TF_PROV_DOCS)/terraform-provider-kubernetes @echo "==> Checking for broken links..." @scripts/markdown-link-check.sh "$(DOCKER)" "$(DOCKER_RUN_OPTS)" "$(DOCKER_VOLUME_OPTS)" "$(PROVIDER_DIR)" -website-lint-fix: tools +docs-lint-fix: tools @echo "==> Applying automatic website linter fixes..." - @misspell -w -source=text ./website + @misspell -w -source=text ./docs @echo "==> Running markdownlint-cli --fix using DOCKER='$(DOCKER)', DOCKER_RUN_OPTS='$(DOCKER_RUN_OPTS)' and DOCKER_VOLUME_OPTS='$(DOCKER_VOLUME_OPTS)'" - @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli --fix ./website + @$(DOCKER) run $(DOCKER_RUN_OPTS) -v $(PROVIDER_DIR):/workspace:$(DOCKER_VOLUME_OPTS) -w /workspace 06kellyjac/markdownlint-cli --fix ./docs @echo "==> Fixing website terraform blocks code with terrafmt..." - @terrafmt fmt ./website --pattern '*.markdown' + @terrafmt fmt ./docs --pattern '*.markdown' -.PHONY: build test testacc tools vet fmt fmtcheck terrafmt test-compile depscheck tests-lint tests-lint-fix website-lint website-lint-fix changelog changelog-entry +.PHONY: build test testacc tools vet fmt fmtcheck terrafmt test-compile depscheck tests-lint tests-lint-fix docs-lint docs-lint-fix changelog changelog-entry diff --git a/_about/CONTRIBUTING.md b/_about/CONTRIBUTING.md index d1a7dd45f9..75cff8d701 100644 --- a/_about/CONTRIBUTING.md +++ b/_about/CONTRIBUTING.md @@ -1,71 +1,122 @@ -## Developing the provider +# Contributor Guide -Thank you for your interest in contributing to the Kubernetes provider. We welcome your contributions. Here you'll find information to help you get started with provider development. +Thank you for your interest in contributing to the Kubernetes provider. We welcome your contributions. Here, you'll find information to help you get started with provider development. -## Documentation +If you want to learn more about developing a Terraform provider, please refer to the [Plugin Development documentation](https://developer.hashicorp.com/terraform/plugin). -Our [provider development documentation](https://www.terraform.io/docs/extend/) provides a good start into developing an understanding of provider development. It's the best entry point if you are new to contributing to this provider. +## Configuring Environment -To learn more about how to create issues and pull requests in this repository, and what happens after they are created, you may refer to the resources below: -- [Issue creation and lifecycle](ISSUES.md) -- [Pull Request creation and lifecycle](PULL_REQUESTS.md) +1. Install Golang + [Install](https://go.dev/doc/install) the version of Golang as indicated in the [go.mod](../go.mod) file. -## Building the provider +1. Fork this repo -Clone repository to: `$GOPATH/src/github.com/hashicorp/terraform-provider-kubernetes` + [Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the provider repository and clone it on your computer. -```sh -$ mkdir -p $GOPATH/src/github.com/hashicorp; cd $GOPATH/src/github.com/hashicorp -$ git clone git@github.com:hashicorp/terraform-provider-kubernetes -``` + Here is an example of how to clone this repository and switch to the directory: -Enter the provider directory and build the provider + ```console + $ git clone https://github.com//terraform-provider-kubernetes.git + $ cd terraform-provider-kubernetes + ``` -```sh -$ cd $GOPATH/src/github.com/hashicorp/terraform-provider-kubernetes -$ make build -``` + From now on, we are going to assume that you have a copy of the repository on your computer and work within the `terraform-provider-kubernetes` directory. -Statically linking binaries can be required for testing development builds in containers not providing all dependencies, e.g.: +1. Prepare a Kubernetes Cluster -``` -# CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -``` + While our preference is to use [KinD](https://kind.sigs.k8s.io/) for setting up a Kubernetes cluster for development and test purposes, feel free to opt for the solution that best suits your preferences. Please bear in mind that some acceptance tests might require specific cluster settings, which we maintain in the KinD [configuration file](../.github/config/acceptance_tests_kind_config.yaml). + + Here is an example of how to provision a Kubernetes cluster using the configuration file: + + ```console + $ kind create cluster --config=./.github/config/acceptance_tests_kind_config.yaml + ``` + + KinD comes with a default Node image version that depends on the KinD version and thus might not be always the one you want to use. The above command can be extended with the `--image` option to spin up a particular Kubernetes version: + + ```console + $ kind create cluster \ + --config=./.github/config/acceptance_tests_kind_config.yaml \ + --image kindest/node:v1.28.0@sha256:b7a4cad12c197af3ba43202d3efe03246b3f0793f162afb40a33c923952d5b31 + ``` + + Refer to the KinD [releases](https://github.com/kubernetes-sigs/kind/releases) to get the right image. + + From now on, we are going to assume that the Kubernetes configuration is stored in the `$HOME/.kube/config` file, and the current context is set to a newly created KinD cluster. + + Once the Kubernetes cluster is up and running, we strongly advise you to run acceptance tests before making any changes to ensure they work with your setup. Please refer to the [Testing](#testing) section for more details. -## Contributing to the provider -### Contributing Resources +## Making Changes -In order to prevent breaking changes and migration of user-created resources, resources included in this provider will be limited to stable (aka `v1`) and beta APIs (with beta resources, readiness for inclusion will be assessed individually). You can find `v1` resources in the Kubernetes [API documentation](https://kubernetes.io/docs/reference/#api-reference) for the appropriate version of Kubernetes. +### Adding a New Resource -### Development Environment +This quick guide covers best practices for adding a new Resource. -If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.9+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`. +1. Ensure all dependncies are installed. +1. Add an SDK Client. +1. Add Resource Schema and define attributes [see Kubernetes Documentation](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs). A best and recommended practice is reuse constants from the Kuberentes packages as a default value in an attribute or within a validation function. +1. Scaffold an empty/new resource. +1. Add Acceptance Tests(s) for the resource. +1. Run Acceptance Tests(s) for this resource. +1. Add Documentation for this resource by editing the `.md.tmpl` file to include the appropriate [Data Fields](https://pkg.go.dev/text/template) and executing `tfplugindocs generate` command [see Terraform PluginDocs](https://github.com/hashicorp/terraform-plugin-docs#data-fields) then inspecting the corresponding `.md` file in the `/docs` to see all changes. The Data Fields that are currently apart of the templates are those for the Schema ({{ .SchemaMarkdown }}), Name ({{ .Name }}) and ({{ .Description }}). +1. Execute `make docs-lint` and `make tests-lint` commands +1. Create a Pull Request for your changes. -To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. +### Adding a New Data Source -```sh -$ make build -... -$ $GOPATH/bin/terraform-provider-kubernetes -... +1. Ensure all dependncies are installed. +1. Add an SDK Client. +1. Add Data Source Schema and define attributes [see Kubernetes Documentation](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs). +A best and recommended practice is reuse constants from the Kuberentes packages as a default value in an attribute or within a validation function. +1. Scaffold an empty/new resource. +1. Add Acceptance Tests(s) for the data source. +1. Run Acceptance Tests(s) for this data source. +1. Add Documentation for this data source by editing the `.md.tmpl` file to include the appropriate [Data Fields](https://pkg.go.dev/text/template) and executing `tfplugindocs generate` command [see Terraform PluginDocs](https://github.com/hashicorp/terraform-plugin-docs#data-fields) then inspecting the corresponding `.md` file in the `/docs` to see all changes. The Data Fields that are currently apart of the templates are those for the Schema ({{ .SchemaMarkdown }}), Name ({{ .Name }}) and ({{ .Description }}). +1. Execute `make docs-lint` and `make tests-lint` commands +1. Create a Pull Request for your changes. + +### Adding/Editing Documentation +All Documentation is edited in the `.md.tmpl` file. Please note that the `tfplugindocs generate` command should be executed to ensure it is updated and reflected in the `.md` files. + +## Testing + +The Kubernetes provider includes two types of tests: [unit](https://developer.hashicorp.com/terraform/plugin/sdkv2/testing/unit-testing) tests and [acceptance](https://developer.hashicorp.com/terraform/plugin/sdkv2/testing/acceptance-tests) tests. + +Before running any tests, make sure that the `KUBE_CONFIG_PATH` environment variable points to the Kubernetes configuration file: + +```console +$ export KUBE_CONFIG_PATH=$HOME/.kube/config ``` -In order to test the provider, you can simply run `make test`. +The following commands demonstrate how to run unit and acceptance tests respectively. -```sh -$ make test +```console +$ make test # unit tests +$ make testacc TESTARGS="-run ^TestAcc" # acceptance tests ``` -In order to run the full suite of Acceptance tests, run `make testacc`. +1. Run existing tests +1. Write/Update tests +1. Run tests with new changes -*Note:* Acceptance tests create real resources, and often cost money to run. +## Updating changelog -```sh -$ make testacc -``` +A PR that is merged may or may not be added to the changelog. Not every change should be in the changelog since they don't affect users directly. Some instances of PRs that could be excluded are: + +- unit and acceptance tests fixes +- minor documentation changes + +However, PRs of the following categories should be added to the appropriate section: + +* `FEATURES` +* `ENHANCEMENTS` +* `MAJOR BUG FIXES` + +Please refer to our [ChangeLog Guide](../CHANGELOG_GUIDE.md). + +## Creating & Submiting a PR -### Tests +Please refer to this [guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork). -In general, adding test coverage (unit tests and acceptance tests) to new features or bug fixes in your PRs, and sharing the logs of a successful test run on your branch will greatly speed up the acceptance of your PR. Most of our tests can be run against a `kind` cluster, so no additional infrastructure is required. diff --git a/_examples/deferred-actions/cluster.tf b/_examples/deferred-actions/cluster.tf new file mode 100644 index 0000000000..63833fe610 --- /dev/null +++ b/_examples/deferred-actions/cluster.tf @@ -0,0 +1,22 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +terraform { + required_providers { + kind = { + source = "tehcyx/kind" + } + kubernetes = {} + } +} + +resource "kind_cluster" "demo" { + name = "demo-cluster" +} + +provider "kubernetes" { + host = kind_cluster.demo.endpoint + cluster_ca_certificate = kind_cluster.demo.cluster_ca_certificate + client_certificate = kind_cluster.demo.client_certificate + client_key = kind_cluster.demo.client_key +} diff --git a/_examples/deferred-actions/crd.tf b/_examples/deferred-actions/crd.tf new file mode 100644 index 0000000000..f2756a43bc --- /dev/null +++ b/_examples/deferred-actions/crd.tf @@ -0,0 +1,1032 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "kubernetes_manifest" "crd_workspaces" { + manifest = { + "apiVersion" = "apiextensions.k8s.io/v1" + "kind" = "CustomResourceDefinition" + "metadata" = { + "annotations" = { + "controller-gen.kubebuilder.io/version" = "v0.14.0" + } + "name" = "workspaces.app.terraform.io" + } + "spec" = { + "group" = "app.terraform.io" + "names" = { + "kind" = "Workspace" + "listKind" = "WorkspaceList" + "plural" = "workspaces" + "singular" = "workspace" + } + "scope" = "Namespaced" + "versions" = [ + { + "additionalPrinterColumns" = [ + { + "jsonPath" = ".status.workspaceID" + "name" = "Workspace ID" + "type" = "string" + }, + ] + "name" = "v1alpha2" + "schema" = { + "openAPIV3Schema" = { + "description" = "Workspace is the Schema for the workspaces API" + "properties" = { + "apiVersion" = { + "description" = <<-EOT + 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 + EOT + "type" = "string" + } + "kind" = { + "description" = <<-EOT + 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 + EOT + "type" = "string" + } + "metadata" = { + "type" = "object" + } + "spec" = { + "description" = "WorkspaceSpec defines the desired state of Workspace." + "properties" = { + "agentPool" = { + "description" = <<-EOT + HCP Terraform Agents allow HCP Terraform to communicate with isolated, private, or on-premises infrastructure. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/agents + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Agent Pool ID. + Must match pattern: `^apool-[a-zA-Z0-9]+$` + EOT + "pattern" = "^apool-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Agent Pool name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "allowDestroyPlan" = { + "default" = true + "description" = <<-EOT + Allows a destroy plan to be created and applied. + Default: `true`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#destruction-and-deletion + EOT + "type" = "boolean" + } + "applyMethod" = { + "default" = "manual" + "description" = <<-EOT + Define either change will be applied automatically(auto) or require an operator to confirm(manual). + Must be one of the following values: `auto`, `manual`. + Default: `manual`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#auto-apply-and-manual-apply + EOT + "pattern" = "^(auto|manual)$" + "type" = "string" + } + "description" = { + "description" = "Workspace description." + "minLength" = 1 + "type" = "string" + } + "environmentVariables" = { + "description" = <<-EOT + Terraform Environment variables for all plans and applies in this workspace. + Variables defined within a workspace always overwrite variables from variable sets that have the same type and the same key. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#environment-variables + EOT + "items" = { + "description" = <<-EOT + Variables let you customize configurations, modify Terraform's behavior, and store information like provider credentials. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + EOT + "properties" = { + "description" = { + "description" = "Description of the variable." + "minLength" = 1 + "type" = "string" + } + "hcl" = { + "default" = false + "description" = <<-EOT + Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime. + Default: `false`. + EOT + "type" = "boolean" + } + "name" = { + "description" = "Name of the variable." + "minLength" = 1 + "type" = "string" + } + "sensitive" = { + "default" = false + "description" = <<-EOT + Sensitive variables are never shown in the UI or API. + They may appear in Terraform logs if your configuration is designed to output them. + Default: `false`. + EOT + "type" = "boolean" + } + "value" = { + "description" = "Value of the variable." + "minLength" = 1 + "type" = "string" + } + "valueFrom" = { + "description" = "Source for the 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" = <<-EOT + 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? + EOT + "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" + } + "secretKeyRef" = { + "description" = "Selects a key of a Secret." + "properties" = { + "key" = { + "description" = "The key of the secret to select from. Must be a valid secret key." + "type" = "string" + } + "name" = { + "description" = <<-EOT + 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? + EOT + "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" + } + "minItems" = 1 + "type" = "array" + } + "executionMode" = { + "default" = "remote" + "description" = <<-EOT + Define where the Terraform code will be executed. + Must be one of the following values: `agent`, `local`, `remote`. + Default: `remote`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode + EOT + "pattern" = "^(agent|local|remote)$" + "type" = "string" + } + "name" = { + "description" = "Workspace name." + "minLength" = 1 + "type" = "string" + } + "notifications" = { + "description" = <<-EOT + Notifications allow you to send messages to other applications based on run and workspace events. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/notifications + EOT + "items" = { + "description" = <<-EOT + Notifications allow you to send messages to other applications based on run and workspace events. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/notifications + EOT + "properties" = { + "emailAddresses" = { + "description" = <<-EOT + The list of email addresses that will receive notification emails. + It is only available for Terraform Enterprise users. It is not available in HCP Terraform. + EOT + "items" = { + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "emailUsers" = { + "description" = "The list of users belonging to the organization that will receive notification emails." + "items" = { + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "enabled" = { + "default" = true + "description" = <<-EOT + Whether the notification configuration should be enabled or not. + Default: `true`. + EOT + "type" = "boolean" + } + "name" = { + "description" = "Notification name." + "minLength" = 1 + "type" = "string" + } + "token" = { + "description" = "The token of the notification." + "minLength" = 1 + "type" = "string" + } + "triggers" = { + "description" = <<-EOT + The list of run events that will trigger notifications. + Trigger represents the different TFC notifications that can be sent as a run's progress transitions between different states. + There are two categories of triggers: + - Health Events: `assessment:check_failure`, `assessment:drifted`, `assessment:failed`. + - Run Events: `run:applying`, `run:completed`, `run:created`, `run:errored`, `run:needs_attention`, `run:planning`. + EOT + "items" = { + "description" = <<-EOT + NotificationTrigger represents the different TFC notifications that can be sent as a run's progress transitions between different states. + This must be aligned with go-tfe type `NotificationTriggerType`. + Must be one of the following values: `run:applying`, `assessment:check_failure`, `run:completed`, `run:created`, `assessment:drifted`, `run:errored`, `assessment:failed`, `run:needs_attention`, `run:planning`. + EOT + "enum" = [ + "run:applying", + "assessment:check_failure", + "run:completed", + "run:created", + "assessment:drifted", + "run:errored", + "assessment:failed", + "run:needs_attention", + "run:planning", + ] + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "type" = { + "description" = <<-EOT + The type of the notification. + Must be one of the following values: `email`, `generic`, `microsoft-teams`, `slack`. + EOT + "enum" = [ + "email", + "generic", + "microsoft-teams", + "slack", + ] + "type" = "string" + } + "url" = { + "description" = <<-EOT + The URL of the notification. + Must match pattern: `^https?://.*` + EOT + "pattern" = "^https?://.*" + "type" = "string" + } + } + "required" = [ + "name", + "type", + ] + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "organization" = { + "description" = <<-EOT + Organization name where the Workspace will be created. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations + EOT + "minLength" = 1 + "type" = "string" + } + "project" = { + "description" = <<-EOT + Projects let you organize your workspaces into groups. + Default: default organization project. + More information: + - https://developer.hashicorp.com/terraform/tutorials/cloud/projects + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Project ID. + Must match pattern: `^prj-[a-zA-Z0-9]+$` + EOT + "pattern" = "^prj-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Project name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "remoteStateSharing" = { + "description" = <<-EOT + Remote state access between workspaces. + By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces + EOT + "properties" = { + "allWorkspaces" = { + "default" = false + "description" = <<-EOT + Allow access to the state for all workspaces within the same organization. + Default: `false`. + EOT + "type" = "boolean" + } + "workspaces" = { + "description" = "Allow access to the state for specific workspaces within the same organization." + "items" = { + "description" = <<-EOT + ConsumerWorkspace allows access to the state for specific workspaces within the same organization. + Only one of the fields `ID` or `Name` is allowed. + At least one of the fields `ID` or `Name` is mandatory. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#remote-state-access-controls + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Consumer Workspace ID. + Must match pattern: `^ws-[a-zA-Z0-9]+$` + EOT + "pattern" = "^ws-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Consumer Workspace name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + } + "type" = "object" + } + "runTasks" = { + "description" = <<-EOT + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks + EOT + "items" = { + "description" = <<-EOT + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. + Only one of the fields `ID` or `Name` is allowed. + At least one of the fields `ID` or `Name` is mandatory. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks + EOT + "properties" = { + "enforcementLevel" = { + "default" = "advisory" + "description" = <<-EOT + Run Task Enforcement Level. Can be one of `advisory` or `mandatory`. Default: `advisory`. + Must be one of the following values: `advisory`, `mandatory` + Default: `advisory`. + EOT + "pattern" = "^(advisory|mandatory)$" + "type" = "string" + } + "id" = { + "description" = <<-EOT + Run Task ID. + Must match pattern: `^task-[a-zA-Z0-9]+$` + EOT + "pattern" = "^task-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Run Task Name." + "minLength" = 1 + "type" = "string" + } + "stage" = { + "default" = "post_plan" + "description" = <<-EOT + Run Task Stage. + Must be one of the following values: `pre_apply`, `pre_plan`, `post_plan`. + Default: `post_plan`. + EOT + "pattern" = "^(pre_apply|pre_plan|post_plan)$" + "type" = "string" + } + } + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "runTriggers" = { + "description" = <<-EOT + Run triggers allow you to connect this workspace to one or more source workspaces. + These connections allow runs to queue automatically in this workspace on successful apply of runs in any of the source workspaces. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers + EOT + "items" = { + "description" = <<-EOT + RunTrigger allows you to connect this workspace to one or more source workspaces. + These connections allow runs to queue automatically in this workspace on successful apply of runs in any of the source workspaces. + Only one of the fields `ID` or `Name` is allowed. + At least one of the fields `ID` or `Name` is mandatory. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Source Workspace ID. + Must match pattern: `^ws-[a-zA-Z0-9]+$` + EOT + "pattern" = "^ws-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Source Workspace Name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "sshKey" = { + "description" = <<-EOT + SSH key used to clone Terraform modules. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/ssh-keys + EOT + "properties" = { + "id" = { + "description" = <<-EOT + SSH key ID. + Must match pattern: `^sshkey-[a-zA-Z0-9]+$` + EOT + "pattern" = "^sshkey-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "SSH key name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "tags" = { + "description" = <<-EOT + Workspace tags are used to help identify and group together workspaces. + Tags must be one or more characters; can include letters, numbers, colons, hyphens, and underscores; and must begin and end with a letter or number. + EOT + "items" = { + "description" = <<-EOT + Tags allows you to correlate, organize, and even filter workspaces based on the assigned tags. + Tags must be one or more characters; can include letters, numbers, colons, hyphens, and underscores; and must begin and end with a letter or number. + Must match pattern: `^[A-Za-z0-9][A-Za-z0-9:_-]*$` + EOT + "pattern" = "^[A-Za-z0-9][A-Za-z0-9:_-]*$" + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "teamAccess" = { + "description" = <<-EOT + HCP Terraform workspaces can only be accessed by users with the correct permissions. + You can manage permissions for a workspace on a per-team basis. + When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, + with full admin permissions. These teams' access can't be removed from a workspace. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access + EOT + "items" = { + "description" = <<-EOT + HCP Terraform workspaces can only be accessed by users with the correct permissions. + You can manage permissions for a workspace on a per-team basis. + When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, + with full admin permissions. These teams' access can't be removed from a workspace. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access + EOT + "properties" = { + "access" = { + "description" = <<-EOT + There are two ways to choose which permissions a given team has on a workspace: fixed permission sets, and custom permissions. + Must be one of the following values: `admin`, `custom`, `plan`, `read`, `write`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#workspace-permissions + EOT + "pattern" = "^(admin|custom|plan|read|write)$" + "type" = "string" + } + "custom" = { + "description" = <<-EOT + Custom permissions let you assign specific, finer-grained permissions to a team than the broader fixed permission sets provide. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#custom-workspace-permissions + EOT + "properties" = { + "runTasks" = { + "description" = <<-EOT + Manage Workspace Run Tasks. + Default: `false`. + EOT + "type" = "boolean" + } + "runs" = { + "default" = "read" + "description" = <<-EOT + Run access. + Must be one of the following values: `apply`, `plan`, `read`. + Default: `read`. + EOT + "pattern" = "^(apply|plan|read)$" + "type" = "string" + } + "sentinel" = { + "default" = "none" + "description" = <<-EOT + Download Sentinel mocks. + Must be one of the following values: `none`, `read`. + Default: `none`. + EOT + "pattern" = "^(none|read)$" + "type" = "string" + } + "stateVersions" = { + "default" = "none" + "description" = <<-EOT + State access. + Must be one of the following values: `none`, `read`, `read-outputs`, `write`. + Default: `none`. + EOT + "pattern" = "^(none|read|read-outputs|write)$" + "type" = "string" + } + "variables" = { + "default" = "none" + "description" = <<-EOT + Variable access. + Must be one of the following values: `none`, `read`, `write`. + Default: `none`. + EOT + "pattern" = "^(none|read|write)$" + "type" = "string" + } + "workspaceLocking" = { + "default" = false + "description" = <<-EOT + Lock/unlock workspace. + Default: `false`. + EOT + "type" = "boolean" + } + } + "type" = "object" + } + "team" = { + "description" = <<-EOT + Team to grant access. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/teams + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Team ID. + Must match pattern: `^team-[a-zA-Z0-9]+$` + EOT + "pattern" = "^team-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Team name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + } + "required" = [ + "access", + "team", + ] + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "terraformVariables" = { + "description" = <<-EOT + Terraform variables for all plans and applies in this workspace. + Variables defined within a workspace always overwrite variables from variable sets that have the same type and the same key. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#terraform-variables + EOT + "items" = { + "description" = <<-EOT + Variables let you customize configurations, modify Terraform's behavior, and store information like provider credentials. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + EOT + "properties" = { + "description" = { + "description" = "Description of the variable." + "minLength" = 1 + "type" = "string" + } + "hcl" = { + "default" = false + "description" = <<-EOT + Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime. + Default: `false`. + EOT + "type" = "boolean" + } + "name" = { + "description" = "Name of the variable." + "minLength" = 1 + "type" = "string" + } + "sensitive" = { + "default" = false + "description" = <<-EOT + Sensitive variables are never shown in the UI or API. + They may appear in Terraform logs if your configuration is designed to output them. + Default: `false`. + EOT + "type" = "boolean" + } + "value" = { + "description" = "Value of the variable." + "minLength" = 1 + "type" = "string" + } + "valueFrom" = { + "description" = "Source for the 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" = <<-EOT + 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? + EOT + "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" + } + "secretKeyRef" = { + "description" = "Selects a key of a Secret." + "properties" = { + "key" = { + "description" = "The key of the secret to select from. Must be a valid secret key." + "type" = "string" + } + "name" = { + "description" = <<-EOT + 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? + EOT + "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" + } + "minItems" = 1 + "type" = "array" + } + "terraformVersion" = { + "description" = <<-EOT + The version of Terraform to use for this workspace. + If not specified, the latest available version will be used. + Must match pattern: `^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$` + More information: + - https://www.terraform.io/cloud-docs/workspaces/settings#terraform-version + EOT + "pattern" = "^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$" + "type" = "string" + } + "token" = { + "description" = "API Token to be used for API calls." + "properties" = { + "secretKeyRef" = { + "description" = "Selects a key of a secret in the workspace's namespace" + "properties" = { + "key" = { + "description" = "The key of the secret to select from. Must be a valid secret key." + "type" = "string" + } + "name" = { + "description" = <<-EOT + 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? + EOT + "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" + } + } + "required" = [ + "secretKeyRef", + ] + "type" = "object" + } + "versionControl" = { + "description" = <<-EOT + Settings for the workspace's VCS repository, enabling the UI/VCS-driven run workflow. + Omit this argument to utilize the CLI-driven and API-driven workflows, where runs are not driven by webhooks on your VCS provider. + More information: + - https://www.terraform.io/cloud-docs/run/ui + - https://www.terraform.io/cloud-docs/vcs + EOT + "properties" = { + "branch" = { + "description" = "The repository branch that Run will execute from. This defaults to the repository's default branch (e.g. main)." + "minLength" = 1 + "type" = "string" + } + "oAuthTokenID" = { + "description" = <<-EOT + The VCS Connection (OAuth Connection + Token) to use. + Must match pattern: `^ot-[a-zA-Z0-9]+$` + EOT + "pattern" = "^ot-[a-zA-Z0-9]+$" + "type" = "string" + } + "repository" = { + "description" = "A reference to your VCS repository in the format `/` where `` and `` refer to the organization and repository in your VCS provider." + "minLength" = 1 + "type" = "string" + } + "speculativePlans" = { + "default" = true + "description" = <<-EOT + Whether this workspace allows automatic speculative plans on PR. + Default: `true`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/run/ui#speculative-plans-on-pull-requests + - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations#speculative-plans + EOT + "type" = "boolean" + } + } + "type" = "object" + } + "workingDirectory" = { + "description" = <<-EOT + The directory where Terraform will execute, specified as a relative path from the root of the configuration directory. + More information: + - https://www.terraform.io/cloud-docs/workspaces/settings#terraform-working-directory + EOT + "minLength" = 1 + "type" = "string" + } + } + "required" = [ + "name", + "organization", + "token", + ] + "type" = "object" + } + "status" = { + "description" = "WorkspaceStatus defines the observed state of Workspace." + "properties" = { + "observedGeneration" = { + "description" = "Real world state generation." + "format" = "int64" + "type" = "integer" + } + "plan" = { + "description" = "Run status of plan-only/speculative plan that was triggered manually." + "properties" = { + "id" = { + "description" = "Latest plan-only/speculative plan HCP Terraform run ID." + "type" = "string" + } + "status" = { + "description" = "Latest plan-only/speculative plan HCP Terraform run status." + "type" = "string" + } + "terraformVersion" = { + "description" = "The version of Terraform to use for this run." + "pattern" = "^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$" + "type" = "string" + } + } + "type" = "object" + } + "runStatus" = { + "description" = "Workspace Runs status." + "properties" = { + "configurationVersion" = { + "description" = "The configuration version of this run." + "type" = "string" + } + "id" = { + "description" = "Current(both active and finished) HCP Terraform run ID." + "type" = "string" + } + "outputRunID" = { + "description" = "Run ID of the latest run that could update the outputs." + "type" = "string" + } + "status" = { + "description" = "Current(both active and finished) HCP Terraform run status." + "type" = "string" + } + } + "type" = "object" + } + "terraformVersion" = { + "description" = "Workspace Terraform version." + "pattern" = "^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$" + "type" = "string" + } + "updateAt" = { + "description" = "Workspace last update timestamp." + "format" = "int64" + "type" = "integer" + } + "variables" = { + "description" = "Workspace variables." + "items" = { + "properties" = { + "category" = { + "description" = "Category of the variable." + "type" = "string" + } + "id" = { + "description" = "ID of the variable." + "type" = "string" + } + "name" = { + "description" = "Name of the variable." + "type" = "string" + } + "valueID" = { + "description" = "ValueID is a hash of the variable on the CRD end." + "type" = "string" + } + "versionID" = { + "description" = "VersionID is a hash of the variable on the TFC end." + "type" = "string" + } + } + "required" = [ + "category", + "id", + "name", + "valueID", + "versionID", + ] + "type" = "object" + } + "type" = "array" + } + "workspaceID" = { + "description" = "Workspace ID that is managed by the controller." + "type" = "string" + } + } + "required" = [ + "workspaceID", + ] + "type" = "object" + } + } + "required" = [ + "spec", + ] + "type" = "object" + } + } + "served" = true + "storage" = true + "subresources" = { + "status" = {} + } + }, + ] + } + } +} diff --git a/_examples/deferred-actions/workspace.tf b/_examples/deferred-actions/workspace.tf new file mode 100644 index 0000000000..c6f2d6b356 --- /dev/null +++ b/_examples/deferred-actions/workspace.tf @@ -0,0 +1,29 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "kubernetes_namespace_v1" "demo_ns" { + metadata { + name = "demo-ns" + } +} + +resource "kubernetes_manifest" "demo_workspace" { + manifest = { + apiVersion = "app.terraform.io/v1alpha2" + kind = kubernetes_manifest.crd_workspaces.object.spec.names.kind + metadata = { + name = "deferred-demo" + namespace = kubernetes_namespace_v1.demo_ns.id + } + spec = { + name = "demo-ws" + organization = "demo-org" + token = { + secretKeyRef = { + name = "demo-token" + key = "token" + } + } + } + } +} \ No newline at end of file diff --git a/docs/data-sources/all_namespaces.md b/docs/data-sources/all_namespaces.md new file mode 100644 index 0000000000..e0dc8a1d6b --- /dev/null +++ b/docs/data-sources/all_namespaces.md @@ -0,0 +1,34 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_all_namespaces" +description: |- + Lists all namespaces within a cluster. +--- + +# kubernetes_all_namespaces + +This data source provides a mechanism for listing the names of all available namespaces in a Kubernetes cluster. It can be used to check for existence of a specific namespaces or to apply another resource to all or a subset of existing namespaces in a cluster.In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users. + + +## Schema + +### Read-Only + +- `id` (String) The ID of this resource. +- `namespaces` (List of String) List of all namespaces in a cluster. + + + +## Example Usage + +```terraform +data "kubernetes_all_namespaces" "allns" {} + +output "all-ns" { + value = data.kubernetes_all_namespaces.allns.namespaces +} + +output "ns-present" { + value = contains(data.kubernetes_all_namespaces.allns.namespaces, "kube-system") +} +``` diff --git a/docs/data-sources/config_map.md b/docs/data-sources/config_map.md new file mode 100644 index 0000000000..4a69f1abff --- /dev/null +++ b/docs/data-sources/config_map.md @@ -0,0 +1,84 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map" +description: |- + This data source reads configuration data from a config map. +--- + +# kubernetes_config_map + +Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard config_map's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `immutable` (Boolean) Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. + +### Read-Only + +- `binary_data` (Map of String) A map of the config map binary data. +- `data` (Map of String) A map of the config map data. +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the config_map that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the config_map. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the config_map, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the config_map must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this config_map that can be used by clients to determine when config_map has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this config_map. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +~> **Note:** All arguments including the config map data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +## Example Usage + +```terraform +data "kubernetes_config_map" "example" { + metadata { + name = "my-config" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `metadata` - (Required) Standard config map's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) + +## Nested Blocks + +### `metadata` + +#### Arguments + +* `name` - (Required) Name of the config map, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) +* `namespace` - (Optional) Namespace defines the space within which name of the config map must be unique. + +#### Attributes + +* `generation` - A sequence number representing a specific generation of the desired state. +* `resource_version` - An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) +* `uid` - The unique in time and space value for this config map. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) + +## Attribute Reference + +* `data` - A map of the config map data. +* `binary_data` - A map of preserved non-UTF8 data. For more info see [Kubernetes API reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#configmap-v1-core). diff --git a/docs/data-sources/config_map_v1.md b/docs/data-sources/config_map_v1.md new file mode 100644 index 0000000000..f98a9eed9c --- /dev/null +++ b/docs/data-sources/config_map_v1.md @@ -0,0 +1,58 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map_v1" +description: |- + This data source reads configuration data from a config map. +--- + +# kubernetes_config_map_v1 + +Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard config_map's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `immutable` (Boolean) Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. + +### Read-Only + +- `binary_data` (Map of String) A map of the config map binary data. +- `data` (Map of String) A map of the config map data. +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the config_map that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the config_map. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the config_map, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the config_map must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this config_map that can be used by clients to determine when config_map has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this config_map. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +~> **Note:** All arguments including the config map data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +## Example Usage + +```terraform +data "kubernetes_config_map_v1" "example" { + metadata { + name = "my-config" + } +} +``` diff --git a/docs/data-sources/endpoints_v1.md b/docs/data-sources/endpoints_v1.md new file mode 100644 index 0000000000..38cc89ca0b --- /dev/null +++ b/docs/data-sources/endpoints_v1.md @@ -0,0 +1,106 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_endpoints_v1" +description: |- + An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. +--- + +# kubernetes_endpoints_v1 + +An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard endpoints's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `subset` (Block Set) Set of addresses and ports that comprise a service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors (see [below for nested schema](#nestedblock--subset)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the endpoints that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoints. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the endpoints, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the endpoints must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this endpoints that can be used by clients to determine when endpoints has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this endpoints. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `subset` + +Optional: + +- `address` (Block Set) IP address which offers the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize. (see [below for nested schema](#nestedblock--subset--address)) +- `not_ready_address` (Block Set) IP address which offers the related ports but is not currently marked as ready because it have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check. (see [below for nested schema](#nestedblock--subset--not_ready_address)) +- `port` (Block Set) Port number available on the related IP addresses. (see [below for nested schema](#nestedblock--subset--port)) + + +### Nested Schema for `subset.address` + +Required: + +- `ip` (String) The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). + +Optional: + +- `hostname` (String) The Hostname of this endpoint. +- `node_name` (String) Node hosting this endpoint. This can be used to determine endpoints local to a node. + + + +### Nested Schema for `subset.not_ready_address` + +Required: + +- `ip` (String) The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). + +Optional: + +- `hostname` (String) The Hostname of this endpoint. +- `node_name` (String) Node hosting this endpoint. This can be used to determine endpoints local to a node. + + + +### Nested Schema for `subset.port` + +Required: + +- `port` (Number) The port that will be exposed by this endpoint. + +Optional: + +- `name` (String) The name of this port within the endpoint. Must be a DNS_LABEL. Optional if only one Port is defined on this endpoint. +- `protocol` (String) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. + + + + + +## Example Usage + +```terraform +data "kubernetes_endpoints_v1" "api_endpoints" { + metadata { + name = "kubernetes" + namespace = "default" + } +} +``` + diff --git a/docs/data-sources/ingress.md b/docs/data-sources/ingress.md new file mode 100644 index 0000000000..548563ea4d --- /dev/null +++ b/docs/data-sources/ingress.md @@ -0,0 +1,150 @@ +--- +subcategory: "extensions/v1beta1" +page_title: "Kubernetes: kubernetes_ingress" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# kubernetes_ingress + +Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. This data source allows you to pull data about such ingress. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard ingress's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedatt--spec)) +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the ingress. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the ingress, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the ingress must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this ingress that can be used by clients to determine when ingress has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this ingress. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `backend` (List of Object) (see [below for nested schema](#nestedobjatt--spec--backend)) +- `ingress_class_name` (String) +- `rule` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule)) +- `tls` (List of Object) (see [below for nested schema](#nestedobjatt--spec--tls)) + + +### Nested Schema for `spec.backend` + +Read-Only: + +- `service_name` (String) +- `service_port` (String) + + + +### Nested Schema for `spec.rule` + +Read-Only: + +- `host` (String) +- `http` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http)) + + +### Nested Schema for `spec.rule.http` + +Read-Only: + +- `path` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path)) + + +### Nested Schema for `spec.rule.http.path` + +Read-Only: + +- `backend` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path--backend)) +- `path` (String) + + +### Nested Schema for `spec.rule.http.path.backend` + +Read-Only: + +- `service_name` (String) +- `service_port` (String) + + + + + + +### Nested Schema for `spec.tls` + +Read-Only: + +- `hosts` (List of String) +- `secret_name` (String) + + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +data "kubernetes_ingress" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = data.aws_route53_zone.k8.zone_id + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.hostname] +} +``` + diff --git a/docs/data-sources/ingress_v1.md b/docs/data-sources/ingress_v1.md new file mode 100644 index 0000000000..864f7c8cda --- /dev/null +++ b/docs/data-sources/ingress_v1.md @@ -0,0 +1,206 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_v1" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# kubernetes_ingress_v1 + +Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. This data source allows you to pull data about such ingress. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard ingress's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedatt--spec)) +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the ingress. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the ingress, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the ingress must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this ingress that can be used by clients to determine when ingress has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this ingress. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `default_backend` (List of Object) (see [below for nested schema](#nestedobjatt--spec--default_backend)) +- `ingress_class_name` (String) +- `rule` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule)) +- `tls` (List of Object) (see [below for nested schema](#nestedobjatt--spec--tls)) + + +### Nested Schema for `spec.default_backend` + +Read-Only: + +- `resource` (List of Object) (see [below for nested schema](#nestedobjatt--spec--default_backend--resource)) +- `service` (List of Object) (see [below for nested schema](#nestedobjatt--spec--default_backend--service)) + + +### Nested Schema for `spec.default_backend.resource` + +Read-Only: + +- `api_group` (String) +- `kind` (String) +- `name` (String) + + + +### Nested Schema for `spec.default_backend.service` + +Read-Only: + +- `name` (String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--default_backend--service--port)) + + +### Nested Schema for `spec.default_backend.service.port` + +Read-Only: + +- `name` (String) +- `number` (Number) + + + + + +### Nested Schema for `spec.rule` + +Read-Only: + +- `host` (String) +- `http` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http)) + + +### Nested Schema for `spec.rule.http` + +Read-Only: + +- `path` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path)) + + +### Nested Schema for `spec.rule.http.path` + +Read-Only: + +- `backend` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path--backend)) +- `path` (String) +- `path_type` (String) + + +### Nested Schema for `spec.rule.http.path.backend` + +Read-Only: + +- `resource` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path--backend--resource)) +- `service` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path--backend--service)) + + +### Nested Schema for `spec.rule.http.path.backend.resource` + +Read-Only: + +- `api_group` (String) +- `kind` (String) +- `name` (String) + + + +### Nested Schema for `spec.rule.http.path.backend.service` + +Read-Only: + +- `name` (String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--rule--http--path--backend--service--port)) + + +### Nested Schema for `spec.rule.http.path.backend.service.port` + +Read-Only: + +- `name` (String) +- `number` (Number) + + + + + + + + +### Nested Schema for `spec.tls` + +Read-Only: + +- `hosts` (List of String) +- `secret_name` (String) + + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +data "kubernetes_ingress_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = data.aws_route53_zone.k8.zone_id + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.hostname] +} +``` diff --git a/docs/data-sources/mutating_webhook_configuration_v1.md b/docs/data-sources/mutating_webhook_configuration_v1.md new file mode 100644 index 0000000000..168eec54e3 --- /dev/null +++ b/docs/data-sources/mutating_webhook_configuration_v1.md @@ -0,0 +1,139 @@ +--- +subcategory: "admissionregistration/v1" +page_title: "Kubernetes: kubernetes_mutating_webhook_configuration_v1" +description: |- + Mutating Webhook Configuration configures a mutating admission webhook +--- + +# kubernetes_mutating_webhook_configuration_v1 + +A Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). This data source allows you to pull data about a given mutating webhook configuration based on its name. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard mutating webhook configuration's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `webhook` (List of Object) Webhooks is a list of webhooks and the affected resources and operations. (see [below for nested schema](#nestedatt--webhook)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the mutating webhook configuration that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the mutating webhook configuration. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the mutating webhook configuration, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this mutating webhook configuration that can be used by clients to determine when mutating webhook configuration has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this mutating webhook configuration. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `webhook` + +Read-Only: + +- `admission_review_versions` (List of String) +- `client_config` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--client_config)) +- `failure_policy` (String) +- `match_policy` (String) +- `name` (String) +- `namespace_selector` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--namespace_selector)) +- `object_selector` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--object_selector)) +- `reinvocation_policy` (String) +- `rule` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--rule)) +- `side_effects` (String) +- `timeout_seconds` (Number) + + +### Nested Schema for `webhook.client_config` + +Read-Only: + +- `ca_bundle` (String) +- `service` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--client_config--service)) +- `url` (String) + + +### Nested Schema for `webhook.client_config.service` + +Read-Only: + +- `name` (String) +- `namespace` (String) +- `path` (String) +- `port` (Number) + + + + +### Nested Schema for `webhook.namespace_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--namespace_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `webhook.namespace_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + +### Nested Schema for `webhook.object_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--webhook--object_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `webhook.object_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + +### Nested Schema for `webhook.rule` + +Read-Only: + +- `api_groups` (List of String) +- `api_versions` (List of String) +- `operations` (List of String) +- `resources` (List of String) +- `scope` (String) + + + + + +## Example Usage + +```terraform +data "kubernetes_mutating_webhook_configuration_v1" "example" { + metadata { + name = "terraform-example" + } +} +``` diff --git a/docs/data-sources/namespace.md b/docs/data-sources/namespace.md new file mode 100644 index 0000000000..881c09bff6 --- /dev/null +++ b/docs/data-sources/namespace.md @@ -0,0 +1,58 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_namespace" +description: |- + Queries attributes of a Namespace within the cluster. +--- + +# kubernetes_namespace + +This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard namespace's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) Spec defines the behavior of the Namespace. (see [below for nested schema](#nestedatt--spec)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the namespace. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the namespace, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespace has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this namespace. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `finalizers` (List of String) + + + + +## Example Usage + +```terraform +data "kubernetes_namespace" "example" { + metadata { + name = "kube-system" + } +} +``` diff --git a/website/docs/d/namespace.html.markdown b/docs/data-sources/namespace_v1.md similarity index 57% rename from website/docs/d/namespace.html.markdown rename to docs/data-sources/namespace_v1.md index 5c50955ace..e54f11ca33 100644 --- a/website/docs/d/namespace.html.markdown +++ b/docs/data-sources/namespace_v1.md @@ -1,20 +1,56 @@ --- subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_namespace" +page_title: "Kubernetes: kubernetes_namespace_v1" description: |- Queries attributes of a Namespace within the cluster. --- -# kubernetes_namespace +# kubernetes_namespace_v1 + +This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard namespace's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) Spec defines the behavior of the Namespace. (see [below for nested schema](#nestedatt--spec)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the namespace. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the namespace, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespace has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this namespace. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `finalizers` (List of String) + + -This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. -In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users. ## Example Usage -```hcl -data "kubernetes_namespace" "example" { +```terraform +data "kubernetes_namespace_v1" "example" { metadata { name = "kube-system" } diff --git a/docs/data-sources/nodes.md b/docs/data-sources/nodes.md new file mode 100644 index 0000000000..54d5ec792a --- /dev/null +++ b/docs/data-sources/nodes.md @@ -0,0 +1,142 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_nodes" +description: |- + Gets nodes within a cluster. +--- + +# kubernetes_nodes + +This data source provides a mechanism for listing the names of nodes in a kubernetes cluster.By default, all nodes in the cluster are returned, but queries by node label are also supported. It can be used to check for the existence of a specific node or to lookup a node to apply a taint with the `kubernetes_node_taint` resource. + + +## Schema + +### Optional + +- `metadata` (Block List, Max: 1) Metadata fields to narrow node selection. (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `nodes` (List of Object) List of nodes in a cluster. (see [below for nested schema](#nestedatt--nodes)) + + +### Nested Schema for `metadata` + +Required: + +- `labels` (Map of String) Select nodes with these labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + +### Nested Schema for `nodes` + +Read-Only: + +- `metadata` (List of Object) (see [below for nested schema](#nestedobjatt--nodes--metadata)) +- `spec` (List of Object) (see [below for nested schema](#nestedobjatt--nodes--spec)) +- `status` (List of Object) (see [below for nested schema](#nestedobjatt--nodes--status)) + + +### Nested Schema for `nodes.metadata` + +Read-Only: + +- `annotations` (Map of String) +- `generation` (Number) +- `labels` (Map of String) +- `name` (String) +- `resource_version` (String) +- `uid` (String) + + + +### Nested Schema for `nodes.spec` + +Read-Only: + +- `pod_cidr` (String) +- `pod_cidrs` (List of String) +- `provider_id` (String) +- `taints` (List of Object) (see [below for nested schema](#nestedobjatt--nodes--spec--taints)) +- `unschedulable` (Boolean) + + +### Nested Schema for `nodes.spec.taints` + +Read-Only: + +- `effect` (String) +- `key` (String) +- `value` (String) + + + + +### Nested Schema for `nodes.status` + +Read-Only: + +- `addresses` (List of Object) (see [below for nested schema](#nestedobjatt--nodes--status--addresses)) +- `allocatable` (Map of String) +- `capacity` (Map of String) +- `node_info` (List of Object) (see [below for nested schema](#nestedobjatt--nodes--status--node_info)) + + +### Nested Schema for `nodes.status.addresses` + +Read-Only: + +- `address` (String) +- `type` (String) + + + +### Nested Schema for `nodes.status.node_info` + +Read-Only: + +- `architecture` (String) +- `boot_id` (String) +- `container_runtime_version` (String) +- `kernel_version` (String) +- `kube_proxy_version` (String) +- `kubelet_version` (String) +- `machine_id` (String) +- `operating_system` (String) +- `os_image` (String) +- `system_uuid` (String) + + + + + + +## Example usage + +### All nodes + +```terraform +data "kubernetes_nodes" "example" {} + +output "node-ids" { + value = [for node in data.kubernetes_nodes.example.nodes : node.spec.0.provider_id] +} +``` + +### By label + +```terraform +data "kubernetes_nodes" "example" { + metadata { + labels = { + "kubernetes.io/os" = "linux" + } + } +} + +output "linux-node-names" { + value = [for node in data.kubernetes_nodes.example.nodes : node.metadata.0.name] +} +``` diff --git a/docs/data-sources/persistent_volume_claim.md b/docs/data-sources/persistent_volume_claim.md new file mode 100644 index 0000000000..a19c8ef340 --- /dev/null +++ b/docs/data-sources/persistent_volume_claim.md @@ -0,0 +1,107 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim" +description: |- + A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. +--- + +# kubernetes_persistent_volume_claim + +A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume claim's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List) Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume claim, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the persistent volume claim must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume claim. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `selector` (Block List) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + +Read-Only: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (List of Object) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedatt--spec--resources)) + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + + + +## Example Usage + +```terraform +data "kubernetes_persistent_volume_claim" "example" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim.example default/example-name +``` diff --git a/docs/data-sources/persistent_volume_claim_v1.md b/docs/data-sources/persistent_volume_claim_v1.md new file mode 100644 index 0000000000..f0d72aca93 --- /dev/null +++ b/docs/data-sources/persistent_volume_claim_v1.md @@ -0,0 +1,107 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim_v1" +description: |- + A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. +--- + +# kubernetes_persistent_volume_claim_v1 + +A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume claim's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List) Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume claim, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the persistent volume claim must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume claim. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `selector` (Block List) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + +Read-Only: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (List of Object) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedatt--spec--resources)) + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + + + +## Example Usage + +```terraform +data "kubernetes_persistent_volume_claim_v1" "example" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim_v1.example default/example-name +``` diff --git a/docs/data-sources/persistent_volume_v1.md b/docs/data-sources/persistent_volume_v1.md new file mode 100644 index 0000000000..ed9fc87ecb --- /dev/null +++ b/docs/data-sources/persistent_volume_v1.md @@ -0,0 +1,496 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_v1" +description: |- + A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. +--- + +# kubernetes_persistent_volume_v1 + +A PersistentVolume (PV) is a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. This data source retrieves information about the specified PV. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List) Spec of the persistent volume owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `access_modes` (Set of String) Contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `capacity` (Map of String) A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity +- `persistent_volume_source` (Block List, Min: 1, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--persistent_volume_source)) + +Optional: + +- `claim_ref` (Block List, Max: 1) A reference to the persistent volume claim details for statically managed PVs. More Info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding (see [below for nested schema](#nestedblock--spec--claim_ref)) +- `mount_options` (Set of String) A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply fail if one is invalid. +- `node_affinity` (Block List, Max: 1) A description of the persistent volume's node affinity. More info: https://kubernetes.io/docs/concepts/storage/volumes/#local (see [below for nested schema](#nestedblock--spec--node_affinity)) +- `persistent_volume_reclaim_policy` (String) What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming +- `storage_class_name` (String) A description of the persistent volume's class. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class +- `volume_mode` (String) Defines if a volume is intended to be used with a formatted filesystem. or to remain in raw block state. + + +### Nested Schema for `spec.persistent_volume_source` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--persistent_volume_source--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--persistent_volume_source--cinder)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--persistent_volume_source--gce_persistent_disk)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--persistent_volume_source--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--persistent_volume_source--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--persistent_volume_source--local)) +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--persistent_volume_source--nfs)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--persistent_volume_source--photon_persistent_disk)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--persistent_volume_source--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--rbd)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--persistent_volume_source--vsphere_volume)) + + +### Nested Schema for `spec.persistent_volume_source.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.persistent_volume_source.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.persistent_volume_source.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.persistent_volume_source.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--persistent_volume_source--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.persistent_volume_source.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.persistent_volume_source.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi +- `volume_handle` (String) A string value that uniquely identifies the volume. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `controller_expand_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--controller_expand_secret_ref)) +- `controller_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--controller_publish_secret_ref)) +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--node_publish_secret_ref)) +- `node_stage_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--node_stage_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.persistent_volume_source.csi.controller_expand_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.controller_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.node_stage_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.persistent_volume_source.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flex_volume--secret_ref)) + + +### Nested Schema for `spec.persistent_volume_source.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.persistent_volume_source.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.persistent_volume_source.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.persistent_volume_source.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.persistent_volume_source.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.persistent_volume_source.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.persistent_volume_source.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.persistent_volume_source.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.persistent_volume_source.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.persistent_volume_source.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--rbd--secret_ref)) + + +### Nested Schema for `spec.persistent_volume_source.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + +### Nested Schema for `spec.claim_ref` + +Required: + +- `name` (String) The name of the PersistentVolumeClaim + +Optional: + +- `namespace` (String) The namespace of the PersistentVolumeClaim. Uses 'default' namespace if none is specified. + + + +### Nested Schema for `spec.node_affinity` + +Optional: + +- `required` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--node_affinity--required)) + + +### Nested Schema for `spec.node_affinity.required` + +Required: + +- `node_selector_term` (Block List, Min: 1) (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term)) + + +### Nested Schema for `spec.node_affinity.required.node_selector_term` + +Optional: + +- `match_expressions` (Block List) A list of node selector requirements by node's labels. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term--match_fields)) + + +### Nested Schema for `spec.node_affinity.required.node_selector_term.match_expressions` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + +### Nested Schema for `spec.node_affinity.required.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + + + +## Example Usage + +```terraform +data "kubernetes_persistent_volume_v1" "example" { + metadata { + name = "terraform-example" + } +} +data "kubernetes_secret" "example" { + metadata { + name = data.kubernetes_persistent_volume_v1.example.spec[0].persistent_volume_source[0].azure_file[0].secret_name + } +} +output "azure_storageaccount_name" { + value = data.kubernetes_secret.example.data.azurestorageaccountname +} +output "azure_storageaccount_key" { + value = data.kubernetes_secret.example.data.azurestorageaccountkey +} +``` + diff --git a/docs/data-sources/pod.md b/docs/data-sources/pod.md new file mode 100644 index 0000000000..96946e8752 --- /dev/null +++ b/docs/data-sources/pod.md @@ -0,0 +1,2033 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# kubernetes_pod + +A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context.Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) Specification of the desired behavior of the pod. (see [below for nested schema](#nestedatt--spec)) +- `status` (String) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `active_deadline_seconds` (Number) +- `affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity)) +- `automount_service_account_token` (Boolean) +- `container` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container)) +- `dns_config` (List of Object) (see [below for nested schema](#nestedobjatt--spec--dns_config)) +- `dns_policy` (String) +- `enable_service_links` (Boolean) +- `host_aliases` (List of Object) (see [below for nested schema](#nestedobjatt--spec--host_aliases)) +- `host_ipc` (Boolean) +- `host_network` (Boolean) +- `host_pid` (Boolean) +- `hostname` (String) +- `image_pull_secrets` (List of Object) (see [below for nested schema](#nestedobjatt--spec--image_pull_secrets)) +- `init_container` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container)) +- `node_name` (String) +- `node_selector` (Map of String) +- `os` (List of Object) (see [below for nested schema](#nestedobjatt--spec--os)) +- `priority_class_name` (String) +- `readiness_gate` (List of Object) (see [below for nested schema](#nestedobjatt--spec--readiness_gate)) +- `restart_policy` (String) +- `runtime_class_name` (String) +- `scheduler_name` (String) +- `security_context` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context)) +- `service_account_name` (String) +- `share_process_namespace` (Boolean) +- `subdomain` (String) +- `termination_grace_period_seconds` (Number) +- `toleration` (List of Object) (see [below for nested schema](#nestedobjatt--spec--toleration)) +- `topology_spread_constraint` (List of Object) (see [below for nested schema](#nestedobjatt--spec--topology_spread_constraint)) +- `volume` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume)) + + +### Nested Schema for `spec.affinity` + +Read-Only: + +- `node_affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity)) +- `pod_affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.affinity.node_affinity` + +Read-Only: + +- `preferred_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Read-Only: + +- `preference` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Read-Only: + +- `node_selector_term` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_affinity` + +Read-Only: + +- `preferred_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Read-Only: + +- `pod_affinity_term` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity` + +Read-Only: + +- `preferred_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Read-Only: + +- `pod_affinity_term` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + + +### Nested Schema for `spec.container` + +Read-Only: + +- `args` (List of String) +- `command` (List of String) +- `env` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env)) +- `env_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env_from)) +- `image` (String) +- `image_pull_policy` (String) +- `lifecycle` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle)) +- `liveness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe)) +- `name` (String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--port)) +- `readiness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe)) +- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--resources)) +- `security_context` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context)) +- `startup_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe)) +- `stdin` (Boolean) +- `stdin_once` (Boolean) +- `termination_message_path` (String) +- `termination_message_policy` (String) +- `tty` (Boolean) +- `volume_mount` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--volume_mount)) +- `working_dir` (String) + + +### Nested Schema for `spec.container.env` + +Read-Only: + +- `name` (String) +- `value` (String) +- `value_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from)) + + +### Nested Schema for `spec.container.env.value_from` + +Read-Only: + +- `config_map_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.container.env.value_from.config_map_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.container.env.value_from.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.container.env.value_from.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + +### Nested Schema for `spec.container.env.value_from.secret_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + + + +### Nested Schema for `spec.container.env_from` + +Read-Only: + +- `config_map_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env_from--config_map_ref)) +- `prefix` (String) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.container.env_from.config_map_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.container.env_from.secret_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + + +### Nested Schema for `spec.container.lifecycle` + +Read-Only: + +- `post_start` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start)) +- `pre_stop` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.container.lifecycle.post_start` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.post_start.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.lifecycle.post_start.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.pre_stop.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.tcp_socket` + +Read-Only: + +- `port` (String) + + + + + +### Nested Schema for `spec.container.liveness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.container.liveness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.liveness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.container.liveness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.liveness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.liveness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.port` + +Read-Only: + +- `container_port` (Number) +- `host_ip` (String) +- `host_port` (Number) +- `name` (String) +- `protocol` (String) + + + +### Nested Schema for `spec.container.readiness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.container.readiness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.readiness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.container.readiness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.readiness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.readiness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + +### Nested Schema for `spec.container.security_context` + +Read-Only: + +- `allow_privilege_escalation` (Boolean) +- `capabilities` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context--capabilities)) +- `privileged` (Boolean) +- `read_only_root_filesystem` (Boolean) +- `run_as_group` (String) +- `run_as_non_root` (Boolean) +- `run_as_user` (String) +- `se_linux_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.container.security_context.capabilities` + +Read-Only: + +- `add` (List of String) +- `drop` (List of String) + + + +### Nested Schema for `spec.container.security_context.se_linux_options` + +Read-Only: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + +### Nested Schema for `spec.container.security_context.seccomp_profile` + +Read-Only: + +- `localhost_profile` (String) +- `type` (String) + + + + +### Nested Schema for `spec.container.startup_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.container.startup_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.startup_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.container.startup_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.startup_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.startup_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.volume_mount` + +Read-Only: + +- `mount_path` (String) +- `mount_propagation` (String) +- `name` (String) +- `read_only` (Boolean) +- `sub_path` (String) + + + + +### Nested Schema for `spec.dns_config` + +Read-Only: + +- `nameservers` (List of String) +- `option` (List of Object) (see [below for nested schema](#nestedobjatt--spec--dns_config--option)) +- `searches` (List of String) + + +### Nested Schema for `spec.dns_config.option` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.host_aliases` + +Read-Only: + +- `hostnames` (List of String) +- `ip` (String) + + + +### Nested Schema for `spec.image_pull_secrets` + +Read-Only: + +- `name` (String) + + + +### Nested Schema for `spec.init_container` + +Read-Only: + +- `args` (List of String) +- `command` (List of String) +- `env` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env)) +- `env_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env_from)) +- `image` (String) +- `image_pull_policy` (String) +- `lifecycle` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle)) +- `liveness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe)) +- `name` (String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--port)) +- `readiness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe)) +- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--resources)) +- `security_context` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context)) +- `startup_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe)) +- `stdin` (Boolean) +- `stdin_once` (Boolean) +- `termination_message_path` (String) +- `termination_message_policy` (String) +- `tty` (Boolean) +- `volume_mount` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--volume_mount)) +- `working_dir` (String) + + +### Nested Schema for `spec.init_container.env` + +Read-Only: + +- `name` (String) +- `value` (String) +- `value_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.init_container.env.value_from` + +Read-Only: + +- `config_map_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.init_container.env.value_from.config_map_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.init_container.env.value_from.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.init_container.env.value_from.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + +### Nested Schema for `spec.init_container.env.value_from.secret_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + + + +### Nested Schema for `spec.init_container.env_from` + +Read-Only: + +- `config_map_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.init_container.env_from.config_map_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.init_container.env_from.secret_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + + +### Nested Schema for `spec.init_container.lifecycle` + +Read-Only: + +- `post_start` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start)) +- `pre_stop` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.tcp_socket` + +Read-Only: + +- `port` (String) + + + + + +### Nested Schema for `spec.init_container.liveness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.init_container.liveness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.liveness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.init_container.liveness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.liveness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.liveness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.port` + +Read-Only: + +- `container_port` (Number) +- `host_ip` (String) +- `host_port` (Number) +- `name` (String) +- `protocol` (String) + + + +### Nested Schema for `spec.init_container.readiness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.init_container.readiness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.readiness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.init_container.readiness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.readiness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.readiness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + +### Nested Schema for `spec.init_container.security_context` + +Read-Only: + +- `allow_privilege_escalation` (Boolean) +- `capabilities` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) +- `read_only_root_filesystem` (Boolean) +- `run_as_group` (String) +- `run_as_non_root` (Boolean) +- `run_as_user` (String) +- `se_linux_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.init_container.security_context.capabilities` + +Read-Only: + +- `add` (List of String) +- `drop` (List of String) + + + +### Nested Schema for `spec.init_container.security_context.se_linux_options` + +Read-Only: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + +### Nested Schema for `spec.init_container.security_context.seccomp_profile` + +Read-Only: + +- `localhost_profile` (String) +- `type` (String) + + + + +### Nested Schema for `spec.init_container.startup_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.init_container.startup_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.startup_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.init_container.startup_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.startup_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.startup_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.volume_mount` + +Read-Only: + +- `mount_path` (String) +- `mount_propagation` (String) +- `name` (String) +- `read_only` (Boolean) +- `sub_path` (String) + + + + +### Nested Schema for `spec.os` + +Read-Only: + +- `name` (String) + + + +### Nested Schema for `spec.readiness_gate` + +Read-Only: + +- `condition_type` (String) + + + +### Nested Schema for `spec.security_context` + +Read-Only: + +- `fs_group` (String) +- `fs_group_change_policy` (String) +- `run_as_group` (String) +- `run_as_non_root` (Boolean) +- `run_as_user` (String) +- `se_linux_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--se_linux_options)) +- `seccomp_profile` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) +- `sysctl` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--sysctl)) +- `windows_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--windows_options)) + + +### Nested Schema for `spec.security_context.se_linux_options` + +Read-Only: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + +### Nested Schema for `spec.security_context.seccomp_profile` + +Read-Only: + +- `localhost_profile` (String) +- `type` (String) + + + +### Nested Schema for `spec.security_context.sysctl` + +Read-Only: + +- `name` (String) +- `value` (String) + + + +### Nested Schema for `spec.security_context.windows_options` + +Read-Only: + +- `gmsa_credential_spec` (String) +- `gmsa_credential_spec_name` (String) +- `host_process` (Boolean) +- `run_as_username` (String) + + + + +### Nested Schema for `spec.toleration` + +Read-Only: + +- `effect` (String) +- `key` (String) +- `operator` (String) +- `toleration_seconds` (String) +- `value` (String) + + + +### Nested Schema for `spec.topology_spread_constraint` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) +- `max_skew` (Number) +- `min_domains` (Number) +- `node_affinity_policy` (String) +- `node_taints_policy` (String) +- `topology_key` (String) +- `when_unsatisfiable` (String) + + +### Nested Schema for `spec.topology_spread_constraint.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.topology_spread_constraint.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + +### Nested Schema for `spec.volume` + +Read-Only: + +- `aws_elastic_block_store` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--aws_elastic_block_store)) +- `azure_disk` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--azure_disk)) +- `azure_file` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--azure_file)) +- `ceph_fs` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ceph_fs)) +- `cinder` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--cinder)) +- `config_map` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--config_map)) +- `csi` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--csi)) +- `downward_api` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api)) +- `empty_dir` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--empty_dir)) +- `ephemeral` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral)) +- `fc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--fc)) +- `flex_volume` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--flex_volume)) +- `flocker` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--flocker)) +- `gce_persistent_disk` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--gce_persistent_disk)) +- `git_repo` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--git_repo)) +- `glusterfs` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--glusterfs)) +- `host_path` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--host_path)) +- `iscsi` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--iscsi)) +- `local` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--local)) +- `name` (String) +- `nfs` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--nfs)) +- `persistent_volume_claim` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--photon_persistent_disk)) +- `projected` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected)) +- `quobyte` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--quobyte)) +- `rbd` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--rbd)) +- `secret` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--secret)) +- `vsphere_volume` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.volume.aws_elastic_block_store` + +Read-Only: + +- `fs_type` (String) +- `partition` (Number) +- `read_only` (Boolean) +- `volume_id` (String) + + + +### Nested Schema for `spec.volume.azure_disk` + +Read-Only: + +- `caching_mode` (String) +- `data_disk_uri` (String) +- `disk_name` (String) +- `fs_type` (String) +- `kind` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.azure_file` + +Read-Only: + +- `read_only` (Boolean) +- `secret_name` (String) +- `secret_namespace` (String) +- `share_name` (String) + + + +### Nested Schema for `spec.volume.ceph_fs` + +Read-Only: + +- `monitors` (Set of String) +- `path` (String) +- `read_only` (Boolean) +- `secret_file` (String) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ceph_fs--secret_ref)) +- `user` (String) + + +### Nested Schema for `spec.volume.ceph_fs.secret_ref` + +Read-Only: + +- `name` (String) +- `namespace` (String) + + + + +### Nested Schema for `spec.volume.cinder` + +Read-Only: + +- `fs_type` (String) +- `read_only` (Boolean) +- `volume_id` (String) + + + +### Nested Schema for `spec.volume.config_map` + +Read-Only: + +- `default_mode` (String) +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--config_map--items)) +- `name` (String) +- `optional` (Boolean) + + +### Nested Schema for `spec.volume.config_map.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.csi` + +Read-Only: + +- `driver` (String) +- `fs_type` (String) +- `node_publish_secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) +- `volume_attributes` (Map of String) + + +### Nested Schema for `spec.volume.csi.node_publish_secret_ref` + +Read-Only: + +- `name` (String) + + + + +### Nested Schema for `spec.volume.downward_api` + +Read-Only: + +- `default_mode` (String) +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.volume.downward_api.items` + +Read-Only: + +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api--items--field_ref)) +- `mode` (String) +- `path` (String) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.downward_api.items.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.volume.downward_api.items.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + +* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: +* `Localhost` - a profile defined in a file on the node should be used. +* `RuntimeDefault` - the container runtime default profile should be used. +* `Unconfined` - (Default) no profile should be applied. +* `localhost_profile` - 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`. + + + +### Nested Schema for `spec.volume.empty_dir` + +Read-Only: + +- `medium` (String) +- `size_limit` (String) + + + +### Nested Schema for `spec.volume.ephemeral` + +Read-Only: + +- `volume_claim_template` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template` + +Read-Only: + +- `metadata` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--metadata)) +- `spec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.metadata` + +Read-Only: + +- `annotations` (Map of String) +- `labels` (Map of String) + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec` + +Read-Only: + +- `access_modes` (Set of String) +- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec--resources)) +- `selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) +- `volume_mode` (String) +- `volume_name` (String) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + + +### Nested Schema for `spec.volume.fc` + +Read-Only: + +- `fs_type` (String) +- `lun` (Number) +- `read_only` (Boolean) +- `target_ww_ns` (Set of String) + + + +### Nested Schema for `spec.volume.flex_volume` + +Read-Only: + +- `driver` (String) +- `fs_type` (String) +- `options` (Map of String) +- `read_only` (Boolean) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.volume.flex_volume.secret_ref` + +Read-Only: + +- `name` (String) +- `namespace` (String) + + + + +### Nested Schema for `spec.volume.flocker` + +Read-Only: + +- `dataset_name` (String) +- `dataset_uuid` (String) + + + +### Nested Schema for `spec.volume.gce_persistent_disk` + +Read-Only: + +- `fs_type` (String) +- `partition` (Number) +- `pd_name` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.git_repo` + +Read-Only: + +- `directory` (String) +- `repository` (String) +- `revision` (String) + + + +### Nested Schema for `spec.volume.glusterfs` + +Read-Only: + +- `endpoints_name` (String) +- `path` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.host_path` + +Read-Only: + +- `path` (String) +- `type` (String) + + + +### Nested Schema for `spec.volume.iscsi` + +Read-Only: + +- `fs_type` (String) +- `iqn` (String) +- `iscsi_interface` (String) +- `lun` (Number) +- `read_only` (Boolean) +- `target_portal` (String) + + + +### Nested Schema for `spec.volume.local` + +Read-Only: + +- `path` (String) + + + +### Nested Schema for `spec.volume.nfs` + +Read-Only: + +- `path` (String) +- `read_only` (Boolean) +- `server` (String) + + + +### Nested Schema for `spec.volume.persistent_volume_claim` + +Read-Only: + +- `claim_name` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.photon_persistent_disk` + +Read-Only: + +- `fs_type` (String) +- `pd_id` (String) + + + +### Nested Schema for `spec.volume.projected` + +Read-Only: + +- `default_mode` (String) +- `sources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources)) + + +### Nested Schema for `spec.volume.projected.sources` + +Read-Only: + +- `config_map` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--config_map)) +- `downward_api` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api)) +- `secret` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--secret)) +- `service_account_token` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.volume.projected.sources.config_map` + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--config_map--items)) +- `name` (String) +- `optional` (Boolean) + + +### Nested Schema for `spec.volume.projected.sources.config_map.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.projected.sources.downward_api` + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items` + +Read-Only: + +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) +- `path` (String) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + + + +### Nested Schema for `spec.volume.projected.sources.secret` + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--secret--items)) +- `name` (String) +- `optional` (Boolean) + + +### Nested Schema for `spec.volume.projected.sources.secret.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.projected.sources.service_account_token` + +Read-Only: + +- `audience` (String) +- `expiration_seconds` (Number) +- `path` (String) + + + + + +### Nested Schema for `spec.volume.quobyte` + +Read-Only: + +- `group` (String) +- `read_only` (Boolean) +- `registry` (String) +- `user` (String) +- `volume` (String) + + + +### Nested Schema for `spec.volume.rbd` + +Read-Only: + +- `ceph_monitors` (Set of String) +- `fs_type` (String) +- `keyring` (String) +- `rados_user` (String) +- `rbd_image` (String) +- `rbd_pool` (String) +- `read_only` (Boolean) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.volume.rbd.secret_ref` + +Read-Only: + +- `name` (String) +- `namespace` (String) + + + + +### Nested Schema for `spec.volume.secret` + +Read-Only: + +- `default_mode` (String) +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--secret--items)) +- `optional` (Boolean) +- `secret_name` (String) + + +### Nested Schema for `spec.volume.secret.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.vsphere_volume` + +Read-Only: + +- `fs_type` (String) +- `volume_path` (String) + + + + + + +## Example Usage + +``` +data "kubernetes_pod" "test" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod.example default/terraform-example +``` diff --git a/docs/data-sources/pod_v1.md b/docs/data-sources/pod_v1.md new file mode 100644 index 0000000000..93199eb308 --- /dev/null +++ b/docs/data-sources/pod_v1.md @@ -0,0 +1,2033 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod_v1" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# kubernetes_pod_v1 + +A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context.Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) Specification of the desired behavior of the pod. (see [below for nested schema](#nestedatt--spec)) +- `status` (String) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `active_deadline_seconds` (Number) +- `affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity)) +- `automount_service_account_token` (Boolean) +- `container` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container)) +- `dns_config` (List of Object) (see [below for nested schema](#nestedobjatt--spec--dns_config)) +- `dns_policy` (String) +- `enable_service_links` (Boolean) +- `host_aliases` (List of Object) (see [below for nested schema](#nestedobjatt--spec--host_aliases)) +- `host_ipc` (Boolean) +- `host_network` (Boolean) +- `host_pid` (Boolean) +- `hostname` (String) +- `image_pull_secrets` (List of Object) (see [below for nested schema](#nestedobjatt--spec--image_pull_secrets)) +- `init_container` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container)) +- `node_name` (String) +- `node_selector` (Map of String) +- `os` (List of Object) (see [below for nested schema](#nestedobjatt--spec--os)) +- `priority_class_name` (String) +- `readiness_gate` (List of Object) (see [below for nested schema](#nestedobjatt--spec--readiness_gate)) +- `restart_policy` (String) +- `runtime_class_name` (String) +- `scheduler_name` (String) +- `security_context` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context)) +- `service_account_name` (String) +- `share_process_namespace` (Boolean) +- `subdomain` (String) +- `termination_grace_period_seconds` (Number) +- `toleration` (List of Object) (see [below for nested schema](#nestedobjatt--spec--toleration)) +- `topology_spread_constraint` (List of Object) (see [below for nested schema](#nestedobjatt--spec--topology_spread_constraint)) +- `volume` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume)) + + +### Nested Schema for `spec.affinity` + +Read-Only: + +- `node_affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity)) +- `pod_affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.affinity.node_affinity` + +Read-Only: + +- `preferred_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Read-Only: + +- `preference` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Read-Only: + +- `node_selector_term` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_affinity` + +Read-Only: + +- `preferred_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Read-Only: + +- `pod_affinity_term` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity` + +Read-Only: + +- `preferred_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Read-Only: + +- `pod_affinity_term` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) +- `topology_key` (String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + + +### Nested Schema for `spec.container` + +Read-Only: + +- `args` (List of String) +- `command` (List of String) +- `env` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env)) +- `env_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env_from)) +- `image` (String) +- `image_pull_policy` (String) +- `lifecycle` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle)) +- `liveness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe)) +- `name` (String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--port)) +- `readiness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe)) +- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--resources)) +- `security_context` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context)) +- `startup_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe)) +- `stdin` (Boolean) +- `stdin_once` (Boolean) +- `termination_message_path` (String) +- `termination_message_policy` (String) +- `tty` (Boolean) +- `volume_mount` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--volume_mount)) +- `working_dir` (String) + + +### Nested Schema for `spec.container.env` + +Read-Only: + +- `name` (String) +- `value` (String) +- `value_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from)) + + +### Nested Schema for `spec.container.env.value_from` + +Read-Only: + +- `config_map_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.container.env.value_from.config_map_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.container.env.value_from.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.container.env.value_from.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + +### Nested Schema for `spec.container.env.value_from.secret_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + + + +### Nested Schema for `spec.container.env_from` + +Read-Only: + +- `config_map_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env_from--config_map_ref)) +- `prefix` (String) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.container.env_from.config_map_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.container.env_from.secret_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + + +### Nested Schema for `spec.container.lifecycle` + +Read-Only: + +- `post_start` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start)) +- `pre_stop` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.container.lifecycle.post_start` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.post_start.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.lifecycle.post_start.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.pre_stop.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.tcp_socket` + +Read-Only: + +- `port` (String) + + + + + +### Nested Schema for `spec.container.liveness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.container.liveness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.liveness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.container.liveness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.liveness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.liveness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.port` + +Read-Only: + +- `container_port` (Number) +- `host_ip` (String) +- `host_port` (Number) +- `name` (String) +- `protocol` (String) + + + +### Nested Schema for `spec.container.readiness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.container.readiness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.readiness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.container.readiness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.readiness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.readiness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + +### Nested Schema for `spec.container.security_context` + +Read-Only: + +- `allow_privilege_escalation` (Boolean) +- `capabilities` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context--capabilities)) +- `privileged` (Boolean) +- `read_only_root_filesystem` (Boolean) +- `run_as_group` (String) +- `run_as_non_root` (Boolean) +- `run_as_user` (String) +- `se_linux_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.container.security_context.capabilities` + +Read-Only: + +- `add` (List of String) +- `drop` (List of String) + + + +### Nested Schema for `spec.container.security_context.se_linux_options` + +Read-Only: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + +### Nested Schema for `spec.container.security_context.seccomp_profile` + +Read-Only: + +- `localhost_profile` (String) +- `type` (String) + + + + +### Nested Schema for `spec.container.startup_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.container.startup_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.container.startup_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.container.startup_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--container--startup_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.container.startup_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.container.startup_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.container.volume_mount` + +Read-Only: + +- `mount_path` (String) +- `mount_propagation` (String) +- `name` (String) +- `read_only` (Boolean) +- `sub_path` (String) + + + + +### Nested Schema for `spec.dns_config` + +Read-Only: + +- `nameservers` (List of String) +- `option` (List of Object) (see [below for nested schema](#nestedobjatt--spec--dns_config--option)) +- `searches` (List of String) + + +### Nested Schema for `spec.dns_config.option` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.host_aliases` + +Read-Only: + +- `hostnames` (List of String) +- `ip` (String) + + + +### Nested Schema for `spec.image_pull_secrets` + +Read-Only: + +- `name` (String) + + + +### Nested Schema for `spec.init_container` + +Read-Only: + +- `args` (List of String) +- `command` (List of String) +- `env` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env)) +- `env_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env_from)) +- `image` (String) +- `image_pull_policy` (String) +- `lifecycle` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle)) +- `liveness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe)) +- `name` (String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--port)) +- `readiness_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe)) +- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--resources)) +- `security_context` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context)) +- `startup_probe` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe)) +- `stdin` (Boolean) +- `stdin_once` (Boolean) +- `termination_message_path` (String) +- `termination_message_policy` (String) +- `tty` (Boolean) +- `volume_mount` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--volume_mount)) +- `working_dir` (String) + + +### Nested Schema for `spec.init_container.env` + +Read-Only: + +- `name` (String) +- `value` (String) +- `value_from` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.init_container.env.value_from` + +Read-Only: + +- `config_map_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.init_container.env.value_from.config_map_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.init_container.env.value_from.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.init_container.env.value_from.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + +### Nested Schema for `spec.init_container.env.value_from.secret_key_ref` + +Read-Only: + +- `key` (String) +- `name` (String) +- `optional` (Boolean) + + + + + +### Nested Schema for `spec.init_container.env_from` + +Read-Only: + +- `config_map_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.init_container.env_from.config_map_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + +### Nested Schema for `spec.init_container.env_from.secret_ref` + +Read-Only: + +- `name` (String) +- `optional` (Boolean) + + + + +### Nested Schema for `spec.init_container.lifecycle` + +Read-Only: + +- `post_start` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start)) +- `pre_stop` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.tcp_socket` + +Read-Only: + +- `port` (String) + + + + + +### Nested Schema for `spec.init_container.liveness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.init_container.liveness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.liveness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.init_container.liveness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.liveness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.liveness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.port` + +Read-Only: + +- `container_port` (Number) +- `host_ip` (String) +- `host_port` (Number) +- `name` (String) +- `protocol` (String) + + + +### Nested Schema for `spec.init_container.readiness_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.init_container.readiness_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.readiness_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.init_container.readiness_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.readiness_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.readiness_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + +### Nested Schema for `spec.init_container.security_context` + +Read-Only: + +- `allow_privilege_escalation` (Boolean) +- `capabilities` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) +- `read_only_root_filesystem` (Boolean) +- `run_as_group` (String) +- `run_as_non_root` (Boolean) +- `run_as_user` (String) +- `se_linux_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.init_container.security_context.capabilities` + +Read-Only: + +- `add` (List of String) +- `drop` (List of String) + + + +### Nested Schema for `spec.init_container.security_context.se_linux_options` + +Read-Only: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + +### Nested Schema for `spec.init_container.security_context.seccomp_profile` + +Read-Only: + +- `localhost_profile` (String) +- `type` (String) + + + + +### Nested Schema for `spec.init_container.startup_probe` + +Read-Only: + +- `exec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) +- `grpc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--grpc)) +- `http_get` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) +- `period_seconds` (Number) +- `success_threshold` (Number) +- `tcp_socket` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) + + +### Nested Schema for `spec.init_container.startup_probe.exec` + +Read-Only: + +- `command` (List of String) + + + +### Nested Schema for `spec.init_container.startup_probe.grpc` + +Read-Only: + +- `port` (Number) +- `service` (String) + + + +### Nested Schema for `spec.init_container.startup_probe.http_get` + +Read-Only: + +- `host` (String) +- `http_header` (List of Object) (see [below for nested schema](#nestedobjatt--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) +- `port` (String) +- `scheme` (String) + + +### Nested Schema for `spec.init_container.startup_probe.http_get.http_header` + +Read-Only: + +- `name` (String) +- `value` (String) + + + + +### Nested Schema for `spec.init_container.startup_probe.tcp_socket` + +Read-Only: + +- `port` (String) + + + + +### Nested Schema for `spec.init_container.volume_mount` + +Read-Only: + +- `mount_path` (String) +- `mount_propagation` (String) +- `name` (String) +- `read_only` (Boolean) +- `sub_path` (String) + + + + +### Nested Schema for `spec.os` + +Read-Only: + +- `name` (String) + + + +### Nested Schema for `spec.readiness_gate` + +Read-Only: + +- `condition_type` (String) + + + +### Nested Schema for `spec.security_context` + +Read-Only: + +- `fs_group` (String) +- `fs_group_change_policy` (String) +- `run_as_group` (String) +- `run_as_non_root` (Boolean) +- `run_as_user` (String) +- `se_linux_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--se_linux_options)) +- `seccomp_profile` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) +- `sysctl` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--sysctl)) +- `windows_options` (List of Object) (see [below for nested schema](#nestedobjatt--spec--security_context--windows_options)) + + +### Nested Schema for `spec.security_context.se_linux_options` + +Read-Only: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + +### Nested Schema for `spec.security_context.seccomp_profile` + +Read-Only: + +- `localhost_profile` (String) +- `type` (String) + + + +### Nested Schema for `spec.security_context.sysctl` + +Read-Only: + +- `name` (String) +- `value` (String) + + + +### Nested Schema for `spec.security_context.windows_options` + +Read-Only: + +- `gmsa_credential_spec` (String) +- `gmsa_credential_spec_name` (String) +- `host_process` (Boolean) +- `run_as_username` (String) + + + + +### Nested Schema for `spec.toleration` + +Read-Only: + +- `effect` (String) +- `key` (String) +- `operator` (String) +- `toleration_seconds` (String) +- `value` (String) + + + +### Nested Schema for `spec.topology_spread_constraint` + +Read-Only: + +- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) +- `max_skew` (Number) +- `min_domains` (Number) +- `node_affinity_policy` (String) +- `node_taints_policy` (String) +- `topology_key` (String) +- `when_unsatisfiable` (String) + + +### Nested Schema for `spec.topology_spread_constraint.label_selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.topology_spread_constraint.label_selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + +### Nested Schema for `spec.volume` + +Read-Only: + +- `aws_elastic_block_store` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--aws_elastic_block_store)) +- `azure_disk` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--azure_disk)) +- `azure_file` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--azure_file)) +- `ceph_fs` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ceph_fs)) +- `cinder` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--cinder)) +- `config_map` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--config_map)) +- `csi` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--csi)) +- `downward_api` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api)) +- `empty_dir` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--empty_dir)) +- `ephemeral` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral)) +- `fc` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--fc)) +- `flex_volume` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--flex_volume)) +- `flocker` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--flocker)) +- `gce_persistent_disk` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--gce_persistent_disk)) +- `git_repo` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--git_repo)) +- `glusterfs` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--glusterfs)) +- `host_path` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--host_path)) +- `iscsi` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--iscsi)) +- `local` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--local)) +- `name` (String) +- `nfs` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--nfs)) +- `persistent_volume_claim` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--photon_persistent_disk)) +- `projected` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected)) +- `quobyte` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--quobyte)) +- `rbd` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--rbd)) +- `secret` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--secret)) +- `vsphere_volume` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.volume.aws_elastic_block_store` + +Read-Only: + +- `fs_type` (String) +- `partition` (Number) +- `read_only` (Boolean) +- `volume_id` (String) + + + +### Nested Schema for `spec.volume.azure_disk` + +Read-Only: + +- `caching_mode` (String) +- `data_disk_uri` (String) +- `disk_name` (String) +- `fs_type` (String) +- `kind` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.azure_file` + +Read-Only: + +- `read_only` (Boolean) +- `secret_name` (String) +- `secret_namespace` (String) +- `share_name` (String) + + + +### Nested Schema for `spec.volume.ceph_fs` + +Read-Only: + +- `monitors` (Set of String) +- `path` (String) +- `read_only` (Boolean) +- `secret_file` (String) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ceph_fs--secret_ref)) +- `user` (String) + + +### Nested Schema for `spec.volume.ceph_fs.secret_ref` + +Read-Only: + +- `name` (String) +- `namespace` (String) + + + + +### Nested Schema for `spec.volume.cinder` + +Read-Only: + +- `fs_type` (String) +- `read_only` (Boolean) +- `volume_id` (String) + + + +### Nested Schema for `spec.volume.config_map` + +Read-Only: + +- `default_mode` (String) +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--config_map--items)) +- `name` (String) +- `optional` (Boolean) + + +### Nested Schema for `spec.volume.config_map.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.csi` + +Read-Only: + +- `driver` (String) +- `fs_type` (String) +- `node_publish_secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) +- `volume_attributes` (Map of String) + + +### Nested Schema for `spec.volume.csi.node_publish_secret_ref` + +Read-Only: + +- `name` (String) + + + + +### Nested Schema for `spec.volume.downward_api` + +Read-Only: + +- `default_mode` (String) +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.volume.downward_api.items` + +Read-Only: + +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api--items--field_ref)) +- `mode` (String) +- `path` (String) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.downward_api.items.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.volume.downward_api.items.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + +* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: +* `Localhost` - a profile defined in a file on the node should be used. +* `RuntimeDefault` - the container runtime default profile should be used. +* `Unconfined` - (Default) no profile should be applied. +* `localhost_profile` - 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`. + + + +### Nested Schema for `spec.volume.empty_dir` + +Read-Only: + +- `medium` (String) +- `size_limit` (String) + + + +### Nested Schema for `spec.volume.ephemeral` + +Read-Only: + +- `volume_claim_template` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template` + +Read-Only: + +- `metadata` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--metadata)) +- `spec` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.metadata` + +Read-Only: + +- `annotations` (Map of String) +- `labels` (Map of String) + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec` + +Read-Only: + +- `access_modes` (Set of String) +- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec--resources)) +- `selector` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) +- `volume_mode` (String) +- `volume_name` (String) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.resources` + +Read-Only: + +- `limits` (Map of String) +- `requests` (Map of String) + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector` + +Read-Only: + +- `match_expressions` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Read-Only: + +- `key` (String) +- `operator` (String) +- `values` (Set of String) + + + + + + + +### Nested Schema for `spec.volume.fc` + +Read-Only: + +- `fs_type` (String) +- `lun` (Number) +- `read_only` (Boolean) +- `target_ww_ns` (Set of String) + + + +### Nested Schema for `spec.volume.flex_volume` + +Read-Only: + +- `driver` (String) +- `fs_type` (String) +- `options` (Map of String) +- `read_only` (Boolean) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.volume.flex_volume.secret_ref` + +Read-Only: + +- `name` (String) +- `namespace` (String) + + + + +### Nested Schema for `spec.volume.flocker` + +Read-Only: + +- `dataset_name` (String) +- `dataset_uuid` (String) + + + +### Nested Schema for `spec.volume.gce_persistent_disk` + +Read-Only: + +- `fs_type` (String) +- `partition` (Number) +- `pd_name` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.git_repo` + +Read-Only: + +- `directory` (String) +- `repository` (String) +- `revision` (String) + + + +### Nested Schema for `spec.volume.glusterfs` + +Read-Only: + +- `endpoints_name` (String) +- `path` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.host_path` + +Read-Only: + +- `path` (String) +- `type` (String) + + + +### Nested Schema for `spec.volume.iscsi` + +Read-Only: + +- `fs_type` (String) +- `iqn` (String) +- `iscsi_interface` (String) +- `lun` (Number) +- `read_only` (Boolean) +- `target_portal` (String) + + + +### Nested Schema for `spec.volume.local` + +Read-Only: + +- `path` (String) + + + +### Nested Schema for `spec.volume.nfs` + +Read-Only: + +- `path` (String) +- `read_only` (Boolean) +- `server` (String) + + + +### Nested Schema for `spec.volume.persistent_volume_claim` + +Read-Only: + +- `claim_name` (String) +- `read_only` (Boolean) + + + +### Nested Schema for `spec.volume.photon_persistent_disk` + +Read-Only: + +- `fs_type` (String) +- `pd_id` (String) + + + +### Nested Schema for `spec.volume.projected` + +Read-Only: + +- `default_mode` (String) +- `sources` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources)) + + +### Nested Schema for `spec.volume.projected.sources` + +Read-Only: + +- `config_map` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--config_map)) +- `downward_api` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api)) +- `secret` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--secret)) +- `service_account_token` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.volume.projected.sources.config_map` + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--config_map--items)) +- `name` (String) +- `optional` (Boolean) + + +### Nested Schema for `spec.volume.projected.sources.config_map.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.projected.sources.downward_api` + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items` + +Read-Only: + +- `field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) +- `path` (String) +- `resource_field_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.field_ref` + +Read-Only: + +- `api_version` (String) +- `field_path` (String) + + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Read-Only: + +- `container_name` (String) +- `divisor` (String) +- `resource` (String) + + + + + +### Nested Schema for `spec.volume.projected.sources.secret` + +Read-Only: + +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--projected--sources--secret--items)) +- `name` (String) +- `optional` (Boolean) + + +### Nested Schema for `spec.volume.projected.sources.secret.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.projected.sources.service_account_token` + +Read-Only: + +- `audience` (String) +- `expiration_seconds` (Number) +- `path` (String) + + + + + +### Nested Schema for `spec.volume.quobyte` + +Read-Only: + +- `group` (String) +- `read_only` (Boolean) +- `registry` (String) +- `user` (String) +- `volume` (String) + + + +### Nested Schema for `spec.volume.rbd` + +Read-Only: + +- `ceph_monitors` (Set of String) +- `fs_type` (String) +- `keyring` (String) +- `rados_user` (String) +- `rbd_image` (String) +- `rbd_pool` (String) +- `read_only` (Boolean) +- `secret_ref` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.volume.rbd.secret_ref` + +Read-Only: + +- `name` (String) +- `namespace` (String) + + + + +### Nested Schema for `spec.volume.secret` + +Read-Only: + +- `default_mode` (String) +- `items` (List of Object) (see [below for nested schema](#nestedobjatt--spec--volume--secret--items)) +- `optional` (Boolean) +- `secret_name` (String) + + +### Nested Schema for `spec.volume.secret.items` + +Read-Only: + +- `key` (String) +- `mode` (String) +- `path` (String) + + + + +### Nested Schema for `spec.volume.vsphere_volume` + +Read-Only: + +- `fs_type` (String) +- `volume_path` (String) + + + + + + +## Example Usage + +``` +data "kubernetes_pod_v1" "test" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod_v1.example default/terraform-example +``` diff --git a/docs/data-sources/resource.md b/docs/data-sources/resource.md new file mode 100644 index 0000000000..70b303dead --- /dev/null +++ b/docs/data-sources/resource.md @@ -0,0 +1,56 @@ +--- +subcategory: "manifest" +page_title: "Kubernetes: kubernetes_resource" +description: |- + This is a generic data source for Kubernetes API resources +--- + +# kubernetes_resource + +This data source is a generic way to retrieve resources from the Kubernetes API. + + +## Schema + +### Required + +- `api_version` (String) The resource apiVersion. +- `kind` (String) The resource kind. +- `metadata` (Block List, Min: 1, Max: 1) Metadata for the resource (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `object` (Dynamic) The response from the API server. + + +### Nested Schema for `metadata` + +Required: + +- `name` (String) The resource name. + +Optional: + +- `namespace` (String) The resource namespace. + + + + +### Example: Get data from a ConfigMap + +```terraform +data "kubernetes_resource" "example" { + api_version = "v1" + kind = "ConfigMap" + + metadata { + name = "example" + namespace = "default" + } +} + +output "test" { + value = data.kubernetes_resource.example.object.data.TEST +} +``` + diff --git a/website/docs/d/resources.html.markdown b/docs/data-sources/resources.md similarity index 63% rename from website/docs/d/resources.html.markdown rename to docs/data-sources/resources.md index 525f33529c..618749503e 100644 --- a/website/docs/d/resources.html.markdown +++ b/docs/data-sources/resources.md @@ -1,6 +1,5 @@ --- subcategory: "manifest" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_resources" description: |- This data source is a generic way to query for a list of resources from the Kubernetes API and filter them. @@ -10,9 +9,27 @@ description: |- This data source is a generic way to query for a list of Kubernetes resources and filter them using a label or field selector. + +## Schema + +### Required + +- `api_version` (String) The resource apiVersion. +- `kind` (String) The resource kind. + +### Optional + +- `field_selector` (String) A selector to restrict the list of returned objects by their fields. +- `label_selector` (String) A selector to restrict the list of returned objects by their labels. +- `limit` (Number) Limit is a maximum number of responses to return for a list call. +- `namespace` (String) The resource namespace. +- `objects` (Dynamic) The response from the API server. + + + ### Example: Get a list of namespaces excluding "kube-system" using `field_selector` -```hcl +```terraform data "kubernetes_resources" "example" { api_version = "v1" kind = "Namespace" @@ -26,7 +43,7 @@ output "test" { ### Example: Get a list of namespaces excluding "kube-system" using `label_selector` -```hcl +```terraform data "kubernetes_resources" "example" { api_version = "v1" kind = "Namespace" @@ -38,14 +55,3 @@ output "test" { } ``` -## Argument Reference - -The following arguments are supported: - -* `api_version` - (Required) The API version for the requested resource. -* `kind` - (Required) The kind for the requested resource. -* `label_selector` - (Optional) A selector to restrict the list of returned objects by their labels. -* `field_selector` - (Optional) A selector to restrict the list of returned objects by their fields. -* `namespace` - (Optional) The namespace of the requested resource. -* `object` - (Optional) The response returned from the API server. - diff --git a/docs/data-sources/secret.md b/docs/data-sources/secret.md new file mode 100644 index 0000000000..277f5387ad --- /dev/null +++ b/docs/data-sources/secret.md @@ -0,0 +1,106 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_secret" +description: |- + The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. +--- + +# kubernetes_secret + +The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard secret's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `binary_data` (Map of String, Sensitive) A map of the secret data with values encoded in base64 format + +### Read-Only + +- `data` (Map of String, Sensitive) A map of the secret data. +- `id` (String) The ID of this resource. +- `immutable` (Boolean) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). +- `type` (String) Type of secret + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the secret that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the secret. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the secret, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the secret must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this secret. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) + +~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +## Example Usage + +```terraform +data "kubernetes_secret" "example" { + metadata { + name = "basic-auth" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `metadata` - (Required) Standard secret's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) + +## Nested Blocks + +### `metadata` + +#### Arguments + +* `name` - (Required) Name of the secret, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) +* `namespace` - (Optional) Namespace defines the space within which name of the secret must be unique. + +#### Attributes + +* `generation` - A sequence number representing a specific generation of the desired state. +* `resource_version` - An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) +* `uid` - The unique in time and space value for this secret. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) + +## Attribute Reference + +* `data` - A map of the secret data. +* `binary_data` - A map of the secret data with values encoded in base64 format. + +~> In case the secret has been created outside terraform in order to retrieve binary data from the secret in base64 format you need to define a `binary_data` map with data to retrieve as key and an empty string as a value + +```terraform +data "kubernetes_secret" "example" { + metadata { + name = "example-secret" + namespace = "kube-system" + } + binary_data = { + "keystore.p12" = "" + another_field = "" + } +} +``` + +* `type` - The secret type. Defaults to `Opaque`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/c7151dd8dd7e487e96e5ce34c6a416bb3b037609/contributors/design-proposals/auth/secrets.md#proposed-design) +* `immutable` - Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). diff --git a/docs/data-sources/secret_v1.md b/docs/data-sources/secret_v1.md new file mode 100644 index 0000000000..d28b3c9034 --- /dev/null +++ b/docs/data-sources/secret_v1.md @@ -0,0 +1,106 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_secret_v1" +description: |- + The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. +--- + +# kubernetes_secret_v1 + +The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard secret's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `binary_data` (Map of String, Sensitive) A map of the secret data with values encoded in base64 format + +### Read-Only + +- `data` (Map of String, Sensitive) A map of the secret data. +- `id` (String) The ID of this resource. +- `immutable` (Boolean) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). +- `type` (String) Type of secret + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the secret that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the secret. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the secret, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the secret must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this secret. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) + +~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +## Example Usage + +```terraform +data "kubernetes_secret_v1" "example" { + metadata { + name = "basic-auth" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `metadata` - (Required) Standard secret's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) + +## Nested Blocks + +### `metadata` + +#### Arguments + +* `name` - (Required) Name of the secret, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) +* `namespace` - (Optional) Namespace defines the space within which name of the secret must be unique. + +#### Attributes + +* `generation` - A sequence number representing a specific generation of the desired state. +* `resource_version` - An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) +* `uid` - The unique in time and space value for this secret. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) + +## Attribute Reference + +* `data` - A map of the secret data. +* `binary_data` - A map of the secret data with values encoded in base64 format. + +~> In case the secret has been created outside terraform in order to retrieve binary data from the secret in base64 format you need to define a `binary_data` map with data to retrieve as key and an empty string as a value + +```terraform +data "kubernetes_secret_v1" "example" { + metadata { + name = "example-secret" + namespace = "kube-system" + } + binary_data = { + "keystore.p12" = "" + another_field = "" + } +} +``` + +* `type` - The secret type. Defaults to `Opaque`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/c7151dd8dd7e487e96e5ce34c6a416bb3b037609/contributors/design-proposals/auth/secrets.md#proposed-design) +* `immutable` - Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). diff --git a/docs/data-sources/service.md b/docs/data-sources/service.md new file mode 100644 index 0000000000..97e0508286 --- /dev/null +++ b/docs/data-sources/service.md @@ -0,0 +1,141 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# kubernetes_service + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) Spec defines the behavior of a service. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedatt--spec)) +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `allocate_load_balancer_node_ports` (Boolean) +- `cluster_ip` (String) +- `cluster_ips` (List of String) +- `external_ips` (Set of String) +- `external_name` (String) +- `external_traffic_policy` (String) +- `health_check_node_port` (Number) +- `internal_traffic_policy` (String) +- `ip_families` (List of String) +- `ip_family_policy` (String) +- `load_balancer_class` (String) +- `load_balancer_ip` (String) +- `load_balancer_source_ranges` (Set of String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--port)) +- `publish_not_ready_addresses` (Boolean) +- `selector` (Map of String) +- `session_affinity` (String) +- `session_affinity_config` (List of Object) (see [below for nested schema](#nestedobjatt--spec--session_affinity_config)) +- `type` (String) + + +### Nested Schema for `spec.port` + +Read-Only: + +- `app_protocol` (String) +- `name` (String) +- `node_port` (Number) +- `port` (Number) +- `protocol` (String) +- `target_port` (String) + + + +### Nested Schema for `spec.session_affinity_config` + +Read-Only: + +- `client_ip` (List of Object) (see [below for nested schema](#nestedobjatt--spec--session_affinity_config--client_ip)) + + +### Nested Schema for `spec.session_affinity_config.client_ip` + +Read-Only: + +- `timeout_seconds` (Number) + + + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +data "kubernetes_service" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = "data.aws_route53_zone.k8.zone_id" + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname] +} +``` + diff --git a/docs/data-sources/service_account.md b/docs/data-sources/service_account.md new file mode 100644 index 0000000000..8424fa152a --- /dev/null +++ b/docs/data-sources/service_account.md @@ -0,0 +1,76 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# kubernetes_service_account + +A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service account's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `automount_service_account_token` (Boolean) True to enable automatic mounting of the service account token +- `default_secret_name` (String, Deprecated) +- `id` (String) The ID of this resource. +- `image_pull_secret` (List of Object) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod (see [below for nested schema](#nestedatt--image_pull_secret)) +- `secret` (List of Object) A list of secrets allowed to be used by pods running using this Service Account. More info: https://kubernetes.io/docs/concepts/configuration/secret (see [below for nested schema](#nestedatt--secret)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service account, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service account must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service account. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `image_pull_secret` + +Read-Only: + +- `name` (String) + + + +### Nested Schema for `secret` + +Read-Only: + +- `name` (String) + + + + +## Example Usage + +```terraform +data "kubernetes_service_account" "example" { + metadata { + name = "terraform-example" + } +} + +data "kubernetes_secret" "example" { + metadata { + name = "${data.kubernetes_service_account.example.default_secret_name}" + } +} +``` diff --git a/docs/data-sources/service_account_v1.md b/docs/data-sources/service_account_v1.md new file mode 100644 index 0000000000..22bc1c4bbb --- /dev/null +++ b/docs/data-sources/service_account_v1.md @@ -0,0 +1,77 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account_v1" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# kubernetes_service_account_v1 + +A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service account's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `automount_service_account_token` (Boolean) True to enable automatic mounting of the service account token +- `default_secret_name` (String, Deprecated) +- `id` (String) The ID of this resource. +- `image_pull_secret` (List of Object) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod (see [below for nested schema](#nestedatt--image_pull_secret)) +- `secret` (List of Object) A list of secrets allowed to be used by pods running using this Service Account. More info: https://kubernetes.io/docs/concepts/configuration/secret (see [below for nested schema](#nestedatt--secret)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service account, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service account must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service account. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `image_pull_secret` + +Read-Only: + +- `name` (String) + + + +### Nested Schema for `secret` + +Read-Only: + +- `name` (String) + + + + +## Example Usage + +```terraform +data "kubernetes_service_account_v1" "example" { + metadata { + name = "terraform-example" + } +} + +data "kubernetes_secret" "example" { + metadata { + name = "${data.kubernetes_service_account_v1.example.default_secret_name}" + } +} +``` + diff --git a/docs/data-sources/service_v1.md b/docs/data-sources/service_v1.md new file mode 100644 index 0000000000..6d56bc0c77 --- /dev/null +++ b/docs/data-sources/service_v1.md @@ -0,0 +1,142 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_v1" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# kubernetes_service_v1 + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `spec` (List of Object) Spec defines the behavior of a service. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedatt--spec)) +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Read-Only: + +- `allocate_load_balancer_node_ports` (Boolean) +- `cluster_ip` (String) +- `cluster_ips` (List of String) +- `external_ips` (Set of String) +- `external_name` (String) +- `external_traffic_policy` (String) +- `health_check_node_port` (Number) +- `internal_traffic_policy` (String) +- `ip_families` (List of String) +- `ip_family_policy` (String) +- `load_balancer_class` (String) +- `load_balancer_ip` (String) +- `load_balancer_source_ranges` (Set of String) +- `port` (List of Object) (see [below for nested schema](#nestedobjatt--spec--port)) +- `publish_not_ready_addresses` (Boolean) +- `selector` (Map of String) +- `session_affinity` (String) +- `session_affinity_config` (List of Object) (see [below for nested schema](#nestedobjatt--spec--session_affinity_config)) +- `type` (String) + + +### Nested Schema for `spec.port` + +Read-Only: + +- `app_protocol` (String) +- `name` (String) +- `node_port` (Number) +- `port` (Number) +- `protocol` (String) +- `target_port` (String) + + + +### Nested Schema for `spec.session_affinity_config` + +Read-Only: + +- `client_ip` (List of Object) (see [below for nested schema](#nestedobjatt--spec--session_affinity_config--client_ip)) + + +### Nested Schema for `spec.session_affinity_config.client_ip` + +Read-Only: + +- `timeout_seconds` (Number) + + + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service. + +## Example Usage + +```terraform +data "kubernetes_service_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = "data.aws_route53_zone.k8.zone_id" + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname] +} +``` diff --git a/docs/data-sources/storage_class.md b/docs/data-sources/storage_class.md new file mode 100644 index 0000000000..846081a9f2 --- /dev/null +++ b/docs/data-sources/storage_class.md @@ -0,0 +1,125 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_storage_class" +description: |- + Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +--- + +# kubernetes_storage_class + +Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform.Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard storage class's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `allow_volume_expansion` (Boolean) Indicates whether the storage class allow volume expand +- `allowed_topologies` (Block List, Max: 1) Restrict the node topologies where volumes can be dynamically provisioned. (see [below for nested schema](#nestedblock--allowed_topologies)) +- `mount_options` (Set of String) Persistent Volumes that are dynamically created by a storage class will have the mount options specified +- `parameters` (Map of String) The parameters for the provisioner that should create volumes of this storage class +- `reclaim_policy` (String) Indicates the type of the reclaim policy +- `volume_binding_mode` (String) Indicates when volume binding and dynamic provisioning should occur + +### Read-Only + +- `id` (String) The ID of this resource. +- `storage_provisioner` (String) Indicates the type of the provisioner + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the storage class that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the storage class. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the storage class, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this storage class. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `allowed_topologies` + +Optional: + +- `match_label_expressions` (Block List) A list of topology selector requirements by labels. (see [below for nested schema](#nestedblock--allowed_topologies--match_label_expressions)) + + +### Nested Schema for `allowed_topologies.match_label_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `values` (Set of String) An array of string values. One value must match the label to be selected. + + + + + +## Example Usage + +``` +data "kubernetes_storage_class" "example" { + metadata { + name = "terraform-example" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `metadata` - (Required) Standard storage class's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) + +## Nested Blocks + +### `metadata` + +#### Arguments + +* `name` - (Required) Name of the storage class, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) + +### `allowed_topologies` + +īŋŧ + +#### Arguments + +īŋŧ + +* `match_label_expressions` - (Optional) A list of topology selector requirements by labels. See [match_label_expressions](#match_label_expressions) + +### `match_label_expressions` + +#### Arguments + +* `key` - (Optional) The label key that the selector applies to. +* `values` - (Optional) An array of string values. One value must match the label to be selected. + +#### Attributes + +* `generation` - A sequence number representing a specific generation of the desired state. +* `resource_version` - An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) +* `uid` - The unique in time and space value for this storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) + +## Argument Reference + +The following attributes are exported: + +* `parameters` - The parameters for the provisioner that creates volume of this storage class. Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#parameters). +* `storage_provisioner` - Indicates the type of the provisioner this storage class represents +* `reclaim_policy` - Indicates the reclaim policy used. +* `volume_binding_mode` - Indicates when volume binding and dynamic provisioning should occur. +* `allow_volume_expansion` - Indicates whether the storage class allow volume expand. +* `mount_options` - Persistent Volumes that are dynamically created by a storage class will have the mount options specified. +* `allowed_topologies` - (Optional) Restrict the node topologies where volumes can be dynamically provisioned. See [allowed_topologies](#allowed_topologies) diff --git a/docs/data-sources/storage_class_v1.md b/docs/data-sources/storage_class_v1.md new file mode 100644 index 0000000000..be51b65f3c --- /dev/null +++ b/docs/data-sources/storage_class_v1.md @@ -0,0 +1,125 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_storage_class_v1" +description: |- + Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +--- + +# kubernetes_storage_class_v1 + +Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform.Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard storage class's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `allow_volume_expansion` (Boolean) Indicates whether the storage class allow volume expand +- `allowed_topologies` (Block List, Max: 1) Restrict the node topologies where volumes can be dynamically provisioned. (see [below for nested schema](#nestedblock--allowed_topologies)) +- `mount_options` (Set of String) Persistent Volumes that are dynamically created by a storage class will have the mount options specified +- `parameters` (Map of String) The parameters for the provisioner that should create volumes of this storage class +- `reclaim_policy` (String) Indicates the type of the reclaim policy +- `volume_binding_mode` (String) Indicates when volume binding and dynamic provisioning should occur + +### Read-Only + +- `id` (String) The ID of this resource. +- `storage_provisioner` (String) Indicates the type of the provisioner + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the storage class that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the storage class. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the storage class, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this storage class. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `allowed_topologies` + +Optional: + +- `match_label_expressions` (Block List) A list of topology selector requirements by labels. (see [below for nested schema](#nestedblock--allowed_topologies--match_label_expressions)) + + +### Nested Schema for `allowed_topologies.match_label_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `values` (Set of String) An array of string values. One value must match the label to be selected. + + + + + +## Example Usage + +``` +data "kubernetes_storage_class_v1" "example" { + metadata { + name = "terraform-example" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `metadata` - (Required) Standard storage class's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) + +## Nested Blocks + +### `metadata` + +#### Arguments + +* `name` - (Required) Name of the storage class, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) + +### `allowed_topologies` + +īŋŧ + +#### Arguments + +īŋŧ + +* `match_label_expressions` - (Optional) A list of topology selector requirements by labels. See [match_label_expressions](#match_label_expressions) + +### `match_label_expressions` + +#### Arguments + +* `key` - (Optional) The label key that the selector applies to. +* `values` - (Optional) An array of string values. One value must match the label to be selected. + +#### Attributes + +* `generation` - A sequence number representing a specific generation of the desired state. +* `resource_version` - An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) +* `uid` - The unique in time and space value for this storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) + +## Argument Reference + +The following attributes are exported: + +* `parameters` - The parameters for the provisioner that creates volume of this storage class. Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#parameters). +* `storage_provisioner` - Indicates the type of the provisioner this storage class represents +* `reclaim_policy` - Indicates the reclaim policy used. +* `volume_binding_mode` - Indicates when volume binding and dynamic provisioning should occur. +* `allow_volume_expansion` - Indicates whether the storage class allow volume expand. +* `mount_options` - Persistent Volumes that are dynamically created by a storage class will have the mount options specified. +* `allowed_topologies` - (Optional) Restrict the node topologies where volumes can be dynamically provisioned. See [allowed_topologies](#allowed_topologies) diff --git a/docs/functions/manifest_decode.md b/docs/functions/manifest_decode.md new file mode 100644 index 0000000000..a7d14d85ba --- /dev/null +++ b/docs/functions/manifest_decode.md @@ -0,0 +1,45 @@ +--- +subcategory: "" +page_title: "manifest_decode function" +description: |- + Decode a Kubernetes YAML manifest +--- + +# function: manifest_decode + +Given a YAML text containing a Kubernetes manifest, will decode and return an object representation of that resource. + +## Example Usage + +```terraform +# Configuration using provider functions must include required_providers configuration. +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + # Setting the provider version is a strongly recommended practice + # version = "..." + } + } + # Provider functions require Terraform 1.8 and later. + required_version = ">= 1.8.0" +} + +output "example_output" { + value = provider::kubernetes::manifest_decode(file("manifest.yaml")) +} +``` + +## Signature + +```text +manifest_decode(manifest string) object +``` + +## Arguments + +1. `manifest` (String) The YAML text for a Kubernetes manifest + +## Return Type + +The `object` returned from `manifest_decode` is dynamic and will mirror the structure of the YAML manifest supplied. diff --git a/docs/functions/manifest_decode_multi.md b/docs/functions/manifest_decode_multi.md new file mode 100644 index 0000000000..23fa8ae929 --- /dev/null +++ b/docs/functions/manifest_decode_multi.md @@ -0,0 +1,45 @@ +--- +subcategory: "" +page_title: "manifest_decode_multi function" +description: |- + Decode a Kubernetes YAML manifest containing multiple resources +--- + +# function: manifest_decode_multi + +Given a YAML text containing a Kubernetes manifest with multiple resources, will decode the manifest and return a tuple of object representations for each resource. + +## Example Usage + +```terraform +# Configuration using provider functions must include required_providers configuration. +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + # Setting the provider version is a strongly recommended practice + # version = "..." + } + } + # Provider functions require Terraform 1.8 and later. + required_version = ">= 1.8.0" +} + +output "example_output" { + value = provider::kubernetes::manifest_decode_multi(file("manifest.yaml")) +} +``` + +## Signature + +```text +manifest_decode_multi(manifest string) tuple +``` + +## Arguments + +1. `manifest` (String) The YAML text for a Kubernetes manifest containing multiple resources + +## Return Type + +The `tuple` returned from `manifest_decode_multi` will contain dynamic objects that mirror the structure of the resources in YAML manifest supplied. diff --git a/docs/functions/manifest_encode.md b/docs/functions/manifest_encode.md new file mode 100644 index 0000000000..aef1c96fe8 --- /dev/null +++ b/docs/functions/manifest_encode.md @@ -0,0 +1,58 @@ +--- +subcategory: "" +page_title: "manifest_encode function" +description: |- + Decode a Kubernetes YAML manifest containing multiple resources +--- + +# function: manifest_encode + +Given an object representation of a Kubernetes manifest, will encode and return a YAML string for that resource. + +## Example Usage + +```terraform +# Configuration using provider functions must include required_providers configuration. +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + # Setting the provider version is a strongly recommended practice + # version = "..." + } + } + # Provider functions require Terraform 1.8 and later. + required_version = ">= 1.8.0" +} + +locals { + manifest = { + apiVersion = "v1" + kind = "ConfigMap" + metadata = { + name = "example" + } + data = { + EXAMPLE = "example" + } + } +} + +output "example_output" { + value = provider::kubernetes::manifest_encode(local.manifest) +} +``` + +## Signature + +```text +manifest_encode(manifest object) string +``` + +## Arguments + +1. `manifest` (String) The object representation of a Kubernetes manifest + +## Return Type + +The `string` returned from `manifest_encode` will contain the YAML encoded Kubernetes manifest. diff --git a/docs/guides/alpha-manifest-migration-guide.md b/docs/guides/alpha-manifest-migration-guide.md new file mode 100644 index 0000000000..6095226fd3 --- /dev/null +++ b/docs/guides/alpha-manifest-migration-guide.md @@ -0,0 +1,116 @@ +--- +subcategory: "" +page_title: "Migrating `kubernetes_manifest` resources from the kubernetes-alpha provider" +description: |- + This guide covers adopting `kubernetes_manifest` resources created using the kubernetes-alpha provider. +--- + +# The kubernetes_manifest resource + +Earlier this year we announced a new provider capable of managing any kind of Kubernetes resource, but more specifically Custom Resources via a manifest configuration that could be translated directly from Kubernetes YAML. This was released as the experimental [kubernetes-alpha](https://github.com/hashicorp/terraform-provider-kubernetes-alpha) provider. + +The `kubernetes_manifest` resource in now available in the official provider for Kubernetes. This guide walks through the actions needed to adopt existing `kubernetes_manifest` resources into configurations that use the Kubernetes provider. + +Follow these steps to migrate your configuration and continue using the `kubernetes_manifest` resource with the Kubernetes provider. + +## Step 1: Provider configuration blocks + +The provider configuration blocks for the `kubernetes-alpha` provider are no longer supported. To carry over the configuration, simply rename the provider block to "kubernetes". + +For example: + +``` +provider "kubernetes-alpha" { + config_path = "/my/kube/config" +} +``` + +becomes + +``` +provider "kubernetes" { + config_path = "/my/kube/config" + experiments { + manifest_resource = true + } +} +``` + +## Step 2: Provider references on resources + +The provider references to `kubernetes-alpha` are no longer required. Simply remove the `provider = kubernetes-alpha` text from all `kubernetes_manifest` resources in your configuration. + +For example: + +``` +resource "kubernetes_manifest" "my-resource" { + provider = kubernetes-alpha + manifest = {....} +} +``` + +becomes + +``` +resource "kubernetes_manifest" "my-resource" { + manifest = {....} +} +``` + +## Step 3: Provider version constraints + +If your configuration includes a `terraform` block which specifies required provider versions, you should remove any references to provider `kubernetes-alpha` from that block. At the same time, you should add a requirement for provider `kubernetes` version 2.4.0 and above. + +For example: + +``` +terraform { + required_providers { + kubernetes-alpha = { + source = "hashicorp/kubernetes-alpha" + version = "0.5.0" + } + ... + } +} +``` + +becomes: + +``` +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + version = ">= 2.4" + } + ... + } +} +``` + +If you made any changes to existing entries in the `required_providers` section, make sure to run `terraform init -upgrade` to let Terraform retrieve any required new provider versions. + +## Step 4: Replace providers in existing state + +If your configuration was already in use with the `kubernetes_alpha` provider, you likely also have Terraform state generated from it. +It is recommended to start fresh and re-apply configurations using the kubernetes provider from a clean slate. +However, in case you find it necessary to preserve state, you can rename the provider associated with any `kubernetes_manifest` resources using the dedicated `replace-provider` command in Terraform. + +Run the following command in the directory where the `terraform.tfstate` file is: + +``` +terraform state replace-provider hashicorp/kubernetes-alpha hashicorp/kubernetes +``` + +## Mixing 'kubernetes_manifest' with other 'kubernetes_*' resources + +In case you plan on adding `kubernetes_manifest` resources to your existing configuration which contains other resources of the Kubernetes provider there are some important aspects to be aware of. + +If your present configuration for the Kubernetes provider also creates the Kubernetes cluster using Terraform resources in the same `apply` operation (against best-practice recommendations), this will no longer work when adding `kubernetes_manifest` resources. The reason behind this is that `kubernetes_manifest` require access to the API during planning, at which point the cluster resource would not have yet been created. + +As a solution, choose one of the following options: + +* separate the cluster creation in a different `apply` operation. +* add a new `apply` operation only for the `kubernetes_manifest` resources. + diff --git a/docs/guides/getting-started.html.md b/docs/guides/getting-started.html.md new file mode 100644 index 0000000000..ba9171b9ff --- /dev/null +++ b/docs/guides/getting-started.html.md @@ -0,0 +1,747 @@ +--- +subcategory: "" +page_title: "Kubernetes: Getting Started with Kubernetes provider" +description: |- + This guide focuses on configuring authentication to your existing Kubernetes + cluster so that resources can be managed using the Kubernetes provider for Terraform. +--- + +# Getting Started with Kubernetes provider + +## Kubernetes + +-> Visit the [Manage Kubernetes Resources via Terraform](https://learn.hashicorp.com/tutorials/terraform/kubernetes-provider?in=terraform/kubernetes&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) Learn tutorial for an interactive getting +started experience. + +[Kubernetes](https://kubernetes.io/) (K8S) is an open-source workload scheduler with focus on containerized applications. + +There are at least 2 steps involved in scheduling your first container +on a Kubernetes cluster. You need the Kubernetes cluster with all its components +running _somewhere_ and then define the Kubernetes resources, such as Deployments, Services, etc. + +This guide focuses mainly on the latter part and expects you to have +a properly configured & running Kubernetes cluster. + +## Why Terraform + +While you could use `kubectl` or similar CLI-based tools mapped to API calls +to manage all Kubernetes resources described in YAML files, +orchestration with Terraform presents a few benefits. + +- Use the same [configuration language](/docs/configuration/syntax.html) + to provision the Kubernetes infrastructure and to deploy applications into it. +- drift detection - `terraform plan` will always present you the difference + between reality at a given time and config you intend to apply. +- full lifecycle management - Terraform doesn't just initially create resources, + but offers a single command for creation, update, and deletion of tracked + resources without needing to inspect the API to identify those resources. +- synchronous feedback - While asynchronous behaviour is often useful, + sometimes it's counter-productive as the job of identifying operation result + (failures or details of created resource) is left to the user. e.g. you don't + have IP/hostname of load balancer until it has finished provisioning, + hence you can't create any DNS record pointing to it. +- [graph of relationships](https://www.terraform.io/docs/internals/graph.html) - + Terraform understands relationships between resources which may help + in scheduling - e.g. if a Persistent Volume Claim claims space from + a particular Persistent Volume Terraform won't even attempt to create + the PVC if creation of the PV has failed. + +## Provider Setup + +The provider needs to be configured with the proper credentials before it can be used. The simplest configuration is to specify the kubeconfig path: + +```hcl +provider "kubernetes" { + config_path = "~/.kube/config" +} +``` + +Another configuration option is to **statically** define TLS certificate credentials: + +```hcl +provider "kubernetes" { + host = "https://104.196.242.174" + + client_certificate = "${file("~/.kube/client-cert.pem")}" + client_key = "${file("~/.kube/client-key.pem")}" + cluster_ca_certificate = "${file("~/.kube/cluster-ca-cert.pem")}" +} +``` + +Static TLS certficate credentials are present in Azure AKS clusters by default, and can be used with the [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/kubernetes_cluster) data source as shown below. This will automatically read the certficate information from the AKS cluster and pass it to the Kubernetes provider. + +```hcl +data "azurerm_kubernetes_cluster" "example" { + name = "myakscluster" + resource_group_name = "my-example-resource-group" +} + +provider "kubernetes" { + host = "${data.azurerm_kubernetes_cluster.example.kube_config.0.host}" + client_certificate = "${base64decode(data.azurerm_kubernetes_cluster.example.kube_config.0.client_certificate)}" + client_key = "${base64decode(data.azurerm_kubernetes_cluster.example.kube_config.0.client_key)}" + cluster_ca_certificate = "${base64decode(data.azurerm_kubernetes_cluster.example.kube_config.0.cluster_ca_certificate)}" +} +``` + +Another option is to use an oauth token, such as this example from a GKE cluster. The [google_client_config](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/client_config) data source fetches a token from the Google Authorization server, which expires in 1 hour by default. + +```hcl +data "google_client_config" "default" {} +data "google_container_cluster" "my_cluster" { + name = "my-cluster" + location = "us-east1-a" +} + +provider "kubernetes" { + host = "https://${data.google_container_cluster.my_cluster.endpoint}" + token = data.google_client_config.default.access_token + cluster_ca_certificate = base64decode(data.google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate) +} +``` + +For short-lived authentication tokens, like those found in EKS, which [expire in 15 minutes](https://aws.github.io/aws-eks-best-practices/security/docs/iam#controlling-access-to-eks-clusters), an exec-based credential plugin can be used to ensure the token is always up to date: + +```hcl +data "aws_eks_cluster" "example" { + name = "example" +} +data "aws_eks_cluster_auth" "example" { + name = "example" +} +provider "kubernetes" { + host = data.aws_eks_cluster.example.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.example.certificate_authority[0].data) + exec { + api_version = "client.authentication.k8s.io/v1beta1" + args = ["eks", "get-token", "--cluster-name", var.cluster_name] + command = "aws" + } +} +``` + +## Creating your first Kubernetes resources + +Once the provider is configured, you can apply the Kubernetes resources defined in your Terraform config file. The following is an example Terraform config file containing a few Kubernetes resources. We'll use [minikube](https://minikube.sigs.k8s.io/docs/start/) for the Kubernetes cluster in this example, but any Kubernetes cluster can be used. Ensure that a Kubernetes cluster of some kind is running before applying the example config below. + +This configuration will create a scalable Nginx Deployment with 2 replicas. It will expose the Nginx frontend using a Service of type NodePort, which will make Nginx accessible via the public IP of the node running the containers. + +```hcl +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + version = ">= 2.0.0" + } + } +} +provider "kubernetes" { + config_path = "~/.kube/config" +} +resource "kubernetes_namespace" "test" { + metadata { + name = "nginx" + } +} +resource "kubernetes_deployment" "test" { + metadata { + name = "nginx" + namespace = kubernetes_namespace.test.metadata.0.name + } + spec { + replicas = 2 + selector { + match_labels = { + app = "MyTestApp" + } + } + template { + metadata { + labels = { + app = "MyTestApp" + } + } + spec { + container { + image = "nginx" + name = "nginx-container" + port { + container_port = 80 + } + } + } + } + } +} +resource "kubernetes_service" "test" { + metadata { + name = "nginx" + namespace = kubernetes_namespace.test.metadata.0.name + } + spec { + selector = { + app = kubernetes_deployment.test.spec.0.template.0.metadata.0.labels.app + } + type = "NodePort" + port { + node_port = 30201 + port = 80 + target_port = 80 + } + } +} +``` + +Use `terraform init` to download the specified version of the Kubernetes provider: + +``` +$ terraform init + +Initializing the backend... + +Initializing provider plugins... +- Finding hashicorp/kubernetes versions matching "2.0"... +- Installing hashicorp/kubernetes v2.0... +- Installed hashicorp/kubernetes v2.0 (unauthenticated) + +Terraform has created a lock file .terraform.lock.hcl to record the provider +selections it made above. Include this file in your version control repository +so that Terraform can guarantee to make the same selections by default when +you run "terraform init" in the future. + +Terraform has been successfully initialized! + +You may now begin working with Terraform. Try running "terraform plan" to see +any changes that are required for your infrastructure. All Terraform commands +should now work. + +If you ever set or change modules or backend configuration for Terraform, +rerun this command to reinitialize your working directory. If you forget, other +commands will detect it and remind you to do so if necessary. +``` + +Next, use `terraform plan` to display a list of resources to be created, and highlight any possible unknown attributes at apply time. For Deployments, all disk options are shown at plan time, but none will be created unless explicitly configured in the Deployment resource. + +``` +$ terraform plan + +An execution plan has been generated and is shown below. +Resource actions are indicated with the following symbols: + + create + +Terraform will perform the following actions: + + # kubernetes_deployment.test will be created + + resource "kubernetes_deployment" "test" { + + id = (known after apply) + + wait_for_rollout = true + + + metadata { + + generation = (known after apply) + + name = "nginx" + + namespace = "nginx" + + resource_version = (known after apply) + + uid = (known after apply) + } + + + spec { + + min_ready_seconds = 0 + + paused = false + + progress_deadline_seconds = 600 + + replicas = "2" + + revision_history_limit = 10 + + + selector { + + match_labels = { + + "app" = "MyTestApp" + } + } + + + strategy { + + type = (known after apply) + + + rolling_update { + + max_surge = (known after apply) + + max_unavailable = (known after apply) + } + } + + + template { + + metadata { + + generation = (known after apply) + + labels = { + + "app" = "MyTestApp" + } + + name = (known after apply) + + resource_version = (known after apply) + + uid = (known after apply) + } + + + spec { + + automount_service_account_token = true + + dns_policy = "ClusterFirst" + + enable_service_links = true + + host_ipc = false + + host_network = false + + host_pid = false + + hostname = (known after apply) + + node_name = (known after apply) + + restart_policy = "Always" + + service_account_name = (known after apply) + + share_process_namespace = false + + termination_grace_period_seconds = 30 + + + container { + + image = "nginx" + + image_pull_policy = (known after apply) + + name = "nginx-container" + + stdin = false + + stdin_once = false + + termination_message_path = "/dev/termination-log" + + termination_message_policy = (known after apply) + + tty = false + + + port { + + container_port = 80 + + protocol = "TCP" + } + + + resources { + + limits = (known after apply) + + requests = (known after apply) + } + + + volume_mount { + + mount_path = (known after apply) + + mount_propagation = (known after apply) + + name = (known after apply) + + read_only = (known after apply) + + sub_path = (known after apply) + } + } + + + image_pull_secrets { + + name = (known after apply) + } + + + readiness_gate { + + condition_type = (known after apply) + } + + + volume { + + name = (known after apply) + + + aws_elastic_block_store { + + fs_type = (known after apply) + + partition = (known after apply) + + read_only = (known after apply) + + volume_id = (known after apply) + } + + + azure_disk { + + caching_mode = (known after apply) + + data_disk_uri = (known after apply) + + disk_name = (known after apply) + + fs_type = (known after apply) + + kind = (known after apply) + + read_only = (known after apply) + } + + + azure_file { + + read_only = (known after apply) + + secret_name = (known after apply) + + share_name = (known after apply) + + secret_namespace = (known after apply) + } + + + ceph_fs { + + monitors = (known after apply) + + path = (known after apply) + + read_only = (known after apply) + + secret_file = (known after apply) + + user = (known after apply) + + + secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + } + + + cinder { + + fs_type = (known after apply) + + read_only = (known after apply) + + volume_id = (known after apply) + } + + + config_map { + + default_mode = (known after apply) + + name = (known after apply) + + optional = (known after apply) + + + items { + + key = (known after apply) + + mode = (known after apply) + + path = (known after apply) + } + } + + + csi { + + driver = (known after apply) + + fs_type = (known after apply) + + read_only = (known after apply) + + volume_attributes = (known after apply) + + volume_handle = (known after apply) + + + controller_expand_secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + + + controller_publish_secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + + + node_publish_secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + + + node_stage_secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + } + + + downward_api { + + default_mode = (known after apply) + + + items { + + mode = (known after apply) + + path = (known after apply) + + + field_ref { + + api_version = (known after apply) + + field_path = (known after apply) + } + + + resource_field_ref { + + container_name = (known after apply) + + divisor = (known after apply) + + resource = (known after apply) + } + } + } + + + empty_dir { + + medium = (known after apply) + + size_limit = (known after apply) + } + + + fc { + + fs_type = (known after apply) + + lun = (known after apply) + + read_only = (known after apply) + + target_ww_ns = (known after apply) + } + + + flex_volume { + + driver = (known after apply) + + fs_type = (known after apply) + + options = (known after apply) + + read_only = (known after apply) + + + secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + } + + + flocker { + + dataset_name = (known after apply) + + dataset_uuid = (known after apply) + } + + + gce_persistent_disk { + + fs_type = (known after apply) + + partition = (known after apply) + + pd_name = (known after apply) + + read_only = (known after apply) + } + + + git_repo { + + directory = (known after apply) + + repository = (known after apply) + + revision = (known after apply) + } + + + glusterfs { + + endpoints_name = (known after apply) + + path = (known after apply) + + read_only = (known after apply) + } + + + host_path { + + path = (known after apply) + + type = (known after apply) + } + + + iscsi { + + fs_type = (known after apply) + + iqn = (known after apply) + + iscsi_interface = (known after apply) + + lun = (known after apply) + + read_only = (known after apply) + + target_portal = (known after apply) + } + + + local { + + path = (known after apply) + } + + + nfs { + + path = (known after apply) + + read_only = (known after apply) + + server = (known after apply) + } + + + persistent_volume_claim { + + claim_name = (known after apply) + + read_only = (known after apply) + } + + + photon_persistent_disk { + + fs_type = (known after apply) + + pd_id = (known after apply) + } + + + projected { + + default_mode = (known after apply) + + + sources { + + config_map { + + name = (known after apply) + + optional = (known after apply) + + + items { + + key = (known after apply) + + mode = (known after apply) + + path = (known after apply) + } + } + + + downward_api { + + items { + + mode = (known after apply) + + path = (known after apply) + + + field_ref { + + api_version = (known after apply) + + field_path = (known after apply) + } + + + resource_field_ref { + + container_name = (known after apply) + + quantity = (known after apply) + + resource = (known after apply) + } + } + } + + + secret { + + name = (known after apply) + + optional = (known after apply) + + + items { + + key = (known after apply) + + mode = (known after apply) + + path = (known after apply) + } + } + + + service_account_token { + + audience = (known after apply) + + expiration_seconds = (known after apply) + + path = (known after apply) + } + } + } + + + quobyte { + + group = (known after apply) + + read_only = (known after apply) + + registry = (known after apply) + + user = (known after apply) + + volume = (known after apply) + } + + + rbd { + + ceph_monitors = (known after apply) + + fs_type = (known after apply) + + keyring = (known after apply) + + rados_user = (known after apply) + + rbd_image = (known after apply) + + rbd_pool = (known after apply) + + read_only = (known after apply) + + + secret_ref { + + name = (known after apply) + + namespace = (known after apply) + } + } + + + secret { + + default_mode = (known after apply) + + optional = (known after apply) + + secret_name = (known after apply) + + + items { + + key = (known after apply) + + mode = (known after apply) + + path = (known after apply) + } + } + + + vsphere_volume { + + fs_type = (known after apply) + + volume_path = (known after apply) + } + } + } + } + } + } + + # kubernetes_namespace.test will be created + + resource "kubernetes_namespace" "test" { + + id = (known after apply) + + + metadata { + + generation = (known after apply) + + name = "nginx" + + resource_version = (known after apply) + + uid = (known after apply) + } + } + + # kubernetes_service.test will be created + + resource "kubernetes_service" "test" { + + id = (known after apply) + + status = (known after apply) + + wait_for_load_balancer = true + + + metadata { + + generation = (known after apply) + + name = "nginx" + + namespace = "nginx" + + resource_version = (known after apply) + + uid = (known after apply) + } + + + spec { + + cluster_ip = (known after apply) + + external_traffic_policy = (known after apply) + + health_check_node_port = (known after apply) + + publish_not_ready_addresses = false + + selector = { + + "app" = "MyTestApp" + } + + session_affinity = "None" + + type = "NodePort" + + + port { + + node_port = 30201 + + port = 80 + + protocol = "TCP" + + target_port = "80" + } + } + } + +Plan: 3 to add, 0 to change, 0 to destroy. + +------------------------------------------------------------------------ + +Note: You didn't specify an "-out" parameter to save this plan, so Terraform +can't guarantee that exactly these actions will be performed if +"terraform apply" is subsequently run. +``` + +Use `terraform apply` to create the resources shown above. + +``` +$ terraform apply --auto-approve + +kubernetes_namespace.test: Creating... +kubernetes_namespace.test: Creation complete after 0s [id=nginx] +kubernetes_deployment.test: Creating... +kubernetes_deployment.test: Creation complete after 7s [id=nginx/nginx] +kubernetes_service.test: Creating... +kubernetes_service.test: Creation complete after 0s [id=nginx/nginx] + +Apply complete! Resources: 3 added, 0 changed, 0 destroyed. +``` + +The resources are now visible in the Kubernetes cluster. + +``` +$ kubectl get all -n nginx + +NAME READY STATUS RESTARTS AGE +pod/nginx-86c669bff4-8g7g2 1/1 Running 0 38s +pod/nginx-86c669bff4-zgjkv 1/1 Running 0 38s + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/nginx NodePort 10.109.205.23 80:30201/TCP 30s + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/nginx 2/2 2 2 38s + +NAME DESIRED CURRENT READY AGE +replicaset.apps/nginx-86c669bff4 2 2 2 38s +``` + +The web server can be accessed using the public IP of the node running the Deployment. In this example, we're using minikube as the Kubernetes cluster, so the IP can be fetched using `minikube ip`. + +``` +$ curl $(minikube ip):30201 + + + + +Welcome to nginx! + + + +

Welcome to nginx!

+

If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.

+ +

For online documentation and support please refer to +nginx.org.
+Commercial support is available at +nginx.com.

+ +

Thank you for using nginx.

+ + +``` + +Alternatively, look for the hostIP associated with a running Nginx pod and combine it with the NodePort to assemble the URL: + +``` +$ kubectl get pod nginx-86c669bff4-zgjkv -n nginx -o json | jq .status.hostIP +"192.168.39.189" + +$ kubectl get services -n nginx +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +nginx NodePort 10.109.205.23 80:30201/TCP 19m + +$ curl 192.168.39.189:30201 +``` diff --git a/docs/guides/v2-upgrade-guide.md b/docs/guides/v2-upgrade-guide.md new file mode 100644 index 0000000000..a8dd0121ae --- /dev/null +++ b/docs/guides/v2-upgrade-guide.md @@ -0,0 +1,305 @@ +--- +subcategory: "" +page_title: "Kubernetes: Upgrade Guide for Kubernetes Provider v2.0.0" +description: |- + This guide covers the changes introduced in v2.0.0 of the Kubernetes provider and what you may need to do to upgrade your configuration. +--- + +# Upgrading to v2.0.0 of the Kubernetes provider + +This guide covers the changes introduced in v2.0.0 of the Kubernetes provider and what you may need to do to upgrade your configuration. + +Use `terraform init` to install version 2 of the provider. Then run `terraform plan` to determine if the upgrade will affect any existing resources. Some resources will have updated defaults and may be modified as a result. To opt out of this change, see the guide below and update your Terraform config file to match the existing resource settings (for example, set `automount_service_account_token=false`). Then run `terraform plan` again to ensure no resource updates will be applied. + +NOTE: Even if there are no resource updates to apply, you may need to run `terraform refresh` to update your state to the newest version. Otherwise, some commands might fail with `Error: missing expected {`. + +## Installing and testing this update + +The `required_providers` block can be used to move between version 1.x and version 2.x of the Kubernetes provider, for testing purposes. Please note that this is only possible using `terraform plan`. Once you run `terraform apply` or `terraform refresh`, the changes to Terraform State become permanent, and rolling back is no longer an option. It may be possible to roll back the State by making a copy of `.terraform.tfstate` before running `apply` or `refresh`, but this configuration is unsupported. + +### Using required_providers to test the update + +The version of the Kubernetes provider can be controlled using the `required_providers` block: + +```hcl +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + version = ">= 2.0" + } + } +} +``` + +When the above code is in place, run `terraform init` to upgrade the provider version. + +``` +$ terraform init -upgrade +``` + +Ensure you have a valid provider block for 2.0 before proceeding with the `terraform plan` below. In version 2.0 of the provider, [provider configuration is now required](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs). A quick way to get up and running with the new provider configuration is to set `KUBE_CONFIG_PATH` to point to your existing kubeconfig. + +``` +export KUBE_CONFIG_PATH=$KUBECONFIG +``` + +Then run `terraform plan` to see what changes will be applied. This example shows the specific fields that would have been modified, and their effect on the resources, such as replacement or an in-place update. Some output is omitted for clarity. + +``` +$ export KUBE_CONFIG_PATH=$KUBECONFIG +$ terraform plan + +kubernetes_pod.test: Refreshing state... [id=default/test] +kubernetes_job.test: Refreshing state... [id=default/test] +kubernetes_stateful_set.test: Refreshing state... [id=default/test] +kubernetes_deployment.test: Refreshing state... [id=default/test] +kubernetes_daemonset.test: Refreshing state... [id=default/test] +kubernetes_cron_job.test: Refreshing state... [id=default/test] + +An execution plan has been generated and is shown below. +Resource actions are indicated with the following symbols: + ~ update in-place +-/+ destroy and then create replacement + +Terraform will perform the following actions: + + # kubernetes_cron_job.test must be replaced +-/+ resource "kubernetes_cron_job" "test" { + ~ enable_service_links = false -> true # forces replacement + + # kubernetes_daemonset.test will be updated in-place + ~ resource "kubernetes_daemonset" "test" { + + wait_for_rollout = true + ~ template { + ~ spec { + ~ enable_service_links = false -> true + + # kubernetes_deployment.test will be updated in-place + ~ resource "kubernetes_deployment" "test" { + ~ spec { + ~ enable_service_links = false -> true + + # kubernetes_job.test must be replaced +-/+ resource "kubernetes_job" "test" { + ~ enable_service_links = false -> true # forces replacement + + # kubernetes_stateful_set.test will be updated in-place + ~ resource "kubernetes_stateful_set" "test" { + ~ spec { + ~ enable_service_links = false -> true + +Plan: 2 to add, 3 to change, 2 to destroy. +``` + +Using the output from `terraform plan`, you can make modifications to your existing Terraform config, to avoid any unwanted resource changes. For example, in the above config, adding `enable_service_links = false` to the resources would prevent any changes from occurring to the existing resources. + +#### Known limitation: Pod data sources need manual upgrade + +During `terraform plan`, you might encounter the error below: + +``` +Error: .spec[0].container[0].resources[0].limits: missing expected { +``` + +This ocurrs when a Pod data source is present during upgrade. To work around this error, remove the data source from state and try the plan again. + +``` +$ terraform state rm data.kubernetes_pod.test +Removed data.kubernetes_pod.test +Successfully removed 1 resource instance(s). + +$ terraform plan +``` + +The data source will automatically be added back to state with data from the upgraded schema. + +### Rolling back to version 1.x + +If you've run the above upgrade and plan, but you don't want to proceed with the 2.0 upgrade, you can roll back using the following steps. NOTE: this will only work if you haven't run `terraform apply` or `terraform refresh` while testing version 2 of the provider. + +``` +$ terraform version +Terraform v0.14.4 ++ provider registry.terraform.io/hashicorp/kubernetes v2.0 +``` + +Set the provider version back to 1.x. + +``` +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + version = "1.13" + } + } +} +``` + +Then run `terraform init -upgrade` to install the old provider version. + +``` +$ terraform init -upgrade + +Initializing the backend... + +Initializing provider plugins... +- Finding hashicorp/kubernetes versions matching "1.13.0"... +- Installing hashicorp/kubernetes v1.13.0... +- Installed hashicorp/kubernetes v1.13.0 (signed by HashiCorp) +``` + +The provider is now downgraded. + +``` +$ terraform version +Terraform v0.14.4 ++ provider registry.terraform.io/hashicorp/kubernetes v1.13.0 +``` + + +## Changes in v2.0.0 + +### Changes to Kubernetes credentials supplied in the provider block + +We have made several changes to the way access to Kubernetes is configured in the provider block. + +1. The `load_config_file` attribute has been removed. +2. Support for the `KUBECONFIG` environment variable has been dropped. (Use `KUBE_CONFIG_PATH` or `KUBE_CONFIG_PATHS` instead). +3. The `config_path` attribute will no longer default to `~/.kube/config`. + +The above changes have been made to encourage the best practice of configuring access to Kubernetes in the provider block explicitly, instead of relying upon default paths or `KUBECONFIG` being set. We have done this because allowing the provider to configure its access to Kubernetes implicitly caused confusion with a subset of our users. It also created risk for users who use Terraform to manage multiple clusters. Requiring explicit configuration for Kubernetes in the provider block eliminates the possibility that the configuration will be applied to the wrong cluster. + +You will therefore need to explicitly configure access to your Kubernetes cluster in the provider block going forward. For many users this will simply mean specifying the `config_path` attribute in the provider block. Users already explicitly configuring the provider should not be affected by this change, but will need to remove the `load_config_file` attribute if they are currently using it. + +### Changes to the `load_balancers_ingress` block on Service and Ingress + +We changed the `load_balancers_ingress` block on the Service and Ingress resources and data sources to align with the upstream Kubernetes API. `load_balancers_ingress` was a computed attribute that allowed users to obtain the `ip` or `hostname` of a `load_balancer`. Instead of `load_balancers_ingress`, users should use `status[].load_balancer[].ingress[]` to obtain the `ip` or `hostname` attributes. + +```hcl +output "ingress_hostname" { + value = kubernetes_ingress.example_ingress.status[0].load_balancer[0].ingress[0].hostname +} +``` + +### The `automount_service_account_token` attribute now defaults to `true` on Service, Deployment, StatefulSet, and DaemonSet + +Previously if `automount_service_account_token = true` was not set on the Service, Deployment, StatefulSet, or DaemonSet resources, the service account token was not mounted, even when a `service_account_name` was specified. This lead to confusion for many users, because our implementation did not align with the default behavior of the Kubernetes API, which defaults to `true` for this attribute. + +```hcl +resource "kubernetes_deployment" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyExampleApp" + } + } + + spec { + replicas = 1 + + selector { + match_labels = { + test = "MyExampleApp" + } + } + + template { + metadata { + labels = { + test = "MyExampleApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + } + + service_account_name = "default" + automount_service_account_token = false + } + } + } +} +``` + +### Normalize wait defaults across Deployment, DaemonSet, StatefulSet, Service, Ingress, and Job + +All of the `wait_for` attributes now default to `true`, including: + +- `wait_for_rollout` on the `kubernetes_deployment`, `kubernetes_daemonset`, and `kubernetes_stateful_set` resources +- `wait_for_loadbalancer` on the `kubernetes_service` and `kubernetes_ingress` resources +- `wait_for_completion` on the `kubernetes_job` resource + +Previously some of them defaulted to `false` while others defaulted to `true`, causing an inconsistent user experience. If you don't want Terraform to wait for the specified condition before moving on, you must now always set the appropriate attribute to `false` + +```hcl +resource "kubernetes_service" "myapp1" { + metadata { + name = "myapp1" + } + + spec { + selector = { + app = kubernetes_pod.example.metadata[0].labels.app + } + + session_affinity = "ClientIP" + type = "LoadBalancer" + + port { + port = 8080 + target_port = 80 + } + } + + wait_for_load_balancer = "false" +} +``` + +### Changes to the `limits` and `requests` attributes on all resources that support a PodSpec + +The `limits` and `requests` attributes on all resources that include a PodSpec, are now a map. This means that `limits {}` must be changed to `limits = {}`, and the same for `requests`. This change impacts the following resources: `kubernetes_deployment`, `kubernetes_daemonset`, `kubernetes_stateful_set`, `kubernetes_pod`, `kubernetes_job`, `kubernetes_cron_job`. + +This change was made to enable the use of extended resources, such as GPUs, in these fields. + +```hcl +resource "kubernetes_pod" "test" { + metadata { + name = "terraform-example" + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + "nvidia/gpu" = "1" + } + + requests = { + cpu = "250m" + memory = "50Mi" + "nvidia/gpu" = "1" + } + } + } + } +} +``` + + +### Dropped support for Terraform 0.11 + +All builds of the Kubernetes provider going forward will no longer work with Terraform 0.11. See [Upgrade Guides](https://www.terraform.io/upgrade-guides/index.html) for how to migrate your configurations to a newer version of Terraform. + +### Upgrade to v2 of the Terraform Plugin SDK + +Contributors to the provider will be interested to know this upgrade has brought the latest version of the [Terraform Plugin SDK](https://github.com/hashicorp/terraform-plugin-sdk) which introduced a number of enhancements to the developer experience. Details of the changes introduced can be found under [Extending Terraform](https://www.terraform.io/docs/extend/guides/v2-upgrade-guide.html). diff --git a/docs/guides/versioned-resources.md b/docs/guides/versioned-resources.md new file mode 100644 index 0000000000..a5ff0cde00 --- /dev/null +++ b/docs/guides/versioned-resources.md @@ -0,0 +1,62 @@ +--- +subcategory: "" +page_title: "Versioned resource names" +description: |- + This guide explains the naming conventions for resources and data sources in the Kubernetes provider. +--- + +# Versioned resource names + +This guide explains the naming conventions for resources and data sources in the Kubernetes provider. + + +## Version suffixes + +From provider version v2.7.0 onwards Terraform resources and data sources that cover the [standard set of Kubernetes APIs](https://kubernetes.io/docs/reference/kubernetes-api/) will be suffixed with their corresponding Kubernetes API version (e.g `v1`, `v2`, `v2beta1`). The existing resources in the provider will continue to be maintained as is. + + +## Motivation + +We are doing this to make it easier to use and maintain the provider, and to promote long-term stability and backwards compatibility with resources in the Kubernetes API as they reach maturity, and as the provider sees wider adoption. + +Because Terraform does not support configurable schema versions for individual resources in the same way that the Kubernetes API does, the user sees a simpler unversioned schema for the Terraform resource. This is sometimes a good thing as the user is not burdened by Kubernetes API groups and versions, but it has caused confusion as the Kubernetes API evolves while the Terraform provider still has to support older versions of API resources. This also burdens the user with having to version pin the provider if they still rely upon a specific API version in their configuration. + +In the past we have tried to support multiple Kubernetes API versions using a single Terraform resource with varying degrees of success. The [kubernetes_horizontal_pod_autoscaler](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/horizontal_pod_autoscaler) supports multiple versions of the autoscaling API by having a schema that includes attributes from both the `v1` and `v2beta2` APIs and then looks which attributes have been set to determine the appropriate Kubernetes API version to use. The [kubernetes_mutating_webhook_configuration](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/mutating_webhook_configuration) and [kubernetes_validating_webhook_configuration](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/validating_webhook_configuration) resources use the discovery client to determine which version of the `admissionregistration` API the cluster supports. These approaches seem reasonable but lead to Terraform resource schemas where it is not obvious which attributes are actually supported by the target cluster, and creates an unsustainable maintenance burden as a resource has to be cobbled together by hand to support multiple API versions. + +Ultimately, we plan to completely automate the generation of Terraform resources to cover the core Kubernetes API. Having a set of versioned schemas that more closely matches the Kubernetes API definition is going to make this easier to achieve and will enable us to add built-in support for new API versions much faster. + + +## What will happen to the resources without versions in the name? + +These resources will continue to be supported and maintained as is through to v3.0.0 of the provider, at which point they will be marked as deprecated and then subsequently removed in v4.0.0. + + +## `v1` and above resources + +Resources suffixed with a major version number are considered to have stable APIs that will not change. These resources will be supported by the provider so long as the API version continues to be supported by the Kubernetes API, and likely for some time after it is deprecated and removed as there is often a long tail of migration as users of the provider continue to support legacy infrastructure. + +While the API contract for these resources is assumed to be concrete, we will still accept changes to add additional attributes to these resources for configuring convenience features such as the `wait_for_rollout` attribute seen on resources such as `kubernetes_deployment`. Changes to these attributes should always be accompanied by deprecation warnings, state upgraders, and follow our typical [semantic versioning](https://www.terraform.io/docs/extend/best-practices/versioning.html#versioning-specification) scheme. + + +## `beta` resources + +We will continue to bring support for API resources which reach `beta` however it is expected that the API contract for these resources can still change and so they should be used with some caution. When a `beta` API changes we will provide a state upgrader for the resource where possible. Refer to the Kubernetes API documentation on the use of [beta resources](https://kubernetes.io/docs/reference/using-api/#api-versioning). + + +## `alpha` resources + +We will continue our policy of not building support for `alpha` versioned resources into the provider. Please use the [kubernetes_manifest](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest) resource to manage those resources. + + +## How can I move a resource without a version to its versioned resource name? + +The simplest, non-destructive way to do this is to modify the name of the resource to include the version suffix. Then remove the old resource from state and import the resource under the versioned resource like so: + +``` +terraform state rm kubernetes_config_map.example +terraform import kubernetes_config_map_v1.example default/example +``` + +Then run `terraform plan` to confirm that the import was successful. **NOTE: Do not run the plan after renaming the resource in the configuration until after the above steps have been carried out.** + +You can also skip this and just allow Terraform to destroy and recreate the resource, but this is not recommended for resources like `kubernetes_service` and `kubernetes_deployment`. diff --git a/website/docs/index.html.markdown b/docs/index.md similarity index 90% rename from website/docs/index.html.markdown rename to docs/index.md index c6cd842df5..f126c0b1e2 100644 --- a/website/docs/index.html.markdown +++ b/docs/index.md @@ -1,5 +1,4 @@ --- -layout: "kubernetes" page_title: "Provider: Kubernetes" description: |- The Kubernetes (K8s) provider is used to interact with the resources supported by Kubernetes. The provider needs to be configured with the proper credentials before it can be used. @@ -13,7 +12,7 @@ Use the navigation to the left to read about the available resources. ## Example Usage -```hcl +```terraform provider "kubernetes" { config_path = "~/.kube/config" config_context = "my-context" @@ -28,10 +27,7 @@ resource "kubernetes_namespace" "example" { ## Kubernetes versions -Both backward and forward compatibility with Kubernetes API is mostly defined -by the [official K8S Go library](https://github.com/kubernetes/kubernetes) (prior to `1.1` release) -and [client Go library](https://github.com/kubernetes/client-go) which we ship with Terraform. -Below are versions of the library bundled with given versions of Terraform. +Both backward and forward compatibility with Kubernetes API is mostly defined by the [official K8S Go library](https://github.com/kubernetes/kubernetes) (prior to `1.1` release) and [client Go library](https://github.com/kubernetes/client-go) which we ship with Terraform. Below are versions of the library bundled with given versions of Terraform. * Terraform `<= 0.9.6` (prior to provider split) - Kubernetes `1.5.4` * Terraform `0.9.7` (prior to provider split) `< 1.1` (provider version) - Kubernetes `1.6.1` @@ -49,33 +45,28 @@ The most reliable way to configure the Kubernetes provider is to ensure that the For specific usage examples, see the guides for [AKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/aks/README.md), [EKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/eks/README.md), and [GKE](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/gke/README.md). - ## Authentication ~> NOTE: The provider does not use the `KUBECONFIG` environment variable by default. See the attribute reference below for the environment variables that map to provider block attributes. The Kubernetes provider can get its configuration in two ways: -1. _Explicitly_ by supplying attributes to the provider block. This includes: +1. *Explicitly* by supplying attributes to the provider block. This includes: * [Using a kubeconfig file](#file-config) * [Supplying credentials](#credentials-config) * [Exec plugins](#exec-plugins) -2. _Implicitly_ through environment variables. This includes: +2. *Implicitly* through environment variables. This includes: * [Using the in-cluster config](#in-cluster-config) -The provider always first tries to load **a config file** from a given location -when `config_path` or `config_paths` (or their equivalent environment variables) are set. -Depending on whether you have a current context set this _may_ require -`config_context_auth_info` and/or `config_context_cluster` and/or `config_context`. +The provider always first tries to load **a config file** from a given location when `config_path` or `config_paths` (or their equivalent environment variables) are set. Depending on whether you have a current context set this *may* require `config_context_auth_info` and/or `config_context_cluster` and/or `config_context`. For a full list of supported provider authentication arguments and their corresponding environment variables, see the [argument reference](#argument-reference) below. - ### File config The easiest way is to supply a path to your kubeconfig file using the `config_path` attribute or using the `KUBE_CONFIG_PATH` environment variable. A kubeconfig file may have multiple contexts. If `config_context` is not specified, the provider will use the `default` context. -```hcl +```terraform provider "kubernetes" { config_path = "~/.kube/config" } @@ -83,7 +74,7 @@ provider "kubernetes" { The provider also supports multiple paths in the same way that kubectl does using the `config_paths` attribute or `KUBE_CONFIG_PATHS` environment variable. -```hcl +```terraform provider "kubernetes" { config_paths = [ "/path/to/config_a.yaml", @@ -96,7 +87,7 @@ provider "kubernetes" { You can also configure the host, basic auth credentials, and client certificate authentication explicitly or through environment variables. -```hcl +```terraform provider "kubernetes" { host = "https://cluster_endpoint:port" @@ -120,7 +111,7 @@ Some cloud providers have short-lived authentication tokens that can expire rela ~> IMPORTANT: DO NOT mix `exec` blocks with other credential attributes such as `token` or `client_certificate` in the provider configuration. This leads to undefined behaviour and there is no guarantee about which credential will actually be used. -```hcl +```terraform provider "kubernetes" { host = var.cluster_endpoint cluster_ca_certificate = base64decode(var.cluster_ca_cert) @@ -132,7 +123,7 @@ provider "kubernetes" { } ``` -## Examples +## Examples For further reading, see these examples which demonstrate different approaches to keeping the cluster credentials up to date: [AKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/aks/README.md), [EKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/eks/README.md), and [GKE](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/gke/README.md). @@ -150,7 +141,7 @@ Please keep in mind that all data sources remain unaffected, and the provider al The following example demonstrates how to ignore changes related to the `kubectl.kubernetes.io/restartedAt` annotation that were made in the upstream Kubernetes object: -```hcl +```terraform resource "kubernetes_deployment_v1" "this" { // omit the resource config lifecycle { @@ -163,7 +154,7 @@ resource "kubernetes_deployment_v1" "this" { The following example demonstrates how to ignore particular annotation keys: -```hcl +```terraform provider "kubernetes" { ignore_annotations = [ "cni\\.projectcalico\\.org\\/podIP", @@ -174,7 +165,7 @@ provider "kubernetes" { Next example demonstrates how to ignore AWS load balancer annotations: -```hcl +```terraform provider "kubernetes" { ignore_annotations = [ "^service\\.beta\\.kubernetes\\.io\\/aws-load-balancer.*", @@ -201,12 +192,12 @@ The following arguments are supported: * `config_context` - (Optional) Context to choose from the config file. Can be sourced from `KUBE_CTX`. * `config_context_auth_info` - (Optional) Authentication info context of the kube config (name of the kubeconfig user, `--user` flag in `kubectl`). Can be sourced from `KUBE_CTX_AUTH_INFO`. * `config_context_cluster` - (Optional) Cluster context of the kube config (name of the kubeconfig cluster, `--cluster` flag in `kubectl`). Can be sourced from `KUBE_CTX_CLUSTER`. -* `token` - (Optional) Token of your service account. Can be sourced from `KUBE_TOKEN`. +* `token` - (Optional) Token of your service account. Can be sourced from `KUBE_TOKEN`. * `proxy_url` - (Optional) URL to the proxy to be used for all API requests. URLs with "http", "https", and "socks5" schemes are supported. Can be sourced from `KUBE_PROXY_URL`. * `exec` - (Optional) Configuration block to use an [exec-based credential plugin] (https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), e.g. call an external command to receive user credentials. - * `api_version` - (Required) API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`. - * `command` - (Required) Command to execute. - * `args` - (Optional) List of arguments to pass when executing the plugin. - * `env` - (Optional) Map of environment variables to set when executing the plugin. +* `api_version` - (Required) API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`. +* `command` - (Required) Command to execute. +* `args` - (Optional) List of arguments to pass when executing the plugin. +* `env` - (Optional) Map of environment variables to set when executing the plugin. * `ignore_annotations` - (Optional) List of Kubernetes metadata annotations to ignore across all resources handled by this provider for situations where external systems are managing certain resource annotations. This option does not affect annotations within a template block. Each item is a regular expression. * `ignore_labels` - (Optional) List of Kubernetes metadata labels to ignore across all resources handled by this provider for situations where external systems are managing certain resource labels. This option does not affect annotations within a template block. Each item is a regular expression. diff --git a/website/docs/r/annotations.html.markdown b/docs/resources/annotations.md similarity index 59% rename from website/docs/r/annotations.html.markdown rename to docs/resources/annotations.md index fd84f4593c..a67642d9fe 100644 --- a/website/docs/r/annotations.html.markdown +++ b/docs/resources/annotations.md @@ -1,6 +1,5 @@ --- subcategory: "manifest" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_annotations" description: |- This resource allows Terraform to manage the annotations for a resource that already exists @@ -8,12 +7,45 @@ description: |- # kubernetes_annotations -This resource allows Terraform to manage the annotations for a resource that already exists. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the annotations that are defined in the Terraform configuration. Existing annotations not specified in the configuration will be ignored. If an annotation specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true. +This resource allows Terraform to manage the annotations for a resource that already exists. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the annotations that are defined in the Terraform configuration. Existing annotations not specified in the configuration will be ignored. If an annotation specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true. + + +## Schema + +### Required + +- `api_version` (String) The apiVersion of the resource to annotate. +- `kind` (String) The kind of the resource to annotate. +- `metadata` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `annotations` (Map of String) A map of annotations to apply to the resource. +- `field_manager` (String) Set the name of the field manager for the specified labels. +- `force` (Boolean) Force overwriting annotations that were created or edited outside of Terraform. +- `template_annotations` (Map of String) A map of annotations to apply to the resource template. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Required: + +- `name` (String) The name of the resource. + +Optional: + +- `namespace` (String) The namespace of the resource. + + ## Example Usage -```hcl +```terraform resource "kubernetes_annotations" "example" { api_version = "v1" kind = "ConfigMap" @@ -28,7 +60,7 @@ resource "kubernetes_annotations" "example" { ## Example Usage: Patching resources which contain a pod template, e.g Deployment, Job -```hcl +```terraform resource "kubernetes_annotations" "example" { api_version = "apps/v1" kind = "Deployment" @@ -46,31 +78,6 @@ resource "kubernetes_annotations" "example" { } ``` -## Argument Reference - -The following arguments are supported: - -~> NOTE: At least one of `annotations` or `template_annotations` is required. - -* `api_version` - (Required) The apiVersion of the resource to be annotated. -* `kind` - (Required) The kind of the resource to be annotated. -* `metadata` - (Required) Standard metadata of the resource to be annotated. -* `annotations` - (Optional) A map of annotations to apply to the resource. -* `template_annotations` - (Optional) A map of annotations to apply to the pod template within the resource. -* `force` - (Optional) Force management of annotations if there is a conflict. Defaults to `false`. -* `field_manager` - (Optional) The name of the [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management). Defaults to `Terraform`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the resource to be annotated. -* `namespace` - (Optional) Namespace of the resource to be annotated. - ## Import -This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. - - +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/docs/resources/api_service.md b/docs/resources/api_service.md new file mode 100644 index 0000000000..cea787f6a8 --- /dev/null +++ b/docs/resources/api_service.md @@ -0,0 +1,101 @@ +--- +subcategory: "apiregistration/v1" +page_title: "Kubernetes: kubernetes_api_service" +description: |- + An API Service is an abstraction which defines for locating and communicating with servers. +--- + +# kubernetes_api_service + +An API Service is an abstraction which defines for locating and communicating with servers. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard api_service's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec contains information for locating and communicating with a server. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the api_service that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the api_service. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the api_service, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this api_service that can be used by clients to determine when api_service has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this api_service. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `group` (String) Group is the API group name this server hosts. +- `group_priority_minimum` (Number) GroupPriorityMinimum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMininum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s. +- `version` (String) Version is the API version this server hosts. For example, `v1`. +- `version_priority` (Number) VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is `kube-like`, it will sort above non `kube-like` version strings, which are ordered lexicographically. `Kube-like` versions start with a `v`, then are followed by a number (the major version), then optionally the string `alpha` or `beta` and another number (the minor version). These are sorted first by GA > `beta` > `alpha` (where GA is a version with no suffix such as `beta` or `alpha`), and then by comparing major version, then minor version. An example sorted list of versions: `v10`, `v2`, `v1`, `v11beta2`, `v10beta3`, `v3beta1`, `v12alpha1`, `v11alpha2`, `foo1`, `foo10`. + +Optional: + +- `ca_bundle` (String) CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used. +- `insecure_skip_tls_verify` (Boolean) InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead. +- `service` (Block List, Max: 1) Service is a reference to the service for this API server. It must communicate on port 443. If the Service is nil, that means the handling for the API groupversion is handled locally on this server. The call will simply delegate to the normal handler chain to be fulfilled. (see [below for nested schema](#nestedblock--spec--service)) + + +### Nested Schema for `spec.service` + +Required: + +- `name` (String) Name is the name of the service. +- `namespace` (String) Namespace is the namespace of the service. + +Optional: + +- `port` (Number) If specified, the port on the service that is hosting the service. Defaults to 443 for backward compatibility. Should be a valid port number (1-65535, inclusive). + + + + + +## Example Usage + +```terraform +resource "kubernetes_api_service" "example" { + metadata { + name = "terraform-example" + } + spec { + selector { + app = "${kubernetes_pod.example.metadata.0.labels.app}" + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "LoadBalancer" + } +} +``` + +## Import + +API service can be imported using its name, e.g. + +``` +$ terraform import kubernetes_api_service.example v1.terraform-name.k8s.io +``` diff --git a/docs/resources/api_service_v1.md b/docs/resources/api_service_v1.md new file mode 100644 index 0000000000..90079c1de2 --- /dev/null +++ b/docs/resources/api_service_v1.md @@ -0,0 +1,101 @@ +--- +subcategory: "apiregistration/v1" +page_title: "Kubernetes: kubernetes_api_service_v1" +description: |- + An API Service is an abstraction which defines for locating and communicating with servers. +--- + +# kubernetes_api_service_v1 + +An API Service is an abstraction which defines for locating and communicating with servers. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard api_service's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec contains information for locating and communicating with a server. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the api_service that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the api_service. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the api_service, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this api_service that can be used by clients to determine when api_service has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this api_service. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `group` (String) Group is the API group name this server hosts. +- `group_priority_minimum` (Number) GroupPriorityMinimum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMininum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s. +- `version` (String) Version is the API version this server hosts. For example, `v1`. +- `version_priority` (Number) VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is `kube-like`, it will sort above non `kube-like` version strings, which are ordered lexicographically. `Kube-like` versions start with a `v`, then are followed by a number (the major version), then optionally the string `alpha` or `beta` and another number (the minor version). These are sorted first by GA > `beta` > `alpha` (where GA is a version with no suffix such as `beta` or `alpha`), and then by comparing major version, then minor version. An example sorted list of versions: `v10`, `v2`, `v1`, `v11beta2`, `v10beta3`, `v3beta1`, `v12alpha1`, `v11alpha2`, `foo1`, `foo10`. + +Optional: + +- `ca_bundle` (String) CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used. +- `insecure_skip_tls_verify` (Boolean) InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead. +- `service` (Block List, Max: 1) Service is a reference to the service for this API server. It must communicate on port 443. If the Service is nil, that means the handling for the API groupversion is handled locally on this server. The call will simply delegate to the normal handler chain to be fulfilled. (see [below for nested schema](#nestedblock--spec--service)) + + +### Nested Schema for `spec.service` + +Required: + +- `name` (String) Name is the name of the service. +- `namespace` (String) Namespace is the namespace of the service. + +Optional: + +- `port` (Number) If specified, the port on the service that is hosting the service. Defaults to 443 for backward compatibility. Should be a valid port number (1-65535, inclusive). + + + + + +## Example Usage + +```terraform +resource "kubernetes_api_service_v1" "example" { + metadata { + name = "terraform-example" + } + spec { + selector { + app = "${kubernetes_pod.example.metadata.0.labels.app}" + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "LoadBalancer" + } +} +``` + +## Import + +API service can be imported using its name, e.g. + +``` +$ terraform import kubernetes_api_service_v1.example v1.terraform-name.k8s.io +``` diff --git a/docs/resources/certificate_signing_request.md b/docs/resources/certificate_signing_request.md new file mode 100644 index 0000000000..b52d3f38b3 --- /dev/null +++ b/docs/resources/certificate_signing_request.md @@ -0,0 +1,142 @@ +--- +subcategory: "certificates/v1beta1" +page_title: "Kubernetes: kubernetes_certificate_signing_request" +description: |- + Use this resource to generate TLS certificates using Kubernetes. +--- + +# kubernetes_certificate_signing_request + +Use this resource to generate TLS certificates using Kubernetes. This is a *logical resource*, so it contributes only to the current Terraform state and does not persist any external managed resources. This resource enables automation of [X.509](https://www.itu.int/rec/T-REC-X.509) credential provisioning (including TLS/SSL certificates). It does this by creating a CertificateSigningRequest using the Kubernetes API, which generates a certificate from the Certificate Authority (CA) configured in the Kubernetes cluster. The CSR can be approved automatically by Terraform, or it can be approved by a custom controller running in Kubernetes. See [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/) for all available options pertaining to CertificateSigningRequests. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard certificate signing request's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Describes a certificate signing request (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `auto_approve` (Boolean) Automatically approve the CertificateSigningRequest +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `certificate` (String) If request was approved, the controller will place the issued certificate here. +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the certificate signing request that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the certificate signing request. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the certificate signing request, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this certificate signing request that can be used by clients to determine when certificate signing request has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this certificate signing request. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `request` (String) Base64-encoded PKCS#10 CSR data + +Optional: + +- `signer_name` (String) Requested signer for the request. It is a qualified name in the form: `scope-hostname.io/name`.If empty, it will be defaulted: 1. If it's a kubelet client certificate, it is assigned `kubernetes.io/kube-apiserver-client-kubelet`.2. If it's a kubelet serving certificate, it is assigned `kubernetes.io/kubelet-serving`.3. Otherwise, it is assigned `kubernetes.io/legacy-unknown`. Distribution of trust for signers happens out of band.You can select on this field using `spec.signerName`. +- `usages` (Set of String) allowedUsages specifies a set of usage contexts the key will be valid for. See: + https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + https://tools.ietf.org/html/rfc5280#section-4.2.1.12 + +Valid values are: + "signing", + "digital signature", + "content commitment", + "key encipherment", + "key agreement", + "data encipherment", + "cert sign", + "crl sign", + "encipher only", + "decipher only", + "any", + "server auth", + "client auth", + "code signing", + "email protection", + "s/mime", + "ipsec end system", + "ipsec tunnel", + "ipsec user", + "timestamping", + "ocsp signing", + "microsoft sgc", + "netscape sgc" + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_certificate_signing_request" "example" { + metadata { + name = "example" + } + spec { + usages = ["client auth", "server auth"] + request = < +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard certificate signing request's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) CertificateSigningRequest objects provide a mechanism to obtain x509 certificates by submitting a certificate signing request, and having it asynchronously approved and issued. + +Kubelets use this API to obtain: + 1. client certificates to authenticate to kube-apiserver (with the "kubernetes.io/kube-apiserver-client-kubelet" signerName). + 2. serving certificates for TLS endpoints kube-apiserver can connect to securely (with the "kubernetes.io/kubelet-serving" signerName). + +This API can be used to request client certificates to authenticate to kube-apiserver (with the "kubernetes.io/kube-apiserver-client" signerName), or to obtain certificates from custom non-Kubernetes signers. (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `auto_approve` (Boolean) Automatically approve the CertificateSigningRequest +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `certificate` (String) certificate is populated with an issued certificate by the signer after an Approved condition is present. This field is set via the /status subresource. Once populated, this field is immutable. + +If the certificate signing request is denied, a condition of type "Denied" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type "Failed" is added and this field remains empty. + +Validation requirements: + 1. certificate must contain one or more PEM blocks. + 2. All PEM blocks must have the "CERTIFICATE" label, contain no headers, and the encoded data + must be a BER-encoded ASN.1 Certificate structure as described in section 4 of RFC5280. + 3. Non-PEM content may appear before or after the "CERTIFICATE" PEM blocks and is unvalidated, + to allow for explanatory text as described in section 5.2 of RFC7468. + +If more than one PEM block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. + +The certificate is encoded in PEM format. + +When serialized as JSON or YAML, the data is additionally base64-encoded, so it consists of: + + base64( +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the certificate signing request that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the certificate signing request. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the certificate signing request, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this certificate signing request that can be used by clients to determine when certificate signing request has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this certificate signing request. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `request` (String) request contains an x509 certificate signing request encoded in a "CERTIFICATE REQUEST" PEM block. When serialized as JSON or YAML, the data is additionally base64-encoded. +- `signer_name` (String) signerName indicates the requested signer, and is a qualified name. + +List/watch requests for CertificateSigningRequests can filter on this field using a "spec.signerName=NAME" fieldSelector. + +Well-known Kubernetes signers are: + 1. "kubernetes.io/kube-apiserver-client": issues client certificates that can be used to authenticate to kube-apiserver. + Requests for this signer are never auto-approved by kube-controller-manager, can be issued by the "csrsigning" controller in kube-controller-manager. + 2. "kubernetes.io/kube-apiserver-client-kubelet": issues client certificates that kubelets use to authenticate to kube-apiserver. + Requests for this signer can be auto-approved by the "csrapproving" controller in kube-controller-manager, and can be issued by the "csrsigning" controller in kube-controller-manager. + 3. "kubernetes.io/kubelet-serving" issues serving certificates that kubelets use to serve TLS endpoints, which kube-apiserver can connect to securely. + Requests for this signer are never auto-approved by kube-controller-manager, and can be issued by the "csrsigning" controller in kube-controller-manager. + +More details are available at https://k8s.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers + +Custom signerNames can also be specified. The signer defines: + 1. Trust distribution: how trust (CA bundles) are distributed. + 2. Permitted subjects: and behavior when a disallowed subject is requested. + 3. Required, permitted, or forbidden x509 extensions in the request (including whether subjectAltNames are allowed, which types, restrictions on allowed values) and behavior when a disallowed extension is requested. + 4. Required, permitted, or forbidden key usages / extended key usages. + 5. Expiration/certificate lifetime: whether it is fixed by the signer, configurable by the admin. + 6. Whether or not requests for CA certificates are allowed. + +Optional: + +- `usages` (Set of String) usages specifies a set of key usages requested in the issued certificate. + +Requests for TLS client certificates typically request: "digital signature", "key encipherment", "client auth". + +Requests for TLS serving certificates typically request: "key encipherment", "digital signature", "server auth". + +Valid values are: + "signing", "digital signature", "content commitment", + "key encipherment", "key agreement", "data encipherment", + "cert sign", "crl sign", "encipher only", "decipher only", "any", + "server auth", "client auth", + "code signing", "email protection", "s/mime", + "ipsec end system", "ipsec tunnel", "ipsec user", + "timestamping", "ocsp signing", "microsoft sgc", "netscape sgc" + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_certificate_signing_request_v1" "example" { + metadata { + name = "example" + } + spec { + usages = ["client auth", "server auth"] + signer_name = "kubernetes.io/kube-apiserver-client" + + request = < +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard clusterRole's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `aggregation_rule` (Block List, Max: 1) Describes how to build the Rules for this ClusterRole. (see [below for nested schema](#nestedblock--aggregation_rule)) +- `rule` (Block List) List of PolicyRules for this ClusterRole (see [below for nested schema](#nestedblock--rule)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the clusterRole that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the clusterRole. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the clusterRole, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this clusterRole that can be used by clients to determine when clusterRole has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this clusterRole. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `aggregation_rule` + +Optional: + +- `cluster_role_selectors` (Block List) A list of selectors which will be used to find ClusterRoles and create the rules. (see [below for nested schema](#nestedblock--aggregation_rule--cluster_role_selectors)) + + +### Nested Schema for `aggregation_rule.cluster_role_selectors` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--aggregation_rule--cluster_role_selectors--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `aggregation_rule.cluster_role_selectors.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `rule` + +Required: + +- `verbs` (List of String) Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + +Optional: + +- `api_groups` (List of String) APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. +- `non_resource_urls` (List of String) NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. +- `resource_names` (List of String) ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. +- `resources` (List of String) Resources is a list of resources this rule applies to. ResourceAll represents all resources. + + + + +## Example Usage + +```terraform +resource "kubernetes_cluster_role" "example" { + metadata { + name = "terraform-example" + } + + rule { + api_groups = [""] + resources = ["namespaces", "pods"] + verbs = ["get", "list", "watch"] + } +} +``` + +## Aggregation Rule Example Usage + +```terraform +resource "kubernetes_cluster_role" "example" { + metadata { + name = "terraform-example" + } + + aggregation_rule { + cluster_role_selectors { + match_labels = { + foo = "bar" + } + + match_expressions { + key = "environment" + operator = "In" + values = ["non-exists-12345"] + } + } + } +} +``` + +## Import + +ClusterRole can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role.example terraform-name +``` diff --git a/docs/resources/cluster_role_binding.md b/docs/resources/cluster_role_binding.md new file mode 100644 index 0000000000..b91ec2e7ce --- /dev/null +++ b/docs/resources/cluster_role_binding.md @@ -0,0 +1,104 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role_binding" +description: |- + A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. +--- + +# kubernetes_cluster_role_binding + +A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard clusterRoleBinding's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `role_ref` (Block List, Min: 1, Max: 1) RoleRef references the Cluster Role for this binding (see [below for nested schema](#nestedblock--role_ref)) +- `subject` (Block List, Min: 1) Subjects defines the entities to bind a ClusterRole to. (see [below for nested schema](#nestedblock--subject)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the clusterRoleBinding that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the clusterRoleBinding. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the clusterRoleBinding, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this clusterRoleBinding that can be used by clients to determine when clusterRoleBinding has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this clusterRoleBinding. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `role_ref` + +Required: + +- `api_group` (String) The API group of the user. The only value possible at the moment is `rbac.authorization.k8s.io`. +- `kind` (String) The kind of resource. +- `name` (String) The name of the User to bind to. + + + +### Nested Schema for `subject` + +Required: + +- `kind` (String) The kind of resource. +- `name` (String) The name of the resource to bind to. + +Optional: + +- `api_group` (String) The API group of the subject resource. +- `namespace` (String) The Namespace of the subject resource. + + + + +## Example Usage + +```terraform +resource "kubernetes_cluster_role_binding" "example" { + metadata { + name = "terraform-example" + } + role_ref { + api_group = "rbac.authorization.k8s.io" + kind = "ClusterRole" + name = "cluster-admin" + } + subject { + kind = "User" + name = "admin" + api_group = "rbac.authorization.k8s.io" + } + subject { + kind = "ServiceAccount" + name = "default" + namespace = "kube-system" + } + subject { + kind = "Group" + name = "system:masters" + api_group = "rbac.authorization.k8s.io" + } +} +``` + +## Import + +ClusterRoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role_binding.example terraform-name +``` diff --git a/docs/resources/cluster_role_binding_v1.md b/docs/resources/cluster_role_binding_v1.md new file mode 100644 index 0000000000..43d065d73b --- /dev/null +++ b/docs/resources/cluster_role_binding_v1.md @@ -0,0 +1,104 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role_binding_v1" +description: |- + A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. +--- + +# kubernetes_cluster_role_binding_v1 + +A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard clusterRoleBinding's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `role_ref` (Block List, Min: 1, Max: 1) RoleRef references the Cluster Role for this binding (see [below for nested schema](#nestedblock--role_ref)) +- `subject` (Block List, Min: 1) Subjects defines the entities to bind a ClusterRole to. (see [below for nested schema](#nestedblock--subject)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the clusterRoleBinding that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the clusterRoleBinding. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the clusterRoleBinding, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this clusterRoleBinding that can be used by clients to determine when clusterRoleBinding has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this clusterRoleBinding. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `role_ref` + +Required: + +- `api_group` (String) The API group of the user. The only value possible at the moment is `rbac.authorization.k8s.io`. +- `kind` (String) The kind of resource. +- `name` (String) The name of the User to bind to. + + + +### Nested Schema for `subject` + +Required: + +- `kind` (String) The kind of resource. +- `name` (String) The name of the resource to bind to. + +Optional: + +- `api_group` (String) The API group of the subject resource. +- `namespace` (String) The Namespace of the subject resource. + + + + +## Example Usage + +```terraform +resource "kubernetes_cluster_role_binding_v1" "example" { + metadata { + name = "terraform-example" + } + role_ref { + api_group = "rbac.authorization.k8s.io" + kind = "ClusterRole" + name = "cluster-admin" + } + subject { + kind = "User" + name = "admin" + api_group = "rbac.authorization.k8s.io" + } + subject { + kind = "ServiceAccount" + name = "default" + namespace = "kube-system" + } + subject { + kind = "Group" + name = "system:masters" + api_group = "rbac.authorization.k8s.io" + } +} +``` + +## Import + +ClusterRoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role_binding_v1.example terraform-name +``` diff --git a/docs/resources/cluster_role_v1.md b/docs/resources/cluster_role_v1.md new file mode 100644 index 0000000000..80229ddc51 --- /dev/null +++ b/docs/resources/cluster_role_v1.md @@ -0,0 +1,135 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role_v1" +description: |- + A ClusterRole creates a role at the cluster level and in all namespaces. +--- + +# kubernetes_cluster_role_v1 + +A ClusterRole creates a role at the cluster level and in all namespaces. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard clusterRole's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `aggregation_rule` (Block List, Max: 1) Describes how to build the Rules for this ClusterRole. (see [below for nested schema](#nestedblock--aggregation_rule)) +- `rule` (Block List) List of PolicyRules for this ClusterRole (see [below for nested schema](#nestedblock--rule)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the clusterRole that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the clusterRole. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the clusterRole, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this clusterRole that can be used by clients to determine when clusterRole has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this clusterRole. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `aggregation_rule` + +Optional: + +- `cluster_role_selectors` (Block List) A list of selectors which will be used to find ClusterRoles and create the rules. (see [below for nested schema](#nestedblock--aggregation_rule--cluster_role_selectors)) + + +### Nested Schema for `aggregation_rule.cluster_role_selectors` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--aggregation_rule--cluster_role_selectors--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `aggregation_rule.cluster_role_selectors.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `rule` + +Required: + +- `verbs` (List of String) Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + +Optional: + +- `api_groups` (List of String) APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. +- `non_resource_urls` (List of String) NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. +- `resource_names` (List of String) ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. +- `resources` (List of String) Resources is a list of resources this rule applies to. ResourceAll represents all resources. + + + + +## Example Usage + +```terraform +resource "kubernetes_cluster_role_v1" "example" { + metadata { + name = "terraform-example" + } + + rule { + api_groups = [""] + resources = ["namespaces", "pods"] + verbs = ["get", "list", "watch"] + } +} +``` + +## Aggregation Rule Example Usage + +```terraform +resource "kubernetes_cluster_role_v1" "example" { + metadata { + name = "terraform-example" + } + + aggregation_rule { + cluster_role_selectors { + match_labels = { + foo = "bar" + } + + match_expressions { + key = "environment" + operator = "In" + values = ["non-exists-12345"] + } + } + } +} +``` + +## Import + +ClusterRole can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role_v1.example terraform-name +``` diff --git a/docs/resources/config_map.md b/docs/resources/config_map.md new file mode 100644 index 0000000000..33331975de --- /dev/null +++ b/docs/resources/config_map.md @@ -0,0 +1,75 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map" +description: |- + The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. +--- + +# kubernetes_config_map + +The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard config map's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `binary_data` (Map of String) BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. This field only accepts base64-encoded payloads that will be decoded/encoded before being sent/received to/from the apiserver. +- `data` (Map of String) Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process. +- `immutable` (Boolean) Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the config map that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the config map. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the config map, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the config map must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this config map. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +## Example Usage + +```terraform +resource "kubernetes_config_map" "example" { + metadata { + name = "my-config" + } + + data = { + api_host = "myhost:443" + db_host = "dbhost:5432" + "my_config_file.yml" = "${file("${path.module}/my_config_file.yml")}" + } + + binary_data = { + "my_payload.bin" = "${filebase64("${path.module}/my_payload.bin")}" + } +} +``` + +## Import + +Config Map can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_config_map.example default/my-config +``` diff --git a/docs/resources/config_map_v1.md b/docs/resources/config_map_v1.md new file mode 100644 index 0000000000..1395cd740d --- /dev/null +++ b/docs/resources/config_map_v1.md @@ -0,0 +1,75 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map_v1" +description: |- + The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. +--- + +# kubernetes_config_map_v1 + +The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard config map's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `binary_data` (Map of String) BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. This field only accepts base64-encoded payloads that will be decoded/encoded before being sent/received to/from the apiserver. +- `data` (Map of String) Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process. +- `immutable` (Boolean) Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the config map that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the config map. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the config map, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the config map must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this config map. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +## Example Usage + +```terraform +resource "kubernetes_config_map_v1" "example" { + metadata { + name = "my-config" + } + + data = { + api_host = "myhost:443" + db_host = "dbhost:5432" + "my_config_file.yml" = "${file("${path.module}/my_config_file.yml")}" + } + + binary_data = { + "my_payload.bin" = "${filebase64("${path.module}/my_payload.bin")}" + } +} +``` + +## Import + +Config Map can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_config_map_v1.example default/my-config +``` diff --git a/website/docs/r/config_map_v1_data.html.markdown b/docs/resources/config_map_v1_data.md similarity index 60% rename from website/docs/r/config_map_v1_data.html.markdown rename to docs/resources/config_map_v1_data.md index 2fa32110b5..6b21810e79 100644 --- a/website/docs/r/config_map_v1_data.html.markdown +++ b/docs/resources/config_map_v1_data.md @@ -1,6 +1,5 @@ --- subcategory: "core/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_config_map_v1_data" description: |- This resource allows Terraform to manage the data for a ConfigMap that already exists @@ -8,12 +7,42 @@ description: |- # kubernetes_config_map_v1_data -This resource allows Terraform to manage data within a pre-existing ConfigMap. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the data that is defined in the Terraform configuration. Existing data not specified in the configuration will be ignored. If data specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true. +This resource allows Terraform to manage data within a pre-existing ConfigMap. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the data that is defined in the Terraform configuration. Existing data not specified in the configuration will be ignored. If data specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true. + + +## Schema + +### Required + +- `data` (Map of String) The data we want to add to the ConfigMap. +- `metadata` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `field_manager` (String) Set the name of the field manager for the specified labels. +- `force` (Boolean) Force overwriting data that is managed outside of Terraform. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Required: + +- `name` (String) The name of the ConfigMap. + +Optional: + +- `namespace` (String) The namespace of the ConfigMap. + + ## Example Usage -```hcl +```terraform resource "kubernetes_config_map_v1_data" "example" { metadata { name = "my-config" @@ -24,26 +53,6 @@ resource "kubernetes_config_map_v1_data" "example" { } ``` -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard metadata of the ConfigMap. -* `data` - (Required) A map of data to apply to the ConfigMap. -* `force` - (Optional) Force management of the configured data if there is a conflict. -* `field_manager` - (Optional) The name of the [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management). Defaults to `Terraform`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the ConfigMap. -* `namespace` - (Optional) Namespace of the ConfigMap. - ## Import -This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. - - +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/docs/resources/cron_job.md b/docs/resources/cron_job.md new file mode 100644 index 0000000000..16679f7dd6 --- /dev/null +++ b/docs/resources/cron_job.md @@ -0,0 +1,2372 @@ +--- +subcategory: "batch/v1beta1" +page_title: "Kubernetes: kubernetes_cron_job" +description: |- + A Cron Job creates Jobs on a time-based schedule. One CronJob object is like one line of a crontab (cron table) file. +--- + +# kubernetes_cron_job + +A Cron Job creates Jobs on a time-based schedule. + +One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format. + +Note: All CronJob `schedule` times are based on the timezone of the master where the job is initiated. For instructions on creating and working with cron jobs, and for an example of a spec file for a cron job, see [Kubernetes reference](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/). + +~> NOTE: With the release of Kubernetes v1.25, CronJob batch/v1beta1 has been removed. You can read more information about migrating to batch/v1 in the [Kubernetes 1.25 migration guide](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#cronjob-v125). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard cronjob's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec of the cron job owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the cronjob that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the cronjob. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the cronjob, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the cronjob must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this cronjob that can be used by clients to determine when cronjob has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this cronjob. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `job_template` (Block List, Min: 1, Max: 1) Describes the pod that will be created when executing a cron job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--job_template)) +- `schedule` (String) Cron format string, e.g. 0 * * * * or @hourly, as schedule time of its jobs to be created and executed. + +Optional: + +- `concurrency_policy` (String) Specifies how to treat concurrent executions of a Job. Defaults to Allow. +- `failed_jobs_history_limit` (Number) The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. +- `starting_deadline_seconds` (Number) Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. +- `successful_jobs_history_limit` (Number) The number of successful finished jobs to retain. Defaults to 3. +- `suspend` (Boolean) This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. + + +### Nested Schema for `spec.job_template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard jobTemplateSpec's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--job_template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Specification of the desired behavior of the job (see [below for nested schema](#nestedblock--spec--job_template--spec)) + + +### Nested Schema for `spec.job_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the jobTemplateSpec that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the jobTemplateSpec. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the jobTemplateSpec, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the jobTemplateSpec must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this jobTemplateSpec that can be used by clients to determine when jobTemplateSpec has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this jobTemplateSpec. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.job_template.spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template)) + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `backoff_limit` (Number) Specifies the number of retries before marking this job failed. Defaults to 6 +- `completion_mode` (String) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode +- `completions` (Number) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `manual_selector` (Boolean) Controls generation of pod labels and pod selectors. Leave unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. More info: https://git.k8s.io/community/contributors/design-proposals/selector-generation.md +- `parallelism` (Number) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `pod_failure_policy` (Block List, Max: 1) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy)) +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--job_template--spec--selector)) +- `ttl_seconds_after_finished` (String) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. + + +### Nested Schema for `spec.job_template.spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard job's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--job_template--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the job (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec)) + + +### Nested Schema for `spec.job_template.spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the job that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the job, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this job. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.job_template.spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.job_template.spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.job_template.spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.job_template.spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.job_template.spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.job_template.spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.job_template.spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy` + +Required: + +- `rule` (Block List, Min: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy--rule)) + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy.rule` + +Optional: + +- `action` (String) +- `on_exit_codes` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy--rule--on_exit_codes)) +- `on_pod_condition` (Block List) (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy--rule--on_pod_condition)) + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy.rule.on_exit_codes` + +Required: + +- `values` (List of Number) + +Optional: + +- `container_name` (String) +- `operator` (String) + + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy.rule.on_pod_condition` + +Optional: + +- `status` (String) +- `type` (String) + + + + + +### Nested Schema for `spec.job_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `delete` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_cron_job" "demo" { + metadata { + name = "demo" + } + spec { + concurrency_policy = "Replace" + failed_jobs_history_limit = 5 + schedule = "1 0 * * *" + starting_deadline_seconds = 10 + successful_jobs_history_limit = 10 + job_template { + metadata {} + spec { + backoff_limit = 2 + ttl_seconds_after_finished = 10 + template { + metadata {} + spec { + container { + name = "hello" + image = "busybox" + command = ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"] + } + } + } + } + } + } +} +``` + + +## Import + +``` +$ terraform import kubernetes_cron_job_v1/example default/example +``` \ No newline at end of file diff --git a/docs/resources/cron_job_v1.md b/docs/resources/cron_job_v1.md new file mode 100644 index 0000000000..0f6f6662e6 --- /dev/null +++ b/docs/resources/cron_job_v1.md @@ -0,0 +1,2361 @@ +--- +subcategory: "batch/v1" +page_title: "Kubernetes: kubernetes_cron_job_v1" +description: |- + A Cron Job creates Jobs on a time-based schedule. One CronJob object is like one line of a crontab (cron table) file. +--- + +# kubernetes_cron_job_v1 + +A Cron Job creates Jobs on a time-based schedule.One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format.Note: All CronJob `schedule` times are based on the timezone of the master where the job is initiated. For instructions on creating and working with cron jobs, and for an example of a spec file for a cron job, see [Kubernetes reference](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard cronjob's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec of the cron job owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the cronjob that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the cronjob. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the cronjob, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the cronjob must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this cronjob that can be used by clients to determine when cronjob has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this cronjob. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `job_template` (Block List, Min: 1, Max: 1) Describes the pod that will be created when executing a cron job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--job_template)) +- `schedule` (String) Cron format string, e.g. 0 * * * * or @hourly, as schedule time of its jobs to be created and executed. + +Optional: + +- `concurrency_policy` (String) Specifies how to treat concurrent executions of a Job. Defaults to Allow. +- `failed_jobs_history_limit` (Number) The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. +- `starting_deadline_seconds` (Number) Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. +- `successful_jobs_history_limit` (Number) The number of successful finished jobs to retain. Defaults to 3. +- `suspend` (Boolean) This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. +- `timezone` (String) The time zone for the given schedule. If not specified, this will rely on the time zone of the kube-controller-manager process. + + +### Nested Schema for `spec.job_template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard jobTemplateSpec's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--job_template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Specification of the desired behavior of the job (see [below for nested schema](#nestedblock--spec--job_template--spec)) + + +### Nested Schema for `spec.job_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the jobTemplateSpec that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the jobTemplateSpec. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the jobTemplateSpec, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the jobTemplateSpec must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this jobTemplateSpec that can be used by clients to determine when jobTemplateSpec has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this jobTemplateSpec. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.job_template.spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template)) + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `backoff_limit` (Number) Specifies the number of retries before marking this job failed. Defaults to 6 +- `completion_mode` (String) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode +- `completions` (Number) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `manual_selector` (Boolean) Controls generation of pod labels and pod selectors. Leave unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. More info: https://git.k8s.io/community/contributors/design-proposals/selector-generation.md +- `parallelism` (Number) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `pod_failure_policy` (Block List, Max: 1) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy)) +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--job_template--spec--selector)) +- `ttl_seconds_after_finished` (String) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. + + +### Nested Schema for `spec.job_template.spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard job's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--job_template--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the job (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec)) + + +### Nested Schema for `spec.job_template.spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the job that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the job, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this job. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.job_template.spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.job_template.spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.job_template.spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.job_template.spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.job_template.spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.job_template.spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.job_template.spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.job_template.spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--job_template--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.job_template.spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy` + +Required: + +- `rule` (Block List, Min: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy--rule)) + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy.rule` + +Optional: + +- `action` (String) +- `on_exit_codes` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy--rule--on_exit_codes)) +- `on_pod_condition` (Block List) (see [below for nested schema](#nestedblock--spec--job_template--spec--pod_failure_policy--rule--on_pod_condition)) + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy.rule.on_exit_codes` + +Required: + +- `values` (List of Number) + +Optional: + +- `container_name` (String) +- `operator` (String) + + + +### Nested Schema for `spec.job_template.spec.pod_failure_policy.rule.on_pod_condition` + +Optional: + +- `status` (String) +- `type` (String) + + + + + +### Nested Schema for `spec.job_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--job_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.job_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `delete` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_cron_job_v1" "demo" { + metadata { + name = "demo" + } + spec { + concurrency_policy = "Replace" + failed_jobs_history_limit = 5 + schedule = "1 0 * * *" + timezone = "Etc/UTC" + starting_deadline_seconds = 10 + successful_jobs_history_limit = 10 + job_template { + metadata {} + spec { + backoff_limit = 2 + ttl_seconds_after_finished = 10 + template { + metadata {} + spec { + container { + name = "hello" + image = "busybox" + command = ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"] + } + } + } + } + } + } +} +``` diff --git a/docs/resources/csi_driver.md b/docs/resources/csi_driver.md new file mode 100644 index 0000000000..f7eb1a771c --- /dev/null +++ b/docs/resources/csi_driver.md @@ -0,0 +1,81 @@ +--- +subcategory: "storage/v1beta1" +page_title: "Kubernetes: kubernetes_csi_driver" +description: |- + The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. +--- + +# kubernetes_csi_driver + +The [Container Storage Interface](https://kubernetes-csi.github.io/docs/introduction.html) (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard csi driver's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) Spec of the CSIDriver (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the csi driver that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the csi driver. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the csi driver, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this csi driver that can be used by clients to determine when csi driver has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this csi driver. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `attach_required` (Boolean) Indicates if the CSI volume driver requires an attach operation + +Optional: + +- `pod_info_on_mount` (Boolean) Indicates that the CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations +- `volume_lifecycle_modes` (List of String) Defines what kind of volumes this CSI volume driver supports + + + + +## Example Usage + +```terraform +resource "kubernetes_csi_driver" "example" { + metadata { + name = "terraform-example" + } + + spec { + attach_required = true + pod_info_on_mount = true + volume_lifecycle_modes = ["Ephemeral"] + } +} +``` + +## Import + +kubernetes_csi_driver can be imported using its name, e.g. + +``` +$ terraform import kubernetes_csi_driver.example terraform-example +``` diff --git a/docs/resources/csi_driver_v1.md b/docs/resources/csi_driver_v1.md new file mode 100644 index 0000000000..6d80a5c56e --- /dev/null +++ b/docs/resources/csi_driver_v1.md @@ -0,0 +1,81 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_csi_driver_v1" +description: |- + The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. +--- + +# kubernetes_csi_driver_v1 + +The [Container Storage Interface](https://kubernetes-csi.github.io/docs/introduction.html) (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard csi driver's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) Spec of the CSIDriver (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the csi driver that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the csi driver. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the csi driver, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this csi driver that can be used by clients to determine when csi driver has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this csi driver. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `attach_required` (Boolean) Indicates if the CSI volume driver requires an attach operation + +Optional: + +- `pod_info_on_mount` (Boolean) Indicates that the CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations +- `volume_lifecycle_modes` (List of String) Defines what kind of volumes this CSI volume driver supports + + + + +## Example Usage + +```terraform +resource "kubernetes_csi_driver_v1" "example" { + metadata { + name = "terraform-example" + } + + spec { + attach_required = true + pod_info_on_mount = true + volume_lifecycle_modes = ["Ephemeral"] + } +} +``` + +## Import + +kubernetes_csi_driver_v1 can be imported using its name, e.g. + +``` +$ terraform import kubernetes_csi_driver_v1.example terraform-example +``` diff --git a/docs/resources/daemon_set_v1.md b/docs/resources/daemon_set_v1.md new file mode 100644 index 0000000000..360ade82fb --- /dev/null +++ b/docs/resources/daemon_set_v1.md @@ -0,0 +1,2329 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_daemon_set_v1" +description: |- + A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. +--- + +# kubernetes_daemon_set_v1 + +A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard daemonset's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the daemonset. More info: https://v1-9.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#daemonset-v1-apps (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_rollout` (Boolean) Wait for the rollout of the deployment to complete. Defaults to true. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the daemonset that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the daemonset. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the daemonset, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the daemonset must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this daemonset that can be used by clients to determine when daemonset has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this daemonset. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#pod-template (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `min_ready_seconds` (Number) 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) +- `revision_history_limit` (Number) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. +- `selector` (Block List, Max: 1) A label query over pods that are managed by the DaemonSet. (see [below for nested schema](#nestedblock--spec--selector)) +- `strategy` (Block List, Max: 1) The deployment strategy used to replace existing pods with new ones. (see [below for nested schema](#nestedblock--spec--strategy)) + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard daemon set's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the daemon set (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the daemon set that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the daemon set. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the daemon set, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the daemon set must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this daemon set that can be used by clients to determine when daemon set has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this daemon set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.strategy` + +Optional: + +- `rolling_update` (Block List, Max: 1) Rolling update config params. Present only if type = 'RollingUpdate'. (see [below for nested schema](#nestedblock--spec--strategy--rolling_update)) +- `type` (String) Type of deployment. Can be 'RollingUpdate' or 'OnDelete'. Default is RollingUpdate. + + +### Nested Schema for `spec.strategy.rolling_update` + +Optional: + +- `max_unavailable` (String) The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_daemon_set_v1" "example" { + metadata { + name = "terraform-example" + namespace = "something" + labels = { + test = "MyExampleApp" + } + } + + spec { + selector { + match_labels = { + test = "MyExampleApp" + } + } + + template { + metadata { + labels = { + test = "MyExampleApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + } + requests = { + cpu = "250m" + memory = "50Mi" + } + } + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + + } + } + } + } +} +``` + +## Import + +DaemonSet can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_daemon_set_v1.example default/terraform-example +``` diff --git a/docs/resources/daemonset.md b/docs/resources/daemonset.md new file mode 100644 index 0000000000..8de79f5301 --- /dev/null +++ b/docs/resources/daemonset.md @@ -0,0 +1,2329 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_daemonset" +description: |- + A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. +--- + +# kubernetes_daemonset + +A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard daemonset's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the daemonset. More info: https://v1-9.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#daemonset-v1-apps (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_rollout` (Boolean) Wait for the rollout of the deployment to complete. Defaults to true. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the daemonset that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the daemonset. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the daemonset, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the daemonset must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this daemonset that can be used by clients to determine when daemonset has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this daemonset. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#pod-template (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `min_ready_seconds` (Number) 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) +- `revision_history_limit` (Number) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. +- `selector` (Block List, Max: 1) A label query over pods that are managed by the DaemonSet. (see [below for nested schema](#nestedblock--spec--selector)) +- `strategy` (Block List, Max: 1) The deployment strategy used to replace existing pods with new ones. (see [below for nested schema](#nestedblock--spec--strategy)) + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard daemon set's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the daemon set (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the daemon set that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the daemon set. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the daemon set, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the daemon set must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this daemon set that can be used by clients to determine when daemon set has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this daemon set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.strategy` + +Optional: + +- `rolling_update` (Block List, Max: 1) Rolling update config params. Present only if type = 'RollingUpdate'. (see [below for nested schema](#nestedblock--spec--strategy--rolling_update)) +- `type` (String) Type of deployment. Can be 'RollingUpdate' or 'OnDelete'. Default is RollingUpdate. + + +### Nested Schema for `spec.strategy.rolling_update` + +Optional: + +- `max_unavailable` (String) The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_daemonset" "example" { + metadata { + name = "terraform-example" + namespace = "something" + labels = { + test = "MyExampleApp" + } + } + + spec { + selector { + match_labels = { + test = "MyExampleApp" + } + } + + template { + metadata { + labels = { + test = "MyExampleApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + } + requests = { + cpu = "250m" + memory = "50Mi" + } + } + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + + } + } + } + } +} +``` + +## Import + +DaemonSet can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_daemonset.example default/terraform-example +``` diff --git a/docs/resources/default_service_account.md b/docs/resources/default_service_account.md new file mode 100644 index 0000000000..7188692041 --- /dev/null +++ b/docs/resources/default_service_account.md @@ -0,0 +1,101 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_default_service_account" +description: |- + The default service account resource configures the default service account created by Kubernetes in each namespace. +--- + +# kubernetes_default_service_account + +Kubernetes creates a "default" service account in each namespace. This is the service account that will be assigned by default to pods in the namespace. + +The `kubernetes_default_service_account` resource behaves differently from normal resources. The service account is created by a Kubernetes controller and Terraform "adopts" it into management. This resource should only be used once per namespace. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service account's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `automount_service_account_token` (Boolean) Enable automatic mounting of the service account token +- `image_pull_secret` (Block Set) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod (see [below for nested schema](#nestedblock--image_pull_secret)) +- `secret` (Block Set) A list of secrets allowed to be used by pods running using this Service Account. More info: https://kubernetes.io/docs/concepts/configuration/secret (see [below for nested schema](#nestedblock--secret)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `default_secret_name` (String, Deprecated) +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service account, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service account must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service account. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `image_pull_secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_default_service_account" "example" { + metadata { + namespace = "terraform-example" + } + secret { + name = "${kubernetes_secret.example.metadata.0.name}" + } +} + +resource "kubernetes_secret" "example" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +The default service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_default_service_account.example terraform-example/default +``` diff --git a/docs/resources/default_service_account_v1.md b/docs/resources/default_service_account_v1.md new file mode 100644 index 0000000000..e79bb4d70a --- /dev/null +++ b/docs/resources/default_service_account_v1.md @@ -0,0 +1,101 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_default_service_account_v1" +description: |- + The default service account resource configures the default service account created by Kubernetes in each namespace. +--- + +# kubernetes_default_service_account_v1 + +Kubernetes creates a "default" service account in each namespace. This is the service account that will be assigned by default to pods in the namespace. + +The `kubernetes_default_service_account_v1` resource behaves differently from normal resources. The service account is created by a Kubernetes controller and Terraform "adopts" it into management. This resource should only be used once per namespace. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service account's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `automount_service_account_token` (Boolean) Enable automatic mounting of the service account token +- `image_pull_secret` (Block Set) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod (see [below for nested schema](#nestedblock--image_pull_secret)) +- `secret` (Block Set) A list of secrets allowed to be used by pods running using this Service Account. More info: https://kubernetes.io/docs/concepts/configuration/secret (see [below for nested schema](#nestedblock--secret)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `default_secret_name` (String, Deprecated) +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service account, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service account must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service account. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `image_pull_secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_default_service_account_v1" "example" { + metadata { + namespace = "terraform-example" + } + secret { + name = "${kubernetes_secret_v1.example.metadata.0.name}" + } +} + +resource "kubernetes_secret_v1" "example" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +The default service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_default_service_account_v1.example terraform-example/default +``` diff --git a/docs/resources/deployment.md b/docs/resources/deployment.md new file mode 100644 index 0000000000..f6ff5e1905 --- /dev/null +++ b/docs/resources/deployment.md @@ -0,0 +1,2330 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_deployment" +description: |- + A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. +--- + +# kubernetes_deployment + +A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard deployment's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the deployment. More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#deployment-v1-apps (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_rollout` (Boolean) Wait for the rollout of the deployment to complete. Defaults to true. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the deployment. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the deployment, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the deployment must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this deployment. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) Template describes the pods that will be created. (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `min_ready_seconds` (Number) 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) +- `paused` (Boolean) Indicates that the deployment is paused. +- `progress_deadline_seconds` (Number) The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. +- `replicas` (String) Number of desired pods. This is a string to be able to distinguish between explicit zero and not specified. +- `revision_history_limit` (Number) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. +- `selector` (Block List, Max: 1) A label query over pods that should match the Replicas count. (see [below for nested schema](#nestedblock--spec--selector)) +- `strategy` (Block List, Max: 1) The deployment strategy to use to replace existing pods with new ones. (see [below for nested schema](#nestedblock--spec--strategy)) + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the deployment. More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#deployment-v1-apps (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.strategy` + +Optional: + +- `rolling_update` (Block List, Max: 1) Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate. (see [below for nested schema](#nestedblock--spec--strategy--rolling_update)) +- `type` (String) Type of deployment. Can be 'Recreate' or 'RollingUpdate'. Default is RollingUpdate. + + +### Nested Schema for `spec.strategy.rolling_update` + +Optional: + +- `max_surge` (String) The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods. +- `max_unavailable` (String) The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_deployment" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyExampleApp" + } + } + + spec { + replicas = 3 + + selector { + match_labels = { + test = "MyExampleApp" + } + } + + template { + metadata { + labels = { + test = "MyExampleApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + } + requests = { + cpu = "250m" + memory = "50Mi" + } + } + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + } + } + } + } +} +``` + +## Import + +Deployment can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_deployment.example default/terraform-example +``` diff --git a/docs/resources/deployment_v1.md b/docs/resources/deployment_v1.md new file mode 100644 index 0000000000..fbff60a8ef --- /dev/null +++ b/docs/resources/deployment_v1.md @@ -0,0 +1,2330 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_deployment_v1" +description: |- + A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. +--- + +# kubernetes_deployment_v1 + +A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard deployment's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the deployment. More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#deployment-v1-apps (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_rollout` (Boolean) Wait for the rollout of the deployment to complete. Defaults to true. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the deployment. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the deployment, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the deployment must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this deployment. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) Template describes the pods that will be created. (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `min_ready_seconds` (Number) 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) +- `paused` (Boolean) Indicates that the deployment is paused. +- `progress_deadline_seconds` (Number) The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. +- `replicas` (String) Number of desired pods. This is a string to be able to distinguish between explicit zero and not specified. +- `revision_history_limit` (Number) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. +- `selector` (Block List, Max: 1) A label query over pods that should match the Replicas count. (see [below for nested schema](#nestedblock--spec--selector)) +- `strategy` (Block List, Max: 1) The deployment strategy to use to replace existing pods with new ones. (see [below for nested schema](#nestedblock--spec--strategy)) + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the deployment. More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#deployment-v1-apps (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.strategy` + +Optional: + +- `rolling_update` (Block List, Max: 1) Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate. (see [below for nested schema](#nestedblock--spec--strategy--rolling_update)) +- `type` (String) Type of deployment. Can be 'Recreate' or 'RollingUpdate'. Default is RollingUpdate. + + +### Nested Schema for `spec.strategy.rolling_update` + +Optional: + +- `max_surge` (String) The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods. +- `max_unavailable` (String) The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_deployment_v1" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyExampleApp" + } + } + + spec { + replicas = 3 + + selector { + match_labels = { + test = "MyExampleApp" + } + } + + template { + metadata { + labels = { + test = "MyExampleApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + } + requests = { + cpu = "250m" + memory = "50Mi" + } + } + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + } + } + } + } +} +``` + +## Import + +Deployment can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_deployment_v1.example default/terraform-example +``` diff --git a/docs/resources/endpoint_slice_v1.md b/docs/resources/endpoint_slice_v1.md new file mode 100644 index 0000000000..06fa1b5d42 --- /dev/null +++ b/docs/resources/endpoint_slice_v1.md @@ -0,0 +1,124 @@ +--- +subcategory: "discovery/v1" +page_title: "Kubernetes: kubernetes_endpoint_slice_v1" +description: |- + An EndpointSlice contains references to a set of network endpoints. +--- + +# kubernetes_endpoint_slice_v1 + +An EndpointSlice contains references to a set of network endpoints. + + +## Schema + +### Required + +- `address_type` (String) address_type specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. +- `endpoint` (Block List, Min: 1, Max: 1000) endpoint is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. (see [below for nested schema](#nestedblock--endpoint)) +- `metadata` (Block List, Min: 1, Max: 1) Standard endpoint_slice's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `port` (Block List, Min: 1, Max: 100) port specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. (see [below for nested schema](#nestedblock--port)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `endpoint` + +Required: + +- `addresses` (List of String) addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. + +Optional: + +- `condition` (Block List, Max: 1) condition contains information about the current status of the endpoint. (see [below for nested schema](#nestedblock--endpoint--condition)) +- `hostname` (String) hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other. +- `node_name` (String) nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node. +- `target_ref` (Block List, Max: 1) targetRef is a reference to a Kubernetes object that represents this endpoint. (see [below for nested schema](#nestedblock--endpoint--target_ref)) +- `zone` (String) zone is the name of the Zone this endpoint exists in. + + +### Nested Schema for `endpoint.condition` + +Optional: + +- `ready` (Boolean) ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. +- `serving` (Boolean) serving is identical to ready except that it is set regardless of the terminating state of endpoints. +- `terminating` (Boolean) terminating indicates that this endpoint is terminating. + + + +### Nested Schema for `endpoint.target_ref` + +Required: + +- `name` (String) Name of the referent. + +Optional: + +- `field_path` (String) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. +- `namespace` (String) Namespace of the referent. +- `resource_version` (String) Specific resourceVersion to which this reference is made, if any. +- `uid` (String) If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + + + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the endpoint_slice that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoint_slice. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the endpoint_slice, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the endpoint_slice must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this endpoint_slice that can be used by clients to determine when endpoint_slice has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this endpoint_slice. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `port` + +Required: + +- `app_protocol` (String) The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. +- `port` (String) port represents the port number of the endpoint. + +Optional: + +- `name` (String) name represents the name of this port. All ports in an EndpointSlice must have a unique name. +- `protocol` (String) protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. + + + + +## Example Usage + +```terraform +resource "kubernetes_endpoint_slice_v1" "test" { + metadata { + name = "test" + } + + endpoint { + condition { + ready = true + } + addresses = ["129.144.50.56"] + } + + port { + port = "9000" + name = "first" + } + + address_type = "IPv4" +} +``` + diff --git a/docs/resources/endpoints.md b/docs/resources/endpoints.md new file mode 100644 index 0000000000..2e293d9034 --- /dev/null +++ b/docs/resources/endpoints.md @@ -0,0 +1,174 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_endpoints" +description: |- + An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. +--- + +# kubernetes_endpoints + +An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard endpoints's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `subset` (Block Set) Set of addresses and ports that comprise a service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors (see [below for nested schema](#nestedblock--subset)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the endpoints that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoints. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the endpoints, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the endpoints must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this endpoints that can be used by clients to determine when endpoints has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this endpoints. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `subset` + +Optional: + +- `address` (Block Set) IP address which offers the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize. (see [below for nested schema](#nestedblock--subset--address)) +- `not_ready_address` (Block Set) IP address which offers the related ports but is not currently marked as ready because it have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check. (see [below for nested schema](#nestedblock--subset--not_ready_address)) +- `port` (Block Set) Port number available on the related IP addresses. (see [below for nested schema](#nestedblock--subset--port)) + + +### Nested Schema for `subset.address` + +Required: + +- `ip` (String) The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). + +Optional: + +- `hostname` (String) The Hostname of this endpoint. +- `node_name` (String) Node hosting this endpoint. This can be used to determine endpoints local to a node. + + + +### Nested Schema for `subset.not_ready_address` + +Required: + +- `ip` (String) The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). + +Optional: + +- `hostname` (String) The Hostname of this endpoint. +- `node_name` (String) Node hosting this endpoint. This can be used to determine endpoints local to a node. + + + +### Nested Schema for `subset.port` + +Required: + +- `port` (Number) The port that will be exposed by this endpoint. + +Optional: + +- `name` (String) The name of this port within the endpoint. Must be a DNS_LABEL. Optional if only one Port is defined on this endpoint. +- `protocol` (String) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. + + + + + +## Example Usage + +```terraform +resource "kubernetes_endpoints" "example" { + metadata { + name = "terraform-example" + } + + subset { + address { + ip = "10.0.0.4" + } + + address { + ip = "10.0.0.5" + } + + port { + name = "http" + port = 80 + protocol = "TCP" + } + + port { + name = "https" + port = 443 + protocol = "TCP" + } + } + + subset { + address { + ip = "10.0.1.4" + } + + address { + ip = "10.0.1.5" + } + + port { + name = "http" + port = 80 + protocol = "TCP" + } + + port { + name = "https" + port = 443 + protocol = "TCP" + } + } +} + +resource "kubernetes_service" "example" { + metadata { + name = "${kubernetes_endpoints.example.metadata.0.name}" + } + + spec { + port { + port = 8080 + target_port = 80 + } + + port { + port = 8443 + target_port = 443 + } + } +} +``` + +## Import + +An Endpoints resource can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_endpoints.example default/terraform-name +``` diff --git a/docs/resources/endpoints_v1.md b/docs/resources/endpoints_v1.md new file mode 100644 index 0000000000..43609ddb62 --- /dev/null +++ b/docs/resources/endpoints_v1.md @@ -0,0 +1,174 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_endpoints_v1" +description: |- + An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. +--- + +# kubernetes_endpoints_v1 + +An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard endpoints's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `subset` (Block Set) Set of addresses and ports that comprise a service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors (see [below for nested schema](#nestedblock--subset)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the endpoints that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoints. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the endpoints, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the endpoints must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this endpoints that can be used by clients to determine when endpoints has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this endpoints. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `subset` + +Optional: + +- `address` (Block Set) IP address which offers the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize. (see [below for nested schema](#nestedblock--subset--address)) +- `not_ready_address` (Block Set) IP address which offers the related ports but is not currently marked as ready because it have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check. (see [below for nested schema](#nestedblock--subset--not_ready_address)) +- `port` (Block Set) Port number available on the related IP addresses. (see [below for nested schema](#nestedblock--subset--port)) + + +### Nested Schema for `subset.address` + +Required: + +- `ip` (String) The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). + +Optional: + +- `hostname` (String) The Hostname of this endpoint. +- `node_name` (String) Node hosting this endpoint. This can be used to determine endpoints local to a node. + + + +### Nested Schema for `subset.not_ready_address` + +Required: + +- `ip` (String) The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). + +Optional: + +- `hostname` (String) The Hostname of this endpoint. +- `node_name` (String) Node hosting this endpoint. This can be used to determine endpoints local to a node. + + + +### Nested Schema for `subset.port` + +Required: + +- `port` (Number) The port that will be exposed by this endpoint. + +Optional: + +- `name` (String) The name of this port within the endpoint. Must be a DNS_LABEL. Optional if only one Port is defined on this endpoint. +- `protocol` (String) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. + + + + + +## Example Usage + +```terraform +resource "kubernetes_endpoints_v1" "example" { + metadata { + name = "terraform-example" + } + + subset { + address { + ip = "10.0.0.4" + } + + address { + ip = "10.0.0.5" + } + + port { + name = "http" + port = 80 + protocol = "TCP" + } + + port { + name = "https" + port = 443 + protocol = "TCP" + } + } + + subset { + address { + ip = "10.0.1.4" + } + + address { + ip = "10.0.1.5" + } + + port { + name = "http" + port = 80 + protocol = "TCP" + } + + port { + name = "https" + port = 443 + protocol = "TCP" + } + } +} + +resource "kubernetes_service_v1" "example" { + metadata { + name = "${kubernetes_endpoints_v1.example.metadata.0.name}" + } + + spec { + port { + port = 8080 + target_port = 80 + } + + port { + port = 8443 + target_port = 443 + } + } +} +``` + +## Import + +An Endpoints resource can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_endpoints_v1.example default/terraform-name +``` diff --git a/docs/resources/env.md b/docs/resources/env.md new file mode 100644 index 0000000000..c382995046 --- /dev/null +++ b/docs/resources/env.md @@ -0,0 +1,139 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_env" +description: |- + This resource provides a way to manage environment variables in resources that were created outside of Terraform. +--- + +# kubernetes_env + +This resource provides a way to manage environment variables in resources that were created outside of Terraform. This resource provides functionality similar to the `kubectl set env` command. + + +## Schema + +### Required + +- `api_version` (String) Resource API version +- `env` (Block List, Min: 1) List of custom values used to represent environment variables (see [below for nested schema](#nestedblock--env)) +- `kind` (String) Resource Kind +- `metadata` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `container` (String) Name of the container for which we are updating the environment variables. +- `field_manager` (String) Set the name of the field manager for the specified environment variables. +- `force` (Boolean) Force overwriting environments that were created or edited outside of Terraform. +- `init_container` (String) Name of the initContainer for which we are updating the environment variables. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--env--value_from)) + + +### Nested Schema for `env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--env--value_from--secret_key_ref)) + + +### Nested Schema for `env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `metadata` + +Required: + +- `name` (String) The name of the resource. + +Optional: + +- `namespace` (String) The namespace of the resource. + + + + +## Example Usage + +```terraform +resource "kubernetes_env" "example" { + container = "nginx" + metadata { + name = "nginx-deployment" + } + + api_version = "apps/v1" + kind = "Deployment" + + env { + name = "NGINX_HOST" + value = "google.com" + } + + env { + name = "NGINX_PORT" + value = "90" + } +} +``` + +## Import + +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/docs/resources/horizontal_pod_autoscaler.md b/docs/resources/horizontal_pod_autoscaler.md new file mode 100644 index 0000000000..5831c624f0 --- /dev/null +++ b/docs/resources/horizontal_pod_autoscaler.md @@ -0,0 +1,503 @@ +--- +subcategory: "autoscaling/v1" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# kubernetes_horizontal_pod_autoscaler + +Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard horizontal pod autoscaler's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this horizontal pod autoscaler. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `max_replicas` (Number) Upper limit for the number of pods that can be set by the autoscaler. +- `scale_target_ref` (Block List, Min: 1, Max: 1) Reference to scaled resource. e.g. Replication Controller (see [below for nested schema](#nestedblock--spec--scale_target_ref)) + +Optional: + +- `behavior` (Block List, Max: 1) Behavior configures the scaling behavior of the target in both Up and Down directions (`scale_up` and `scale_down` fields respectively). (see [below for nested schema](#nestedblock--spec--behavior)) +- `metric` (Block List) The specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization. (see [below for nested schema](#nestedblock--spec--metric)) +- `min_replicas` (Number) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. +- `target_cpu_utilization_percentage` (Number) Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. + + +### Nested Schema for `spec.scale_target_ref` + +Required: + +- `kind` (String) Kind of the referent. e.g. `ReplicationController`. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `api_version` (String) API version of the referent + + + +### Nested Schema for `spec.behavior` + +Optional: + +- `scale_down` (Block List) Scaling policy for scaling Down (see [below for nested schema](#nestedblock--spec--behavior--scale_down)) +- `scale_up` (Block List) Scaling policy for scaling Up (see [below for nested schema](#nestedblock--spec--behavior--scale_up)) + + +### Nested Schema for `spec.behavior.scale_down` + +Required: + +- `policy` (Block List, Min: 1) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. (see [below for nested schema](#nestedblock--spec--behavior--scale_down--policy)) + +Optional: + +- `select_policy` (String) Used to specify which policy should be used. If not set, the default value Max is used. +- `stabilization_window_seconds` (Number) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). + + +### Nested Schema for `spec.behavior.scale_down.policy` + +Required: + +- `period_seconds` (Number) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). +- `type` (String) Type is used to specify the scaling policy: Percent or Pods +- `value` (Number) Value contains the amount of change which is permitted by the policy. It must be greater than zero. + + + + +### Nested Schema for `spec.behavior.scale_up` + +Required: + +- `policy` (Block List, Min: 1) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. (see [below for nested schema](#nestedblock--spec--behavior--scale_up--policy)) + +Optional: + +- `select_policy` (String) Used to specify which policy should be used. If not set, the default value Max is used. +- `stabilization_window_seconds` (Number) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). + + +### Nested Schema for `spec.behavior.scale_up.policy` + +Required: + +- `period_seconds` (Number) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). +- `type` (String) Type is used to specify the scaling policy: Percent or Pods +- `value` (Number) Value contains the amount of change which is permitted by the policy. It must be greater than zero. + + + + + +### Nested Schema for `spec.metric` + +Required: + +- `type` (String) type is the type of metric source. It should be one of "ContainerResource", "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object. Note: "ContainerResource" type is available on when the feature-gate HPAContainerMetrics is enabled + +Optional: + +- `container_resource` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--container_resource)) +- `external` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--external)) +- `object` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--object)) +- `pods` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--pods)) +- `resource` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--resource)) + + +### Nested Schema for `spec.metric.container_resource` + +Required: + +- `container` (String) name of the container in the pods of the scaling target +- `name` (String) name of the resource in question + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--container_resource--target)) + + +### Nested Schema for `spec.metric.container_resource.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.external` + +Required: + +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--external--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--external--target)) + + +### Nested Schema for `spec.metric.external.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--external--metric--selector)) + + +### Nested Schema for `spec.metric.external.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--external--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.external.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.external.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.object` + +Required: + +- `described_object` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--object--described_object)) +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--object--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--object--target)) + + +### Nested Schema for `spec.metric.object.described_object` + +Required: + +- `api_version` (String) API version of the referent +- `kind` (String) Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds +- `name` (String) Name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.metric.object.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--object--metric--selector)) + + +### Nested Schema for `spec.metric.object.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--object--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.object.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.object.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.pods` + +Required: + +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--pods--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--pods--target)) + + +### Nested Schema for `spec.metric.pods.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--pods--metric--selector)) + + +### Nested Schema for `spec.metric.pods.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--pods--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.pods.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.pods.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.resource` + +Required: + +- `name` (String) name is the name of the resource in question. + +Optional: + +- `target` (Block List, Max: 1) Target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--resource--target)) + + +### Nested Schema for `spec.metric.resource.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + + + + +## Example Usage + +```terraform +resource "kubernetes_horizontal_pod_autoscaler" "example" { + metadata { + name = "terraform-example" + } + + spec { + max_replicas = 10 + min_replicas = 8 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + } +} +``` + +## Example Usage, with `metric` + +```terraform +resource "kubernetes_horizontal_pod_autoscaler" "example" { + metadata { + name = "test" + } + + spec { + min_replicas = 50 + max_replicas = 100 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + + metric { + type = "External" + external { + metric { + name = "latency" + selector { + match_labels = { + lb_name = "test" + } + } + } + target { + type = "Value" + value = "100" + } + } + } + } +} +``` + +## Example Usage, with `behavior` + +```terraform +resource "kubernetes_horizontal_pod_autoscaler" "example" { + metadata { + name = "test" + } + + spec { + min_replicas = 50 + max_replicas = 100 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + + behavior { + scale_down { + stabilization_window_seconds = 300 + select_policy = "Min" + policy { + period_seconds = 120 + type = "Pods" + value = 1 + } + + policy { + period_seconds = 310 + type = "Percent" + value = 100 + } + } + scale_up { + stabilization_window_seconds = 600 + select_policy = "Max" + policy { + period_seconds = 180 + type = "Percent" + value = 100 + } + policy { + period_seconds = 600 + type = "Pods" + value = 5 + } + } + } + } +} +``` + +## Support for multiple and custom metrics + +The provider currently supports two version of the HorizontalPodAutoscaler API resource. + +If you wish to use `autoscaling/v1` use the `target_cpu_utilization_percentage` field. + +If you wish to use `autoscaling/v2beta2` then set one or more `metric` fields. + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler.example default/terraform-example +``` diff --git a/docs/resources/horizontal_pod_autoscaler_v1.md b/docs/resources/horizontal_pod_autoscaler_v1.md new file mode 100644 index 0000000000..286e6f42a3 --- /dev/null +++ b/docs/resources/horizontal_pod_autoscaler_v1.md @@ -0,0 +1,97 @@ +--- +subcategory: "autoscaling/v1" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v1" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# kubernetes_horizontal_pod_autoscaler_v1 + +Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard horizontal pod autoscaler's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this horizontal pod autoscaler. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `max_replicas` (Number) Upper limit for the number of pods that can be set by the autoscaler. +- `scale_target_ref` (Block List, Min: 1, Max: 1) Reference to scaled resource. e.g. Replication Controller (see [below for nested schema](#nestedblock--spec--scale_target_ref)) + +Optional: + +- `min_replicas` (Number) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. +- `target_cpu_utilization_percentage` (Number) Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. + + +### Nested Schema for `spec.scale_target_ref` + +Required: + +- `kind` (String) Kind of the referent. e.g. `ReplicationController`. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `api_version` (String) API version of the referent + + + + + +## Example Usage + +```terraform +resource "kubernetes_horizontal_pod_autoscaler_v1" "example" { + metadata { + name = "terraform-example" + } + + spec { + max_replicas = 10 + min_replicas = 8 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + } +} +``` + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler_v1.example default/terraform-example +``` diff --git a/docs/resources/horizontal_pod_autoscaler_v2.md b/docs/resources/horizontal_pod_autoscaler_v2.md new file mode 100644 index 0000000000..899d3feacb --- /dev/null +++ b/docs/resources/horizontal_pod_autoscaler_v2.md @@ -0,0 +1,475 @@ +--- +subcategory: "autoscaling/v2" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v2" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# kubernetes_horizontal_pod_autoscaler_v2 + +Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard horizontal pod autoscaler's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this horizontal pod autoscaler. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `max_replicas` (Number) Upper limit for the number of pods that can be set by the autoscaler. +- `scale_target_ref` (Block List, Min: 1, Max: 1) Reference to scaled resource. e.g. Replication Controller (see [below for nested schema](#nestedblock--spec--scale_target_ref)) + +Optional: + +- `behavior` (Block List, Max: 1) Behavior configures the scaling behavior of the target in both Up and Down directions (`scale_up` and `scale_down` fields respectively). (see [below for nested schema](#nestedblock--spec--behavior)) +- `metric` (Block List) The specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization. (see [below for nested schema](#nestedblock--spec--metric)) +- `min_replicas` (Number) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. +- `target_cpu_utilization_percentage` (Number) Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. + + +### Nested Schema for `spec.scale_target_ref` + +Required: + +- `kind` (String) Kind of the referent. e.g. `ReplicationController`. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `api_version` (String) API version of the referent + + + +### Nested Schema for `spec.behavior` + +Optional: + +- `scale_down` (Block List) Scaling policy for scaling Down (see [below for nested schema](#nestedblock--spec--behavior--scale_down)) +- `scale_up` (Block List) Scaling policy for scaling Up (see [below for nested schema](#nestedblock--spec--behavior--scale_up)) + + +### Nested Schema for `spec.behavior.scale_down` + +Required: + +- `policy` (Block List, Min: 1) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. (see [below for nested schema](#nestedblock--spec--behavior--scale_down--policy)) + +Optional: + +- `select_policy` (String) Used to specify which policy should be used. If not set, the default value Max is used. +- `stabilization_window_seconds` (Number) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). + + +### Nested Schema for `spec.behavior.scale_down.policy` + +Required: + +- `period_seconds` (Number) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). +- `type` (String) Type is used to specify the scaling policy: Percent or Pods +- `value` (Number) Value contains the amount of change which is permitted by the policy. It must be greater than zero. + + + + +### Nested Schema for `spec.behavior.scale_up` + +Required: + +- `policy` (Block List, Min: 1) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. (see [below for nested schema](#nestedblock--spec--behavior--scale_up--policy)) + +Optional: + +- `select_policy` (String) Used to specify which policy should be used. If not set, the default value Max is used. +- `stabilization_window_seconds` (Number) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). + + +### Nested Schema for `spec.behavior.scale_up.policy` + +Required: + +- `period_seconds` (Number) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). +- `type` (String) Type is used to specify the scaling policy: Percent or Pods +- `value` (Number) Value contains the amount of change which is permitted by the policy. It must be greater than zero. + + + + + +### Nested Schema for `spec.metric` + +Required: + +- `type` (String) type is the type of metric source. It should be one of "ContainerResource", "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object. Note: "ContainerResource" type is available on when the feature-gate HPAContainerMetrics is enabled + +Optional: + +- `container_resource` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--container_resource)) +- `external` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--external)) +- `object` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--object)) +- `pods` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--pods)) +- `resource` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--resource)) + + +### Nested Schema for `spec.metric.container_resource` + +Required: + +- `container` (String) name of the container in the pods of the scaling target +- `name` (String) name of the resource in question + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--container_resource--target)) + + +### Nested Schema for `spec.metric.container_resource.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.external` + +Required: + +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--external--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--external--target)) + + +### Nested Schema for `spec.metric.external.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--external--metric--selector)) + + +### Nested Schema for `spec.metric.external.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--external--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.external.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.external.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.object` + +Required: + +- `described_object` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--object--described_object)) +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--object--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--object--target)) + + +### Nested Schema for `spec.metric.object.described_object` + +Required: + +- `api_version` (String) API version of the referent +- `kind` (String) Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds +- `name` (String) Name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.metric.object.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--object--metric--selector)) + + +### Nested Schema for `spec.metric.object.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--object--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.object.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.object.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.pods` + +Required: + +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--pods--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--pods--target)) + + +### Nested Schema for `spec.metric.pods.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--pods--metric--selector)) + + +### Nested Schema for `spec.metric.pods.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--pods--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.pods.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.pods.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.resource` + +Required: + +- `name` (String) name is the name of the resource in question. + +Optional: + +- `target` (Block List, Max: 1) Target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--resource--target)) + + +### Nested Schema for `spec.metric.resource.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + + + + +## Example Usage, with `metric` + +```terraform +resource "kubernetes_horizontal_pod_autoscaler_v2" "example" { + metadata { + name = "test" + } + + spec { + min_replicas = 50 + max_replicas = 100 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + + metric { + type = "External" + external { + metric { + name = "latency" + selector { + match_labels = { + lb_name = "test" + } + } + } + target { + type = "Value" + value = "100" + } + } + } + } +} +``` + +## Example Usage, with `behavior` + +```terraform +resource "kubernetes_horizontal_pod_autoscaler_v2" "example" { + metadata { + name = "test" + } + + spec { + min_replicas = 50 + max_replicas = 100 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + + behavior { + scale_down { + stabilization_window_seconds = 300 + select_policy = "Min" + policy { + period_seconds = 120 + type = "Pods" + value = 1 + } + + policy { + period_seconds = 310 + type = "Percent" + value = 100 + } + } + scale_up { + stabilization_window_seconds = 600 + select_policy = "Max" + policy { + period_seconds = 180 + type = "Percent" + value = 100 + } + policy { + period_seconds = 600 + type = "Pods" + value = 5 + } + } + } + } +} +``` + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler_v2.example default/terraform-example +``` diff --git a/docs/resources/horizontal_pod_autoscaler_v2beta2.md b/docs/resources/horizontal_pod_autoscaler_v2beta2.md new file mode 100644 index 0000000000..cabf3fff6a --- /dev/null +++ b/docs/resources/horizontal_pod_autoscaler_v2beta2.md @@ -0,0 +1,475 @@ +--- +subcategory: "autoscaling/v2beta2" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v2beta2" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# kubernetes_horizontal_pod_autoscaler_v2beta2 + +Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard horizontal pod autoscaler's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Behaviour of the autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this horizontal pod autoscaler. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `max_replicas` (Number) Upper limit for the number of pods that can be set by the autoscaler. +- `scale_target_ref` (Block List, Min: 1, Max: 1) Reference to scaled resource. e.g. Replication Controller (see [below for nested schema](#nestedblock--spec--scale_target_ref)) + +Optional: + +- `behavior` (Block List, Max: 1) Behavior configures the scaling behavior of the target in both Up and Down directions (`scale_up` and `scale_down` fields respectively). (see [below for nested schema](#nestedblock--spec--behavior)) +- `metric` (Block List) The specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization. (see [below for nested schema](#nestedblock--spec--metric)) +- `min_replicas` (Number) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. +- `target_cpu_utilization_percentage` (Number) Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. + + +### Nested Schema for `spec.scale_target_ref` + +Required: + +- `kind` (String) Kind of the referent. e.g. `ReplicationController`. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `api_version` (String) API version of the referent + + + +### Nested Schema for `spec.behavior` + +Optional: + +- `scale_down` (Block List) Scaling policy for scaling Down (see [below for nested schema](#nestedblock--spec--behavior--scale_down)) +- `scale_up` (Block List) Scaling policy for scaling Up (see [below for nested schema](#nestedblock--spec--behavior--scale_up)) + + +### Nested Schema for `spec.behavior.scale_down` + +Required: + +- `policy` (Block List, Min: 1) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. (see [below for nested schema](#nestedblock--spec--behavior--scale_down--policy)) + +Optional: + +- `select_policy` (String) Used to specify which policy should be used. If not set, the default value Max is used. +- `stabilization_window_seconds` (Number) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). + + +### Nested Schema for `spec.behavior.scale_down.policy` + +Required: + +- `period_seconds` (Number) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). +- `type` (String) Type is used to specify the scaling policy: Percent or Pods +- `value` (Number) Value contains the amount of change which is permitted by the policy. It must be greater than zero. + + + + +### Nested Schema for `spec.behavior.scale_up` + +Required: + +- `policy` (Block List, Min: 1) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. (see [below for nested schema](#nestedblock--spec--behavior--scale_up--policy)) + +Optional: + +- `select_policy` (String) Used to specify which policy should be used. If not set, the default value Max is used. +- `stabilization_window_seconds` (Number) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). + + +### Nested Schema for `spec.behavior.scale_up.policy` + +Required: + +- `period_seconds` (Number) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). +- `type` (String) Type is used to specify the scaling policy: Percent or Pods +- `value` (Number) Value contains the amount of change which is permitted by the policy. It must be greater than zero. + + + + + +### Nested Schema for `spec.metric` + +Required: + +- `type` (String) type is the type of metric source. It should be one of "ContainerResource", "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object. Note: "ContainerResource" type is available on when the feature-gate HPAContainerMetrics is enabled + +Optional: + +- `container_resource` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--container_resource)) +- `external` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--external)) +- `object` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--object)) +- `pods` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--pods)) +- `resource` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--resource)) + + +### Nested Schema for `spec.metric.container_resource` + +Required: + +- `container` (String) name of the container in the pods of the scaling target +- `name` (String) name of the resource in question + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--container_resource--target)) + + +### Nested Schema for `spec.metric.container_resource.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.external` + +Required: + +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--external--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--external--target)) + + +### Nested Schema for `spec.metric.external.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--external--metric--selector)) + + +### Nested Schema for `spec.metric.external.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--external--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.external.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.external.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.object` + +Required: + +- `described_object` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--spec--metric--object--described_object)) +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--object--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--object--target)) + + +### Nested Schema for `spec.metric.object.described_object` + +Required: + +- `api_version` (String) API version of the referent +- `kind` (String) Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds +- `name` (String) Name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.metric.object.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--object--metric--selector)) + + +### Nested Schema for `spec.metric.object.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--object--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.object.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.object.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.pods` + +Required: + +- `metric` (Block List, Min: 1, Max: 1) metric identifies the target metric by name and selector (see [below for nested schema](#nestedblock--spec--metric--pods--metric)) + +Optional: + +- `target` (Block List, Max: 1) target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--pods--target)) + + +### Nested Schema for `spec.metric.pods.metric` + +Required: + +- `name` (String) name is the name of the given metric + +Optional: + +- `selector` (Block List) selector is the string-encoded form of a standard kubernetes label selector for the given metric When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. When unset, just the metricName will be used to gather metrics. (see [below for nested schema](#nestedblock--spec--metric--pods--metric--selector)) + + +### Nested Schema for `spec.metric.pods.metric.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--metric--pods--metric--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.metric.pods.metric.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.metric.pods.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + +### Nested Schema for `spec.metric.resource` + +Required: + +- `name` (String) name is the name of the resource in question. + +Optional: + +- `target` (Block List, Max: 1) Target specifies the target value for the given metric (see [below for nested schema](#nestedblock--spec--metric--resource--target)) + + +### Nested Schema for `spec.metric.resource.target` + +Required: + +- `type` (String) type represents whether the metric type is Utilization, Value, or AverageValue + +Optional: + +- `average_utilization` (Number) averageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type +- `average_value` (String) averageValue is the target value of the average of the metric across all relevant pods (as a quantity) +- `value` (String) value is the target value of the metric (as a quantity). + + + + + + + +## Example Usage, with `metric` + +```terraform +resource "kubernetes_horizontal_pod_autoscaler_v2beta2" "example" { + metadata { + name = "test" + } + + spec { + min_replicas = 50 + max_replicas = 100 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + + metric { + type = "External" + external { + metric { + name = "latency" + selector { + match_labels = { + lb_name = "test" + } + } + } + target { + type = "Value" + value = "100" + } + } + } + } +} +``` + +## Example Usage, with `behavior` + +```terraform +resource "kubernetes_horizontal_pod_autoscaler_v2beta2" "example" { + metadata { + name = "test" + } + + spec { + min_replicas = 50 + max_replicas = 100 + + scale_target_ref { + kind = "Deployment" + name = "MyApp" + } + + behavior { + scale_down { + stabilization_window_seconds = 300 + select_policy = "Min" + policy { + period_seconds = 120 + type = "Pods" + value = 1 + } + + policy { + period_seconds = 310 + type = "Percent" + value = 100 + } + } + scale_up { + stabilization_window_seconds = 600 + select_policy = "Max" + policy { + period_seconds = 180 + type = "Percent" + value = 100 + } + policy { + period_seconds = 600 + type = "Pods" + value = 5 + } + } + } + } +} +``` + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler_v2beta2.example default/terraform-example +``` diff --git a/docs/resources/ingress.md b/docs/resources/ingress.md new file mode 100644 index 0000000000..ac17eaedc8 --- /dev/null +++ b/docs/resources/ingress.md @@ -0,0 +1,330 @@ +--- +subcategory: "extensions/v1beta1" +page_title: "Kubernetes: kubernetes_ingress" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# kubernetes_ingress + +Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard ingress's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `wait_for_load_balancer` (Boolean) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. + +### Read-Only + +- `id` (String) The ID of this resource. +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the ingress. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the ingress, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the ingress must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this ingress that can be used by clients to determine when ingress has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this ingress. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `backend` (Block List, Max: 1) A default backend capable of servicing requests that don't match any rule. At least one of 'backend' or 'rules' must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default. (see [below for nested schema](#nestedblock--spec--backend)) +- `ingress_class_name` (String) ingressClassName is the name of the IngressClass cluster resource. The associated IngressClass defines which controller will implement the resource. This replaces the deprecated `kubernetes.io/ingress.class` annotation. For backwards compatibility, when that annotation is set, it must be given precedence over this field. The controller may emit a warning if the field and annotation have different values. Implementations of this API should ignore Ingresses without a class specified. An IngressClass resource may be marked as default, which can be used to set a default value for this field. For more information, refer to the IngressClass documentation. +- `rule` (Block List) (see [below for nested schema](#nestedblock--spec--rule)) +- `tls` (Block List) tls represents the TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. (see [below for nested schema](#nestedblock--spec--tls)) + + +### Nested Schema for `spec.backend` + +Optional: + +- `service_name` (String) Specifies the name of the referenced service. +- `service_port` (String) Specifies the port of the referenced service. + + + +### Nested Schema for `spec.rule` + +Required: + +- `http` (Block List, Min: 1, Max: 1) http is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'. (see [below for nested schema](#nestedblock--spec--rule--http)) + +Optional: + +- `host` (String) host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the "host" part of the URI as defined in RFC 3986: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to + the IP in the Spec of the parent Ingress. +2. The `:` delimiter is not respected because ports are not allowed. + Currently the port of an Ingress is implicitly :80 for http and + :443 for https. +Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue. + +host can be "precise" which is a domain name without the terminating dot of a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. "*.foo.com"). The wildcard character '*' must appear by itself as the first DNS label and matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*"). Requests will be matched against the Host field in the following way: 1. If Host is precise, the request matches this rule if the http host header is equal to Host. 2. If Host is a wildcard, then the request matches this rule if the http host header is to equal to the suffix (removing the first label) of the wildcard rule. + + +### Nested Schema for `spec.rule.http` + +Required: + +- `path` (Block List, Min: 1) (see [below for nested schema](#nestedblock--spec--rule--http--path)) + + +### Nested Schema for `spec.rule.http.path` + +Optional: + +- `backend` (Block List, Max: 1) Backend defines the referenced service endpoint to which the traffic will be forwarded to. (see [below for nested schema](#nestedblock--spec--rule--http--path--backend)) +- `path` (String) path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional "path" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value "Exact" or "Prefix". + + +### Nested Schema for `spec.rule.http.path.backend` + +Optional: + +- `service_name` (String) Specifies the name of the referenced service. +- `service_port` (String) Specifies the port of the referenced service. + + + + + + +### Nested Schema for `spec.tls` + +Optional: + +- `hosts` (List of String) hosts is a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified. +- `secret_name` (String) secretName is the name of the secret used to terminate TLS traffic on port 443. Field is left optional to allow TLS routing based on SNI hostname alone. If the SNI host in a listener conflicts with the "Host" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing. + + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +resource "kubernetes_ingress" "example_ingress" { + metadata { + name = "example-ingress" + } + + spec { + backend { + service_name = "myapp-1" + service_port = 8080 + } + + rule { + http { + path { + backend { + service_name = "myapp-1" + service_port = 8080 + } + + path = "/app1/*" + } + + path { + backend { + service_name = "myapp-2" + service_port = 8080 + } + + path = "/app2/*" + } + } + } + + tls { + secret_name = "tls-secret" + } + } +} + +resource "kubernetes_service_v1" "example" { + metadata { + name = "myapp-1" + } + spec { + selector = { + app = kubernetes_pod.example.metadata.0.labels.app + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "NodePort" + } +} + +resource "kubernetes_service_v1" "example2" { + metadata { + name = "myapp-2" + } + spec { + selector = { + app = kubernetes_pod.example2.metadata.0.labels.app + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "NodePort" + } +} + +resource "kubernetes_pod" "example" { + metadata { + name = "terraform-example" + labels = { + app = "myapp-1" + } + } + + spec { + container { + image = "nginx:1.7.9" + name = "example" + + port { + container_port = 8080 + } + } + } +} + +resource "kubernetes_pod" "example2" { + metadata { + name = "terraform-example2" + labels = { + app = "myapp-2" + } + } + + spec { + container { + image = "nginx:1.7.9" + name = "example" + + port { + container_port = 8080 + } + } + } +} +``` + +## Example using Nginx ingress controller + +```terraform +resource "kubernetes_service" "example" { + metadata { + name = "ingress-service" + } + spec { + port { + port = 80 + target_port = 80 + protocol = "TCP" + } + type = "NodePort" + } +} + +resource "kubernetes_ingress" "example" { + wait_for_load_balancer = true + metadata { + name = "example" + annotations = { + "kubernetes.io/ingress.class" = "nginx" + } + } + spec { + rule { + http { + path { + path = "/*" + backend { + service_name = kubernetes_service.example.metadata.0.name + service_port = 80 + } + } + } + } + } +} + +# Display load balancer hostname (typically present in AWS) +output "load_balancer_hostname" { + value = kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.hostname +} + +# Display load balancer IP (typically present in GCP, or using Nginx ingress controller) +output "load_balancer_ip" { + value = kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.ip +} +``` + +## Import + +Ingress can be imported using its namespace and name: + +``` +terraform import kubernetes_ingress. / +``` + +e.g. + +``` +$ terraform import kubernetes_ingress.example default/terraform-name +``` diff --git a/docs/resources/ingress_class.md b/docs/resources/ingress_class.md new file mode 100644 index 0000000000..700081eb31 --- /dev/null +++ b/docs/resources/ingress_class.md @@ -0,0 +1,92 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_class" +description: |- + Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. +--- + +# kubernetes_ingress_class + +Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard ingress_class_v1's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec is the desired state of the IngressClass. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the ingress_class_v1 that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the ingress_class_v1. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the ingress_class_v1, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this ingress_class_v1 that can be used by clients to determine when ingress_class_v1 has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this ingress_class_v1. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `controller` (String) controller refers to the name of the controller that should handle this class. This allows for different "flavors" that are controlled by the same controller. For example, you may have different parameters for the same implementing controller. This should be specified as a domain-prefixed path no more than 250 characters in length, e.g. "acme.io/ingress-controller". This field is immutable. +- `parameters` (Block List) (see [below for nested schema](#nestedblock--spec--parameters)) + + +### Nested Schema for `spec.parameters` + +Required: + +- `kind` (String) Kind is the type of resource being referenced +- `name` (String) Name is the name of resource being referenced + +Optional: + +- `api_group` (String) 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. +- `namespace` (String) +- `scope` (String) + + + + + +## Example Usage + +```terraform +resource "kubernetes_ingress_class" "example" { + metadata { + name = "example" + } + + spec { + controller = "example.com/ingress-controller" + parameters { + api_group = "k8s.example.com" + kind = "IngressParameters" + name = "external-lb" + } + } +} +``` + +## Import + +Ingress Classes can be imported using its name, e.g: + +``` +$ terraform import kubernetes_ingress_class.example example +``` diff --git a/docs/resources/ingress_class_v1.md b/docs/resources/ingress_class_v1.md new file mode 100644 index 0000000000..0f13202973 --- /dev/null +++ b/docs/resources/ingress_class_v1.md @@ -0,0 +1,92 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_class_v1" +description: |- + Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. +--- + +# kubernetes_ingress_class_v1 + +Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard ingress_class_v1's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec is the desired state of the IngressClass. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the ingress_class_v1 that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the ingress_class_v1. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the ingress_class_v1, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this ingress_class_v1 that can be used by clients to determine when ingress_class_v1 has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this ingress_class_v1. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `controller` (String) controller refers to the name of the controller that should handle this class. This allows for different "flavors" that are controlled by the same controller. For example, you may have different parameters for the same implementing controller. This should be specified as a domain-prefixed path no more than 250 characters in length, e.g. "acme.io/ingress-controller". This field is immutable. +- `parameters` (Block List) (see [below for nested schema](#nestedblock--spec--parameters)) + + +### Nested Schema for `spec.parameters` + +Required: + +- `kind` (String) Kind is the type of resource being referenced +- `name` (String) Name is the name of resource being referenced + +Optional: + +- `api_group` (String) 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. +- `namespace` (String) +- `scope` (String) + + + + + +## Example Usage + +```terraform +resource "kubernetes_ingress_class_v1" "example" { + metadata { + name = "example" + } + + spec { + controller = "example.com/ingress-controller" + parameters { + api_group = "k8s.example.com" + kind = "IngressParameters" + name = "external-lb" + } + } +} +``` + +## Import + +Ingress Classes can be imported using its name, e.g: + +``` +$ terraform import kubernetes_ingress_class_v1.example example +``` diff --git a/docs/resources/ingress_v1.md b/docs/resources/ingress_v1.md new file mode 100644 index 0000000000..537761cf9b --- /dev/null +++ b/docs/resources/ingress_v1.md @@ -0,0 +1,418 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_v1" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# kubernetes_ingress_v1 + +Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard ingress's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_load_balancer` (Boolean) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. + +### Read-Only + +- `id` (String) The ID of this resource. +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the ingress. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the ingress, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the ingress must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this ingress that can be used by clients to determine when ingress has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this ingress. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `default_backend` (Block List, Max: 1) A default backend capable of servicing requests that don't match any rule. At least one of 'backend' or 'rules' must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default. (see [below for nested schema](#nestedblock--spec--default_backend)) +- `ingress_class_name` (String) ingressClassName is the name of an IngressClass cluster resource. Ingress controller implementations use this field to know whether they should be serving this Ingress resource, by a transitive connection (controller -> IngressClass -> Ingress resource). Although the `kubernetes.io/ingress.class` annotation (simple constant name) was never formally defined, it was widely supported by Ingress controllers to create a direct binding between Ingress controller and Ingress resources. Newly created Ingress resources should prefer using the field. However, even though the annotation is officially deprecated, for backwards compatibility reasons, ingress controllers should still honor that annotation if present. +- `rule` (Block List) (see [below for nested schema](#nestedblock--spec--rule)) +- `tls` (Block List) tls represents the TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. (see [below for nested schema](#nestedblock--spec--tls)) + + +### Nested Schema for `spec.default_backend` + +Optional: + +- `resource` (Block List, Max: 1) Resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. (see [below for nested schema](#nestedblock--spec--default_backend--resource)) +- `service` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--default_backend--service)) + + +### Nested Schema for `spec.default_backend.resource` + +Required: + +- `api_group` (String) 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. +- `kind` (String) The kind of resource. +- `name` (String) The name of the User to bind to. + + + +### Nested Schema for `spec.default_backend.service` + +Required: + +- `name` (String) Specifies the name of the referenced service. +- `port` (Block List, Min: 1, Max: 1) Specifies the port of the referenced service. (see [below for nested schema](#nestedblock--spec--default_backend--service--port)) + + +### Nested Schema for `spec.default_backend.service.port` + +Optional: + +- `name` (String) Specifies the name of the port of the referenced service. +- `number` (Number) Specifies the numerical port of the referenced service. + + + + + +### Nested Schema for `spec.rule` + +Optional: + +- `host` (String) host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the "host" part of the URI as defined in RFC 3986: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to + the IP in the Spec of the parent Ingress. +2. The `:` delimiter is not respected because ports are not allowed. + Currently the port of an Ingress is implicitly :80 for http and + :443 for https. +Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue. + +host can be "precise" which is a domain name without the terminating dot of a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. "*.foo.com"). The wildcard character '*' must appear by itself as the first DNS label and matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*"). Requests will be matched against the Host field in the following way: 1. If host is precise, the request matches this rule if the http host header is equal to Host. 2. If host is a wildcard, then the request matches this rule if the http host header is to equal to the suffix (removing the first label) of the wildcard rule. +- `http` (Block List, Max: 1) http is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'. (see [below for nested schema](#nestedblock--spec--rule--http)) + + +### Nested Schema for `spec.rule.http` + +Required: + +- `path` (Block List, Min: 1) (see [below for nested schema](#nestedblock--spec--rule--http--path)) + + +### Nested Schema for `spec.rule.http.path` + +Optional: + +- `backend` (Block List, Max: 1) Backend defines the referenced service endpoint to which the traffic will be forwarded to. (see [below for nested schema](#nestedblock--spec--rule--http--path--backend)) +- `path` (String) path is matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional "path" part of a URL as defined by RFC 3986. Paths must begin with a '/' and must be present when using PathType with value "Exact" or "Prefix". +- `path_type` (String) pathType determines the interpretation of the path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is + done on a path element by element basis. A path element refers is the + list of labels in the path split by the '/' separator. A request is a + match for path p if every p is an element-wise prefix of p of the + request path. Note that if the last element of the path is a substring + of the last element in request path, it is not a match (e.g. /foo/bar + matches /foo/bar/baz, but does not match /foo/barbaz). +* ImplementationSpecific: Interpretation of the Path matching is up to + the IngressClass. Implementations can treat this as a separate PathType + or treat it identically to Prefix or Exact path types. +Implementations are required to support all path types. + + +### Nested Schema for `spec.rule.http.path.backend` + +Optional: + +- `resource` (Block List, Max: 1) Resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a service.Name and service.Port must not be specified. (see [below for nested schema](#nestedblock--spec--rule--http--path--backend--resource)) +- `service` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--rule--http--path--backend--service)) + + +### Nested Schema for `spec.rule.http.path.backend.resource` + +Required: + +- `api_group` (String) 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. +- `kind` (String) The kind of resource. +- `name` (String) The name of the User to bind to. + + + +### Nested Schema for `spec.rule.http.path.backend.service` + +Required: + +- `name` (String) Specifies the name of the referenced service. +- `port` (Block List, Min: 1, Max: 1) Specifies the port of the referenced service. (see [below for nested schema](#nestedblock--spec--rule--http--path--backend--service--port)) + + +### Nested Schema for `spec.rule.http.path.backend.service.port` + +Optional: + +- `name` (String) Specifies the name of the port of the referenced service. +- `number` (Number) Specifies the numerical port of the referenced service. + + + + + + + + +### Nested Schema for `spec.tls` + +Optional: + +- `hosts` (List of String) hosts is a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified. +- `secret_name` (String) secretName is the name of the secret used to terminate TLS traffic on port 443. Field is left optional to allow TLS routing based on SNI hostname alone. If the SNI host in a listener conflicts with the "Host" header field used by an IngressRule, the SNI host is used for termination and value of the "Host" header is used for routing. + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +resource "kubernetes_ingress_v1" "example_ingress" { + metadata { + name = "example-ingress" + } + + spec { + default_backend { + service { + name = "myapp-1" + port { + number = 8080 + } + } + } + + rule { + http { + path { + backend { + service { + name = "myapp-1" + port { + number = 8080 + } + } + } + + path = "/app1/*" + } + + path { + backend { + service { + name = "myapp-2" + port { + number = 8080 + } + } + } + + path = "/app2/*" + } + } + } + + tls { + secret_name = "tls-secret" + } + } +} + +resource "kubernetes_service_v1" "example" { + metadata { + name = "myapp-1" + } + spec { + selector = { + app = kubernetes_pod_v1.example.metadata.0.labels.app + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "NodePort" + } +} + +resource "kubernetes_service_v1" "example2" { + metadata { + name = "myapp-2" + } + spec { + selector = { + app = kubernetes_pod_v1.example2.metadata.0.labels.app + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "NodePort" + } +} + +resource "kubernetes_pod_v1" "example" { + metadata { + name = "terraform-example" + labels = { + app = "myapp-1" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + port { + container_port = 80 + } + } + } +} + +resource "kubernetes_pod_v1" "example2" { + metadata { + name = "terraform-example2" + labels = { + app = "myapp-2" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + port { + container_port = 80 + } + } + } +} +``` + +## Example using Nginx ingress controller + +```terraform +resource "kubernetes_service_v1" "example" { + metadata { + name = "ingress-service" + } + spec { + port { + port = 80 + target_port = 80 + protocol = "TCP" + } + type = "NodePort" + } +} + +resource "kubernetes_ingress_v1" "example" { + wait_for_load_balancer = true + metadata { + name = "example" + } + spec { + ingress_class_name = "nginx" + rule { + http { + path { + path = "/*" + backend { + service { + name = kubernetes_service_v1.example.metadata.0.name + port { + number = 80 + } + } + } + } + } + } + } +} + +# Display load balancer hostname (typically present in AWS) +output "load_balancer_hostname" { + value = kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.hostname +} + +# Display load balancer IP (typically present in GCP, or using Nginx ingress controller) +output "load_balancer_ip" { + value = kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.ip +} +``` + +## Import + +Ingress can be imported using its namespace and name: + +``` +terraform import kubernetes_ingress_v1. / +``` + +e.g. + +``` +$ terraform import kubernetes_ingress_v1.example default/terraform-name +``` diff --git a/docs/resources/job.md b/docs/resources/job.md new file mode 100644 index 0000000000..79ae3158d0 --- /dev/null +++ b/docs/resources/job.md @@ -0,0 +1,2347 @@ +--- +subcategory: "batch/v1" +page_title: "Kubernetes: kubernetes_job" +description: |- + A Job creates one or more Pods and ensures that a specified number of them successfully terminate. You can also use a Job to run multiple Pods in parallel. +--- + +# kubernetes_job + +A Job creates one or more Pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. + +A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot. + +You can also use a Job to run multiple Pods in parallel. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard job's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec of the job owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_completion` (Boolean) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the job that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the job, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the job must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this job. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `backoff_limit` (Number) Specifies the number of retries before marking this job failed. Defaults to 6 +- `completion_mode` (String) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode +- `completions` (Number) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `manual_selector` (Boolean) Controls generation of pod labels and pod selectors. Leave unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. More info: https://git.k8s.io/community/contributors/design-proposals/selector-generation.md +- `parallelism` (Number) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `pod_failure_policy` (Block List, Max: 1) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--pod_failure_policy)) +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--selector)) +- `ttl_seconds_after_finished` (String) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard job's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the job (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the job that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the job, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this job. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.pod_failure_policy` + +Required: + +- `rule` (Block List, Min: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--pod_failure_policy--rule)) + + +### Nested Schema for `spec.pod_failure_policy.rule` + +Optional: + +- `action` (String) +- `on_exit_codes` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--pod_failure_policy--rule--on_exit_codes)) +- `on_pod_condition` (Block List) (see [below for nested schema](#nestedblock--spec--pod_failure_policy--rule--on_pod_condition)) + + +### Nested Schema for `spec.pod_failure_policy.rule.on_exit_codes` + +Required: + +- `values` (List of Number) + +Optional: + +- `container_name` (String) +- `operator` (String) + + + +### Nested Schema for `spec.pod_failure_policy.rule.on_pod_condition` + +Optional: + +- `status` (String) +- `type` (String) + + + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage - No waiting + +```terraform +resource "kubernetes_job" "demo" { + metadata { + name = "demo" + } + spec { + template { + metadata {} + spec { + container { + name = "pi" + image = "alpine" + command = ["sh", "-c", "sleep 10"] + } + restart_policy = "Never" + } + } + backoff_limit = 4 + } + wait_for_completion = false +} +``` + +## Example Usage - waiting for job successful completion + +```terraform +resource "kubernetes_job" "demo" { + metadata { + name = "demo" + } + spec { + template { + metadata {} + spec { + container { + name = "pi" + image = "perl" + command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] + } + restart_policy = "Never" + } + } + backoff_limit = 4 + } + wait_for_completion = true + timeouts { + create = "2m" + update = "2m" + } +} +``` + +Note: + +- Kubernetes provider will treat update operations that change the Job spec resulting in the job re-run as "# forces replacement". In such cases, the `create` timeout value is used for both Create and Update operations. +- `wait_for_completion` is not applicable during Delete operations; thus, there is no "delete" timeout value for Delete operation. diff --git a/docs/resources/job_v1.md b/docs/resources/job_v1.md new file mode 100644 index 0000000000..70f52d1336 --- /dev/null +++ b/docs/resources/job_v1.md @@ -0,0 +1,2343 @@ +--- +subcategory: "batch/v1" +page_title: "Kubernetes: kubernetes_job_v1" +description: |- + A Job creates one or more Pods and ensures that a specified number of them successfully terminate. You can also use a Job to run multiple Pods in parallel. +--- + +# kubernetes_job_v1 + +A Job creates one or more Pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot. You can also use a Job to run multiple Pods in parallel. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard job's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec of the job owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_completion` (Boolean) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the job that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the job, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the job must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this job. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `template` (Block List, Min: 1, Max: 1) Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `backoff_limit` (Number) Specifies the number of retries before marking this job failed. Defaults to 6 +- `completion_mode` (String) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode +- `completions` (Number) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `manual_selector` (Boolean) Controls generation of pod labels and pod selectors. Leave unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. More info: https://git.k8s.io/community/contributors/design-proposals/selector-generation.md +- `parallelism` (Number) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +- `pod_failure_policy` (Block List, Max: 1) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ (see [below for nested schema](#nestedblock--spec--pod_failure_policy)) +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--selector)) +- `ttl_seconds_after_finished` (String) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard job's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the job (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the job that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the job. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the job, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this job that can be used by clients to determine when job has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this job. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.pod_failure_policy` + +Required: + +- `rule` (Block List, Min: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--pod_failure_policy--rule)) + + +### Nested Schema for `spec.pod_failure_policy.rule` + +Optional: + +- `action` (String) +- `on_exit_codes` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--pod_failure_policy--rule--on_exit_codes)) +- `on_pod_condition` (Block List) (see [below for nested schema](#nestedblock--spec--pod_failure_policy--rule--on_pod_condition)) + + +### Nested Schema for `spec.pod_failure_policy.rule.on_exit_codes` + +Required: + +- `values` (List of Number) + +Optional: + +- `container_name` (String) +- `operator` (String) + + + +### Nested Schema for `spec.pod_failure_policy.rule.on_pod_condition` + +Optional: + +- `status` (String) +- `type` (String) + + + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage - No waiting + +```terraform +resource "kubernetes_job_v1" "demo" { + metadata { + name = "demo" + } + spec { + template { + metadata {} + spec { + container { + name = "pi" + image = "perl" + command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] + } + restart_policy = "Never" + } + } + backoff_limit = 4 + } + wait_for_completion = false +} +``` + +## Example Usage - waiting for job successful completion + +```terraform +resource "kubernetes_job_v1" "demo" { + metadata { + name = "demo" + } + spec { + template { + metadata {} + spec { + container { + name = "pi" + image = "perl" + command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] + } + restart_policy = "Never" + } + } + backoff_limit = 4 + } + wait_for_completion = true + timeouts { + create = "2m" + update = "2m" + } +} +``` + +Note: + +- Kubernetes provider will treat update operations that change the Job spec resulting in the job re-run as "# forces replacement". In such cases, the `create` timeout value is used for both Create and Update operations. +- `wait_for_completion` is not applicable during Delete operations; thus, there is no "delete" timeout value for Delete operation. diff --git a/website/docs/r/labels.html.markdown b/docs/resources/labels.md similarity index 56% rename from website/docs/r/labels.html.markdown rename to docs/resources/labels.md index b2e1f85d1b..cf534f9f8e 100644 --- a/website/docs/r/labels.html.markdown +++ b/docs/resources/labels.md @@ -1,6 +1,5 @@ --- subcategory: "manifest" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_labels" description: |- This resource allows Terraform to manage the labels for a resource that already exists @@ -8,12 +7,44 @@ description: |- # kubernetes_labels -This resource allows Terraform to manage the labels for a resource that already exists. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the labels that are defined in the Terraform configuration. Existing labels not specified in the configuration will be ignored. If a label specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true. +This resource allows Terraform to manage the labels for a resource that already exists. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the labels that are defined in the Terraform configuration. Existing labels not specified in the configuration will be ignored. If a label specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true. + + +## Schema + +### Required + +- `api_version` (String) The apiVersion of the resource to label. +- `kind` (String) The kind of the resource to label. +- `labels` (Map of String) A map of labels to apply to the resource. +- `metadata` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `field_manager` (String) Set the name of the field manager for the specified labels. +- `force` (Boolean) Force overwriting labels that were created or edited outside of Terraform. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Required: + +- `name` (String) The name of the resource. + +Optional: + +- `namespace` (String) The namespace of the resource. + + ## Example Usage -```hcl +```terraform resource "kubernetes_labels" "example" { api_version = "v1" kind = "ConfigMap" @@ -26,28 +57,6 @@ resource "kubernetes_labels" "example" { } ``` -## Argument Reference - -The following arguments are supported: - -* `api_version` - (Required) The apiVersion of the resource to be labelled. -* `kind` - (Required) The kind of the resource to be labelled. -* `metadata` - (Required) Standard metadata of the resource to be labelled. -* `labels` - (Required) A map of labels to apply to the resource. -* `force` - (Optional) Force management of labels if there is a conflict. -* `field_manager` - (Optional) The name of the [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management). Defaults to `Terraform`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the resource to be labelled. -* `namespace` - (Optional) Namespace of the resource to be labelled. - ## Import -This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. - - +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/docs/resources/limit_range.md b/docs/resources/limit_range.md new file mode 100644 index 0000000000..6b48a56ee0 --- /dev/null +++ b/docs/resources/limit_range.md @@ -0,0 +1,108 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_limit_range" +description: |- + Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. +--- + +# kubernetes_limit_range + +Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. + +Read more in [the official docs](https://kubernetes.io/docs/concepts/policy/limit-range/). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard limit range's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the limit range that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the limit range. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the limit range, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the limit range must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this limit range that can be used by clients to determine when limit range has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this limit range. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `limit` (Block List) Limits is the list of objects that are enforced. (see [below for nested schema](#nestedblock--spec--limit)) + + +### Nested Schema for `spec.limit` + +Optional: + +- `default` (Map of String) Default resource requirement limit value by resource name if resource limit is omitted. +- `default_request` (Map of String) The default resource requirement request value by resource name if resource request is omitted. +- `max` (Map of String) Max usage constraints on this kind by resource name. +- `max_limit_request_ratio` (Map of String) The named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. +- `min` (Map of String) Min usage constraints on this kind by resource name. +- `type` (String) Type of resource that this limit applies to. + + + + + +## Example Usage + +```terraform +resource "kubernetes_limit_range" "example" { + metadata { + name = "terraform-example" + } + spec { + limit { + type = "Pod" + max = { + cpu = "200m" + memory = "1024Mi" + } + } + limit { + type = "PersistentVolumeClaim" + min = { + storage = "24M" + } + } + limit { + type = "Container" + default = { + cpu = "50m" + memory = "24Mi" + } + } + } +} +``` + +## Import + +Limit Range can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_limit_range.example default/terraform-example +``` diff --git a/docs/resources/limit_range_v1.md b/docs/resources/limit_range_v1.md new file mode 100644 index 0000000000..b78db0fdc7 --- /dev/null +++ b/docs/resources/limit_range_v1.md @@ -0,0 +1,106 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_limit_range_v1" +description: |- + Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. +--- + +# kubernetes_limit_range_v1 + +Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. Read more in [the official docs](https://kubernetes.io/docs/concepts/policy/limit-range/). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard limit range's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the limit range that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the limit range. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the limit range, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the limit range must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this limit range that can be used by clients to determine when limit range has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this limit range. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `limit` (Block List) Limits is the list of objects that are enforced. (see [below for nested schema](#nestedblock--spec--limit)) + + +### Nested Schema for `spec.limit` + +Optional: + +- `default` (Map of String) Default resource requirement limit value by resource name if resource limit is omitted. +- `default_request` (Map of String) The default resource requirement request value by resource name if resource request is omitted. +- `max` (Map of String) Max usage constraints on this kind by resource name. +- `max_limit_request_ratio` (Map of String) The named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. +- `min` (Map of String) Min usage constraints on this kind by resource name. +- `type` (String) Type of resource that this limit applies to. + + + + + +## Example Usage + +```terraform +resource "kubernetes_limit_range_v1" "example" { + metadata { + name = "terraform-example" + } + spec { + limit { + type = "Pod" + max = { + cpu = "200m" + memory = "1024Mi" + } + } + limit { + type = "PersistentVolumeClaim" + min = { + storage = "24M" + } + } + limit { + type = "Container" + default = { + cpu = "50m" + memory = "24Mi" + } + } + } +} +``` + +## Import + +Limit Range can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_limit_range_v1.example default/terraform-example +``` diff --git a/website/docs/r/manifest.html.markdown b/docs/resources/manifest.md similarity index 70% rename from website/docs/r/manifest.html.markdown rename to docs/resources/manifest.md index dad9833fb5..0f69d902e4 100644 --- a/website/docs/r/manifest.html.markdown +++ b/docs/resources/manifest.md @@ -1,6 +1,5 @@ --- subcategory: "manifest" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_manifest" description: |- The resource provides a way to create and manage custom resources @@ -14,16 +13,79 @@ Once applied, the `object` attribute contains the state of the resource as retur ~> A minimum Terraform version of 0.14.8 is required to use this resource. + +## Schema + +### Required + +- `manifest` (Dynamic) A Kubernetes manifest describing the desired state of the resource in HCL format. + +### Optional + +- `computed_fields` (List of String) List of manifest fields whose values can be altered by the API server during 'apply'. Defaults to: ["metadata.annotations", "metadata.labels"] +- `field_manager` (Block List, Max: 1) Configure field manager options. (see [below for nested schema](#nestedblock--field_manager)) +- `object` (Dynamic) The resulting resource state, as returned by the API server after applying the desired state from `manifest`. +- `timeouts` (Block List, Max: 1) (see [below for nested schema](#nestedblock--timeouts)) +- `wait` (Block List, Max: 1) Configure waiter options. (see [below for nested schema](#nestedblock--wait)) +- `wait_for` (Object, Deprecated) A map of attribute paths and desired patterns to be matched. After each apply the provider will wait for all attributes listed here to reach a value that matches the desired pattern. (see [below for nested schema](#nestedatt--wait_for)) + + +### Nested Schema for `field_manager` + +Optional: + +- `force_conflicts` (Boolean) Force changes against conflicts. +- `name` (String) The name to use for the field manager when creating and updating the resource. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) Timeout for the create operation. +- `delete` (String) Timeout for the delete operation. +- `update` (String) Timeout for the update operation. + + + +### Nested Schema for `wait` + +Optional: + +- `condition` (Block List) (see [below for nested schema](#nestedblock--wait--condition)) +- `fields` (Map of String) A map of paths to fields to wait for a specific field value. +- `rollout` (Boolean) Wait for rollout to complete on resources that support `kubectl rollout status`. + + +### Nested Schema for `wait.condition` + +Optional: + +- `status` (String) The condition status. +- `type` (String) The type of condition. + + + + +### Nested Schema for `wait_for` + +Optional: + +- `fields` (Map of String) + + + + ### Before you use this resource - This resource requires API access during planning time. This means the cluster has to be accessible at plan time and thus cannot be created in the same apply operation. We recommend only using this resource for custom resources or resources not yet fully supported by the provider. - This resource uses [Server-side Apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to carry out apply operations. A minimum Kubernetes version of 1.16.x is required, but versions 1.17+ are strongly recommended as the SSA implementation in Kubernetes 1.16.x is incomplete and unstable. - ### Example: Create a Kubernetes ConfigMap -```hcl +```terraform resource "kubernetes_manifest" "test-configmap" { manifest = { "apiVersion" = "v1" @@ -41,7 +103,7 @@ resource "kubernetes_manifest" "test-configmap" { ### Example: Create a Kubernetes Custom Resource Definition -```hcl +```terraform resource "kubernetes_manifest" "test-crd" { manifest = { apiVersion = "apiextensions.k8s.io/v1" @@ -100,8 +162,7 @@ kubectl get secrets sample -o yaml | tfk8s --strip -o sample.tf terraform import kubernetes_manifest.secret_sample "apiVersion=v1,kind=Secret,namespace=default,name=sample" ``` -Note the import ID as the last argument to the import command. This ID points Terraform at which Kubernetes object to read when importing. -It should be constructed with the following syntax: `"apiVersion=,kind=,[namespace=,]name="`. The `namespace=` in the ID string is required only for Kubernetes namespaced objects and should be omitted for cluster-wide objects. +Note the import ID as the last argument to the import command. This ID points Terraform at which Kubernetes object to read when importing. It should be constructed with the following syntax: `"apiVersion=,kind=,[namespace=,]name="`. The `namespace=` in the ID string is required only for Kubernetes namespaced objects and should be omitted for cluster-wide objects. ## Using `wait` to block create and update calls @@ -109,7 +170,7 @@ The `kubernetes_manifest` resource supports the ability to block create and upda `wait` supports supports a `fields` attribute which allows you specify a map of fields paths to regular expressions. You can also specify `*` if you just want to wait for a field to have any value. -```hcl +```terraform resource "kubernetes_manifest" "test" { manifest = { // ... @@ -139,9 +200,9 @@ resource "kubernetes_manifest" "test" { } ``` -The `wait` block also supports a `rollout` attribute which will wait for rollout to complete on Deployment, StatefulSet, and DaemonSet resources. +The `wait` block also supports a `rollout` attribute which will wait for rollout to complete on Deployment, StatefulSet, and DaemonSet resources. -```hcl +```terraform resource "kubernetes_manifest" "test" { manifest = { // ... @@ -155,7 +216,7 @@ resource "kubernetes_manifest" "test" { You can also wait for specified conditions to be met by specifying a `condition` block. -```hcl +```terraform resource "kubernetes_manifest" "test" { manifest = { // ... @@ -174,7 +235,7 @@ resource "kubernetes_manifest" "test" { The `kubernetes_manifest` exposes configuration of the field manager through the optional `field_manager` block. -```hcl +```terraform resource "kubernetes_manifest" "test" { provider = kubernetes-alpha @@ -196,11 +257,11 @@ resource "kubernetes_manifest" "test" { When setting the value of an field in configuration, Terraform will check that the same value is returned after the apply operation. This ensures that the actual configuration requested by the user is successfully applied. In some cases, with the Kubernetes API this is not the desired behavior. Particularly when using mutating admission controllers, there is a chance that the values configured by the user will be modified by the API. This usually manifest as `Error: Provider produced inconsistent result after apply` and `produced an unexpected new value:` messages when applying. -To accommodate this, the `kubernetes_manifest` resources allows defining so-called "computed" fields. When an field is defined as "computed" Terraform will allow the final value stored in state after `apply` as returned by the API to be different than what the user requested. +To accommodate this, the `kubernetes_manifest` resources allows defining so-called "computed" fields. When an field is defined as "computed" Terraform will allow the final value stored in state after `apply` as returned by the API to be different than what the user requested. -The most common example of this is `metadata.annotations`. In some cases, the API will add extra annotations on top of the ones configured by the user. Unless the field is declared as "computed" Terraform will throw an error signaling that the state returned by the 'apply' operation is inconsistent with the value defined in the 'plan'. +The most common example of this is `metadata.annotations`. In some cases, the API will add extra annotations on top of the ones configured by the user. Unless the field is declared as "computed" Terraform will throw an error signaling that the state returned by the 'apply' operation is inconsistent with the value defined in the 'plan'. - To declare an field as "computed" add its full field path to the `computed_fields` field under the respective `kubernetes_manifest` resource. For example, to declare the "metadata.labels" field as "computed", add the following: +To declare an field as "computed" add its full field path to the `computed_fields` field under the respective `kubernetes_manifest` resource. For example, to declare the "metadata.labels" field as "computed", add the following: ``` resource "kubernetes_manifest" "test-ns" { @@ -216,25 +277,6 @@ resource "kubernetes_manifest" "test-ns" { The syntax for the field paths is the same as the one used in the `wait` block. -## Argument Reference - -The following arguments are supported: - -- `computed_fields` - (Optional) List of paths of fields to be handled as "computed". The user-configured value for the field will be overridden by any different value returned by the API after apply. -- `manifest` (Required) An object Kubernetes manifest describing the desired state of the resource in HCL format. -- `object` (Optional) The resulting resource state, as returned by the API server after applying the desired state from `manifest`. -- `wait` (Optional) An object which allows you configure the provider to wait for specific fields to reach a desired value or certain conditions to be met. See below for schema. -- `wait_for` (Optional, Deprecated) An object which allows you configure the provider to wait for certain conditions to be met. See below for schema. **DEPRECATED: use `wait` block**. -- `field_manager` (Optional) Configure field manager options. See below. - -### `wait` - -#### Arguments - -- `rollout` (Optional) When set to `true` will wait for the resource to roll out, equivalent to `kubectl rollout status`. -- `condition` (Optional) A set of condition to wait for. You can specify multiple `condition` blocks and it will wait for all of them. -- `fields` (Optional) A map of field paths and a corresponding regular expression with a pattern to wait for. The provider will wait until the field's value matches the regular expression. Use `*` for any value. - A field path is a string that describes the fully qualified address of a field within the resource, including its parent fields all the way up to "object". The syntax of a path string follows the rules below: - Fields of objects are addressed with `.` @@ -257,21 +299,3 @@ A field path is a string that describes the fully qualified address of a field w > type(kubernetes_manifest.my-secret.object.data) map(string) ``` - -### `wait_for` (deprecated, use `wait`) - -#### Arguments - -- `fields` (Optional) A map of fields and a corresponding regular expression with a pattern to wait for. The provider will wait until the field matches the regular expression. Use `*` for any value. - - -### `field_manager` - -#### Arguments - -- `name` (Optional) The name of the field manager to use when applying the resource. Defaults to `Terraform`. -- `force_conflicts` (Optional) Forcibly override any field manager conflicts when applying the resource. Defaults to `false`. - -### `timeouts` - -See [Operation Timeouts](https://www.terraform.io/docs/language/resources/syntax.html#operation-timeouts) diff --git a/docs/resources/mutating_webhook_configuration.md b/docs/resources/mutating_webhook_configuration.md new file mode 100644 index 0000000000..b060d5ac45 --- /dev/null +++ b/docs/resources/mutating_webhook_configuration.md @@ -0,0 +1,239 @@ +--- +subcategory: "admissionregistration/v1beta1" +page_title: "Kubernetes: kubernetes_mutating_webhook_configuration" +description: |- + Mutating Webhook Configuration configures a mutating admission webhook +--- + +# kubernetes_mutating_webhook_configuration + +Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard mutating webhook configuration's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `webhook` (Block List, Min: 1) Webhooks is a list of webhooks and the affected resources and operations. (see [below for nested schema](#nestedblock--webhook)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the mutating webhook configuration that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the mutating webhook configuration. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the mutating webhook configuration, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this mutating webhook configuration that can be used by clients to determine when mutating webhook configuration has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this mutating webhook configuration. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `webhook` + +Required: + +- `client_config` (Block List, Min: 1, Max: 1) ClientConfig defines how to communicate with the hook. Required (see [below for nested schema](#nestedblock--webhook--client_config)) +- `name` (String) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. Required. + +Optional: + +- `admission_review_versions` (List of String) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. +- `failure_policy` (String) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. +- `match_policy` (String) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". + +- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. + +- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. + +Defaults to "Equivalent" +- `namespace_selector` (Block List, Max: 1) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. + +For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "runlevel", + "operator": "NotIn", + "values": [ + "0", + "1" + ] + } + ] +} + +If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "environment", + "operator": "In", + "values": [ + "prod", + "staging" + ] + } + ] +} + +See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. + +Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--namespace_selector)) +- `object_selector` (Block List, Max: 1) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--object_selector)) +- `reinvocation_policy` (String) reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded". + +Never: the webhook will not be called more than once in a single admission evaluation. + +IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: * the number of additional invocations is not guaranteed to be exactly one. * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. * webhooks that use this option may be reordered to minimize the number of additional invocations. * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. + +Defaults to "Never". +- `rule` (Block List) Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. (see [below for nested schema](#nestedblock--webhook--rule)) +- `side_effects` (String) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. +- `timeout_seconds` (Number) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. + + +### Nested Schema for `webhook.client_config` + +Optional: + +- `ca_bundle` (String) `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. +- `service` (Block List, Max: 1) `service` is a reference to the service for this webhook. Either `service` or `url` must be specified. + +If the webhook is running within the cluster, then you should use `service`. (see [below for nested schema](#nestedblock--webhook--client_config--service)) +- `url` (String) `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. + +The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. + +Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. + +The scheme must be "https"; the URL must begin with "https://". + +A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. + +Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. + + +### Nested Schema for `webhook.client_config.service` + +Required: + +- `name` (String) `name` is the name of the service. Required +- `namespace` (String) `namespace` is the namespace of the service. Required + +Optional: + +- `path` (String) `path` is an optional URL path which will be sent in any request to this service. +- `port` (Number) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). + + + + +### Nested Schema for `webhook.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.object_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--object_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.object_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.rule` + +Required: + +- `api_groups` (List of String) +- `api_versions` (List of String) +- `operations` (List of String) Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required. +- `resources` (List of String) + +Optional: + +- `scope` (String) + + + + + +## Example Usage + +```terraform +resource "kubernetes_mutating_webhook_configuration" "example" { + metadata { + name = "test.terraform.io" + } + + webhook { + name = "test.terraform.io" + + admission_review_versions = ["v1", "v1beta1"] + + client_config { + service { + namespace = "example-namespace" + name = "example-service" + } + } + + rule { + api_groups = ["apps"] + api_versions = ["v1"] + operations = ["CREATE"] + resources = ["deployments"] + scope = "Namespaced" + } + + reinvocation_policy = "IfNeeded" + side_effects = "None" + } +} +``` + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +## Import + +Mutating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_mutating_webhook_configuration.example terraform-example +``` diff --git a/docs/resources/mutating_webhook_configuration_v1.md b/docs/resources/mutating_webhook_configuration_v1.md new file mode 100644 index 0000000000..86c6ed50b7 --- /dev/null +++ b/docs/resources/mutating_webhook_configuration_v1.md @@ -0,0 +1,239 @@ +--- +subcategory: "admissionregistration/v1" +page_title: "Kubernetes: kubernetes_mutating_webhook_configuration_v1" +description: |- + Mutating Webhook Configuration configures a mutating admission webhook +--- + +# kubernetes_mutating_webhook_configuration_v1 + +Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard mutating webhook configuration's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `webhook` (Block List, Min: 1) Webhooks is a list of webhooks and the affected resources and operations. (see [below for nested schema](#nestedblock--webhook)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the mutating webhook configuration that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the mutating webhook configuration. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the mutating webhook configuration, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this mutating webhook configuration that can be used by clients to determine when mutating webhook configuration has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this mutating webhook configuration. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `webhook` + +Required: + +- `client_config` (Block List, Min: 1, Max: 1) ClientConfig defines how to communicate with the hook. Required (see [below for nested schema](#nestedblock--webhook--client_config)) +- `name` (String) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. Required. + +Optional: + +- `admission_review_versions` (List of String) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. +- `failure_policy` (String) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. +- `match_policy` (String) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". + +- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. + +- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. + +Defaults to "Equivalent" +- `namespace_selector` (Block List, Max: 1) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. + +For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "runlevel", + "operator": "NotIn", + "values": [ + "0", + "1" + ] + } + ] +} + +If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "environment", + "operator": "In", + "values": [ + "prod", + "staging" + ] + } + ] +} + +See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. + +Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--namespace_selector)) +- `object_selector` (Block List, Max: 1) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--object_selector)) +- `reinvocation_policy` (String) reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded". + +Never: the webhook will not be called more than once in a single admission evaluation. + +IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: * the number of additional invocations is not guaranteed to be exactly one. * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. * webhooks that use this option may be reordered to minimize the number of additional invocations. * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. + +Defaults to "Never". +- `rule` (Block List) Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. (see [below for nested schema](#nestedblock--webhook--rule)) +- `side_effects` (String) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. +- `timeout_seconds` (Number) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. + + +### Nested Schema for `webhook.client_config` + +Optional: + +- `ca_bundle` (String) `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. +- `service` (Block List, Max: 1) `service` is a reference to the service for this webhook. Either `service` or `url` must be specified. + +If the webhook is running within the cluster, then you should use `service`. (see [below for nested schema](#nestedblock--webhook--client_config--service)) +- `url` (String) `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. + +The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. + +Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. + +The scheme must be "https"; the URL must begin with "https://". + +A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. + +Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. + + +### Nested Schema for `webhook.client_config.service` + +Required: + +- `name` (String) `name` is the name of the service. Required +- `namespace` (String) `namespace` is the namespace of the service. Required + +Optional: + +- `path` (String) `path` is an optional URL path which will be sent in any request to this service. +- `port` (Number) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). + + + + +### Nested Schema for `webhook.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.object_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--object_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.object_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.rule` + +Required: + +- `api_groups` (List of String) +- `api_versions` (List of String) +- `operations` (List of String) Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required. +- `resources` (List of String) + +Optional: + +- `scope` (String) + + + + + +## Example Usage + +```terraform +resource "kubernetes_mutating_webhook_configuration_v1" "example" { + metadata { + name = "test.terraform.io" + } + + webhook { + name = "test.terraform.io" + + admission_review_versions = ["v1", "v1beta1"] + + client_config { + service { + namespace = "example-namespace" + name = "example-service" + } + } + + rule { + api_groups = ["apps"] + api_versions = ["v1"] + operations = ["CREATE"] + resources = ["deployments"] + scope = "Namespaced" + } + + reinvocation_policy = "IfNeeded" + side_effects = "None" + } +} +``` + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +## Import + +Mutating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_mutating_webhook_configuration_v1.example terraform-example +``` diff --git a/docs/resources/namespace.md b/docs/resources/namespace.md new file mode 100644 index 0000000000..c318afb382 --- /dev/null +++ b/docs/resources/namespace.md @@ -0,0 +1,85 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_namespace" +description: |- + Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. +--- + +# kubernetes_namespace + +Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. Read more about namespaces at [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard namespace's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_default_service_account` (Boolean) Terraform will wait for the default service account to be created. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the namespace. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the namespace, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespace has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this namespace. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `timeouts` + +Optional: + +- `delete` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_namespace" "example" { + metadata { + annotations = { + name = "example-annotation" + } + + labels = { + mylabel = "label-value" + } + + name = "terraform-example-namespace" + } +} +``` + +### Timeouts + +`kubernetes_namespace` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `delete` - Default `5 minutes` + +## Import + +Namespaces can be imported using their name, e.g. + +``` +$ terraform import kubernetes_namespace.n terraform-example-namespace +``` diff --git a/docs/resources/namespace_v1.md b/docs/resources/namespace_v1.md new file mode 100644 index 0000000000..c15c8cde13 --- /dev/null +++ b/docs/resources/namespace_v1.md @@ -0,0 +1,85 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_namespace_v1" +description: |- + Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. +--- + +# kubernetes_namespace_v1 + +Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. Read more about namespaces at [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard namespace's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_default_service_account` (Boolean) Terraform will wait for the default service account to be created. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the namespace. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the namespace, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespace has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this namespace. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `timeouts` + +Optional: + +- `delete` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_namespace_v1" "example" { + metadata { + annotations = { + name = "example-annotation" + } + + labels = { + mylabel = "label-value" + } + + name = "terraform-example-namespace" + } +} +``` + +### Timeouts + +`kubernetes_namespace_v1` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `delete` - Default `5 minutes` + +## Import + +Namespaces can be imported using their name, e.g. + +``` +$ terraform import kubernetes_namespace_v1.n terraform-example-namespace +``` diff --git a/docs/resources/network_policy.md b/docs/resources/network_policy.md new file mode 100644 index 0000000000..a87d5f0d5b --- /dev/null +++ b/docs/resources/network_policy.md @@ -0,0 +1,297 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_network_policy" +description: |- + Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. + NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. +--- + +# kubernetes_network_policy + +Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. Read more about network policies at https://kubernetes.io/docs/concepts/services-networking/network-policies/ + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard network policy's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec represents the specification of the desired behavior for this NetworkPolicy. (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the network policy that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the network policy. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the network policy, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the network policy must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this network policy that can be used by clients to determine when network policy has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this network policy. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `pod_selector` (Block List, Min: 1, Max: 1) podSelector selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace. (see [below for nested schema](#nestedblock--spec--pod_selector)) +- `policy_types` (List of String) policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8 + +Optional: + +- `egress` (Block List) egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8 (see [below for nested schema](#nestedblock--spec--egress)) +- `ingress` (Block List) ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default) (see [below for nested schema](#nestedblock--spec--ingress)) + + +### Nested Schema for `spec.pod_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--pod_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.pod_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.egress` + +Optional: + +- `ports` (Block List) ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. (see [below for nested schema](#nestedblock--spec--egress--ports)) +- `to` (Block List) to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list. (see [below for nested schema](#nestedblock--spec--egress--to)) + + +### Nested Schema for `spec.egress.ports` + +Optional: + +- `port` (String) port represents the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched. +- `protocol` (String) protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. + + + +### Nested Schema for `spec.egress.to` + +Optional: + +- `ip_block` (Block List, Max: 1) ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be. (see [below for nested schema](#nestedblock--spec--egress--to--ip_block)) +- `namespace_selector` (Block List, Max: 1) namespaceSelector selects namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces. + +If podSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector. Otherwise it selects all pods in the namespaces selected by namespaceSelector. (see [below for nested schema](#nestedblock--spec--egress--to--namespace_selector)) +- `pod_selector` (Block List, Max: 1) podSelector is a label selector which selects pods. This field follows standard label selector semantics; if present but empty, it selects all pods. + +If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the pods matching podSelector in the policy's own namespace. (see [below for nested schema](#nestedblock--spec--egress--to--pod_selector)) + + +### Nested Schema for `spec.egress.to.ip_block` + +Optional: + +- `cidr` (String) cidr is a string representing the IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" +- `except` (List of String) except is a slice of CIDRs that should not be included within an IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" Except values will be rejected if they are outside the cidr range + + + +### Nested Schema for `spec.egress.to.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--egress--to--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.egress.to.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.egress.to.pod_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--egress--to--pod_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.egress.to.pod_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.ingress` + +Optional: + +- `from` (Block List) from is a list of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list. (see [below for nested schema](#nestedblock--spec--ingress--from)) +- `ports` (Block List) ports is a list of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. (see [below for nested schema](#nestedblock--spec--ingress--ports)) + + +### Nested Schema for `spec.ingress.from` + +Optional: + +- `ip_block` (Block List, Max: 1) ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be. (see [below for nested schema](#nestedblock--spec--ingress--from--ip_block)) +- `namespace_selector` (Block List, Max: 1) namespaceSelector selects namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces. + +If podSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector. Otherwise it selects all pods in the namespaces selected by namespaceSelector. (see [below for nested schema](#nestedblock--spec--ingress--from--namespace_selector)) +- `pod_selector` (Block List, Max: 1) podSelector is a label selector which selects pods. This field follows standard label selector semantics; if present but empty, it selects all pods. + +If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the pods matching podSelector in the policy's own namespace. (see [below for nested schema](#nestedblock--spec--ingress--from--pod_selector)) + + +### Nested Schema for `spec.ingress.from.ip_block` + +Optional: + +- `cidr` (String) cidr is a string representing the IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" +- `except` (List of String) except is a slice of CIDRs that should not be included within an IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" Except values will be rejected if they are outside the cidr range + + + +### Nested Schema for `spec.ingress.from.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--ingress--from--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.ingress.from.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.ingress.from.pod_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--ingress--from--pod_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.ingress.from.pod_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.ingress.ports` + +Optional: + +- `port` (String) port represents the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched. +- `protocol` (String) protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. +- `end_port` - (Optional) The end_port indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy. Cannot be defined if port is undefined or if port is defined as a named (string) port. + + + + + + +## Example Usage + +```terraform +resource "kubernetes_network_policy" "example" { + metadata { + name = "terraform-example-network-policy" + namespace = "default" + } + + spec { + pod_selector { + match_expressions { + key = "name" + operator = "In" + values = ["webfront", "api"] + } + } + + ingress { + ports { + port = "http" + protocol = "TCP" + } + ports { + port = "8125" + protocol = "UDP" + } + + from { + namespace_selector { + match_labels = { + name = "default" + } + } + } + + from { + ip_block { + cidr = "10.0.0.0/8" + except = [ + "10.0.0.0/24", + "10.0.1.0/24", + ] + } + } + } + + egress {} # single empty rule to allow all egress traffic + + policy_types = ["Ingress", "Egress"] + } +} +``` + +## Import + +Network policies can be imported using their identifier consisting of `/`, e.g.: + +``` +$ terraform import kubernetes_network_policy.example default/terraform-example-network-policy +``` diff --git a/docs/resources/network_policy_v1.md b/docs/resources/network_policy_v1.md new file mode 100644 index 0000000000..3d54e7c5e0 --- /dev/null +++ b/docs/resources/network_policy_v1.md @@ -0,0 +1,298 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_network_policy_v1" +description: |- + Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. + NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. +--- + +# kubernetes_network_policy_v1 + +Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. Read more about network policies at https://kubernetes.io/docs/concepts/services-networking/network-policies/ + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard network policy's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec represents the specification of the desired behavior for this NetworkPolicy. (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the network policy that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the network policy. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the network policy, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the network policy must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this network policy that can be used by clients to determine when network policy has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this network policy. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `pod_selector` (Block List, Min: 1, Max: 1) podSelector selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace. (see [below for nested schema](#nestedblock--spec--pod_selector)) +- `policy_types` (List of String) policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8 + +Optional: + +- `egress` (Block List) egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8 (see [below for nested schema](#nestedblock--spec--egress)) +- `ingress` (Block List) ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default) (see [below for nested schema](#nestedblock--spec--ingress)) + + +### Nested Schema for `spec.pod_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--pod_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.pod_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.egress` + +Optional: + +- `ports` (Block List) ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. (see [below for nested schema](#nestedblock--spec--egress--ports)) +- `to` (Block List) to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list. (see [below for nested schema](#nestedblock--spec--egress--to)) + + +### Nested Schema for `spec.egress.ports` + +Optional: + +- `port` (String) port represents the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched. +- `protocol` (String) protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. + + + +### Nested Schema for `spec.egress.to` + +Optional: + +- `ip_block` (Block List, Max: 1) ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be. (see [below for nested schema](#nestedblock--spec--egress--to--ip_block)) +- `namespace_selector` (Block List, Max: 1) namespaceSelector selects namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces. + +If podSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector. Otherwise it selects all pods in the namespaces selected by namespaceSelector. (see [below for nested schema](#nestedblock--spec--egress--to--namespace_selector)) +- `pod_selector` (Block List, Max: 1) podSelector is a label selector which selects pods. This field follows standard label selector semantics; if present but empty, it selects all pods. + +If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the pods matching podSelector in the policy's own namespace. (see [below for nested schema](#nestedblock--spec--egress--to--pod_selector)) + + +### Nested Schema for `spec.egress.to.ip_block` + +Optional: + +- `cidr` (String) cidr is a string representing the IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" +- `except` (List of String) except is a slice of CIDRs that should not be included within an IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" Except values will be rejected if they are outside the cidr range + + + +### Nested Schema for `spec.egress.to.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--egress--to--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.egress.to.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.egress.to.pod_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--egress--to--pod_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.egress.to.pod_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.ingress` + +Optional: + +- `from` (Block List) from is a list of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list. (see [below for nested schema](#nestedblock--spec--ingress--from)) +- `ports` (Block List) ports is a list of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. (see [below for nested schema](#nestedblock--spec--ingress--ports)) + + +### Nested Schema for `spec.ingress.from` + +Optional: + +- `ip_block` (Block List, Max: 1) ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be. (see [below for nested schema](#nestedblock--spec--ingress--from--ip_block)) +- `namespace_selector` (Block List, Max: 1) namespaceSelector selects namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces. + +If podSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector. Otherwise it selects all pods in the namespaces selected by namespaceSelector. (see [below for nested schema](#nestedblock--spec--ingress--from--namespace_selector)) +- `pod_selector` (Block List, Max: 1) podSelector is a label selector which selects pods. This field follows standard label selector semantics; if present but empty, it selects all pods. + +If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the pods matching podSelector in the policy's own namespace. (see [below for nested schema](#nestedblock--spec--ingress--from--pod_selector)) + + +### Nested Schema for `spec.ingress.from.ip_block` + +Optional: + +- `cidr` (String) cidr is a string representing the IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" +- `except` (List of String) except is a slice of CIDRs that should not be included within an IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" Except values will be rejected if they are outside the cidr range + + + +### Nested Schema for `spec.ingress.from.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--ingress--from--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.ingress.from.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.ingress.from.pod_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--ingress--from--pod_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.ingress.from.pod_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.ingress.ports` + +Optional: + +- `port` (String) port represents the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched. +- `protocol` (String) protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. +- `end_port` - (Optional) The end_port indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy. Cannot be defined if port is undefined or if port is defined as a named (string) port. + + + + + + +## Example Usage + +```terraform +resource "kubernetes_network_policy_v1" "example" { + metadata { + name = "terraform-example-network-policy" + namespace = "default" + } + + spec { + pod_selector { + match_expressions { + key = "name" + operator = "In" + values = ["webfront", "api"] + } + } + + ingress { + ports { + port = "http" + protocol = "TCP" + } + ports { + port = "8125" + protocol = "UDP" + } + + from { + namespace_selector { + match_labels = { + name = "default" + } + } + } + + from { + ip_block { + cidr = "10.0.0.0/8" + except = [ + "10.0.0.0/24", + "10.0.1.0/24", + ] + } + } + } + + egress {} # single empty rule to allow all egress traffic + + policy_types = ["Ingress", "Egress"] + } +} +``` + + +## Import + +Network policies can be imported using their identifier consisting of `/`, e.g.: + +``` +$ terraform import kubernetes_network_policy_v1.example default/terraform-example-network-policy +``` diff --git a/website/docs/r/node_taint.html.markdown b/docs/resources/node_taint.md similarity index 50% rename from website/docs/r/node_taint.html.markdown rename to docs/resources/node_taint.md index 4bc2d56b00..683d468a32 100644 --- a/website/docs/r/node_taint.html.markdown +++ b/docs/resources/node_taint.md @@ -1,6 +1,5 @@ --- subcategory: "core/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_node_taint" description: |- A Node Taint is an anti-affinity rule allowing a Kubernetes node to repel a set of pods. @@ -10,9 +9,46 @@ description: |- [Node affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) is a property of Pods that attracts them to a set of [nodes](https://kubernetes.io/docs/concepts/architecture/nodes/) (either as a preference or a hard requirement). Taints are the opposite -- they allow a node to repel a set of pods. + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--metadata)) +- `taint` (Block List, Min: 1) (see [below for nested schema](#nestedblock--taint)) + +### Optional + +- `field_manager` (String) Set the name of the field manager for the node taint +- `force` (Boolean) Force overwriting annotations that were created or edited outside of Terraform. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Required: + +- `name` (String) The name of the node + + + +### Nested Schema for `taint` + +Required: + +- `effect` (String) The taint effect +- `key` (String) The taint key +- `value` (String) The taint value + + + + ## Example Usage -```hcl +```terraform resource "kubernetes_node_taint" "example" { metadata { name = "my-node.my-cluster.k8s.local" @@ -25,32 +61,6 @@ resource "kubernetes_node_taint" "example" { } ``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Metadata describing which Kubernetes node to apply the taint to. -* `field_manager` - (Optional) Set the name of the field manager for the node taint. -* `force` - (Optional) Force overwriting annotations that were created or edited outside of Terraform. -* `taint` - (Required) The taint configuration to apply to the node. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/). - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) The name of the node to apply the taint to - -### `taint` - -#### Arguments - -* `key` - (Required, Forces new resource) The key of this node taint. -* `value` - (Required) The value of this node taint. Can be empty string. -* `effect` - (Required, Forces new resource) The scheduling effect to apply with this taint. Must be one of: `NoSchedule`, `PreferNoSchedule`, `NoExecute`. - ## Import This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/docs/resources/persistent_volume.md b/docs/resources/persistent_volume.md new file mode 100644 index 0000000000..21b6a8f0c1 --- /dev/null +++ b/docs/resources/persistent_volume.md @@ -0,0 +1,559 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume" +description: |- + A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. +--- + +# kubernetes_persistent_volume + +The resource provides a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1) Spec of the persistent volume owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `access_modes` (Set of String) Contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `capacity` (Map of String) A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity +- `persistent_volume_source` (Block List, Min: 1, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--persistent_volume_source)) + +Optional: + +- `claim_ref` (Block List, Max: 1) A reference to the persistent volume claim details for statically managed PVs. More Info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding (see [below for nested schema](#nestedblock--spec--claim_ref)) +- `mount_options` (Set of String) A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply fail if one is invalid. +- `node_affinity` (Block List, Max: 1) A description of the persistent volume's node affinity. More info: https://kubernetes.io/docs/concepts/storage/volumes/#local (see [below for nested schema](#nestedblock--spec--node_affinity)) +- `persistent_volume_reclaim_policy` (String) What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming +- `storage_class_name` (String) A description of the persistent volume's class. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class +- `volume_mode` (String) Defines if a volume is intended to be used with a formatted filesystem. or to remain in raw block state. + + +### Nested Schema for `spec.persistent_volume_source` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--persistent_volume_source--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--persistent_volume_source--cinder)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--persistent_volume_source--gce_persistent_disk)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--persistent_volume_source--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--persistent_volume_source--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--persistent_volume_source--local)) +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--persistent_volume_source--nfs)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--persistent_volume_source--photon_persistent_disk)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--persistent_volume_source--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--rbd)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--persistent_volume_source--vsphere_volume)) + + +### Nested Schema for `spec.persistent_volume_source.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.persistent_volume_source.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.persistent_volume_source.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.persistent_volume_source.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--persistent_volume_source--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.persistent_volume_source.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.persistent_volume_source.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi +- `volume_handle` (String) A string value that uniquely identifies the volume. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `controller_expand_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--controller_expand_secret_ref)) +- `controller_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--controller_publish_secret_ref)) +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--node_publish_secret_ref)) +- `node_stage_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--node_stage_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.persistent_volume_source.csi.controller_expand_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.controller_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.node_stage_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.persistent_volume_source.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flex_volume--secret_ref)) + + +### Nested Schema for `spec.persistent_volume_source.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.persistent_volume_source.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.persistent_volume_source.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.persistent_volume_source.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.persistent_volume_source.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.persistent_volume_source.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.persistent_volume_source.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.persistent_volume_source.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.persistent_volume_source.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.persistent_volume_source.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--rbd--secret_ref)) + + +### Nested Schema for `spec.persistent_volume_source.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + +### Nested Schema for `spec.claim_ref` + +Required: + +- `name` (String) The name of the PersistentVolumeClaim + +Optional: + +- `namespace` (String) The namespace of the PersistentVolumeClaim. Uses 'default' namespace if none is specified. + + + +### Nested Schema for `spec.node_affinity` + +Optional: + +- `required` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--node_affinity--required)) + + +### Nested Schema for `spec.node_affinity.required` + +Required: + +- `node_selector_term` (Block List, Min: 1) (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term)) + + +### Nested Schema for `spec.node_affinity.required.node_selector_term` + +Optional: + +- `match_expressions` (Block List) A list of node selector requirements by node's labels. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term--match_fields)) + + +### Nested Schema for `spec.node_affinity.required.node_selector_term.match_expressions` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + +### Nested Schema for `spec.node_affinity.required.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_persistent_volume" "example" { + metadata { + name = "terraform-example" + } + spec { + capacity = { + storage = "2Gi" + } + access_modes = ["ReadWriteMany"] + persistent_volume_source { + vsphere_volume { + volume_path = "/absolute/path" + } + } + } +} +``` + +## Example: Persistent Volume using Azure Managed Disk + +```terraform +resource "kubernetes_persistent_volume" "example" { + metadata { + name = "example" + } + spec { + capacity = { + storage = "1Gi" + } + access_modes = ["ReadWriteOnce"] + persistent_volume_source { + azure_disk { + caching_mode = "None" + data_disk_uri = azurerm_managed_disk.example.id + disk_name = "example" + kind = "Managed" + } + } + } +} + +provider "azurerm" { + version = ">=2.20.0" + features {} +} + +resource "azurerm_resource_group" "example" { + name = "example" + location = "westus2" +} + + +resource "azurerm_managed_disk" "example" { + name = "example" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = "1" + tags = { + environment = azurerm_resource_group.example.name + } +} +``` + +## Import + +Persistent Volume can be imported using its name, e.g. + +``` +$ terraform import kubernetes_persistent_volume.example terraform-example +``` diff --git a/docs/resources/persistent_volume_claim.md b/docs/resources/persistent_volume_claim.md new file mode 100644 index 0000000000..9e071d794c --- /dev/null +++ b/docs/resources/persistent_volume_claim.md @@ -0,0 +1,143 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim" +description: |- + This resource allows the user to request for and claim to a persistent volume. +--- + +# kubernetes_persistent_volume_claim + +This resource allows the user to request for and claim to a persistent volume. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume claim's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_until_bound` (Boolean) Whether to wait for the claim to reach `Bound` state (to find volume in which to claim the space) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume claim, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the persistent volume claim must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume claim. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_persistent_volume_claim" "example" { + metadata { + name = "exampleclaimname" + } + spec { + access_modes = ["ReadWriteMany"] + resources { + requests = { + storage = "5Gi" + } + } + volume_name = "${kubernetes_persistent_volume.example.metadata.0.name}" + } +} + +resource "kubernetes_persistent_volume" "example" { + metadata { + name = "examplevolumename" + } + spec { + capacity = { + storage = "10Gi" + } + access_modes = ["ReadWriteMany"] + persistent_volume_source { + gce_persistent_disk { + pd_name = "test-123" + } + } + } +} +``` + +##Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim.example default/example-name +``` diff --git a/docs/resources/persistent_volume_claim_v1.md b/docs/resources/persistent_volume_claim_v1.md new file mode 100644 index 0000000000..98192c6536 --- /dev/null +++ b/docs/resources/persistent_volume_claim_v1.md @@ -0,0 +1,143 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim_v1" +description: |- + This resource allows the user to request for and claim to a persistent volume. +--- + +# kubernetes_persistent_volume_claim_v1 + +This resource allows the user to request for and claim to a persistent volume. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume claim's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_until_bound` (Boolean) Whether to wait for the claim to reach `Bound` state (to find volume in which to claim the space) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume claim, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the persistent volume claim must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume claim. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_persistent_volume_claim_v1" "example" { + metadata { + name = "exampleclaimname" + } + spec { + access_modes = ["ReadWriteMany"] + resources { + requests = { + storage = "5Gi" + } + } + volume_name = "${kubernetes_persistent_volume_v1.example.metadata.0.name}" + } +} + +resource "kubernetes_persistent_volume_v1" "example" { + metadata { + name = "examplevolumename" + } + spec { + capacity = { + storage = "10Gi" + } + access_modes = ["ReadWriteMany"] + persistent_volume_source { + gce_persistent_disk { + pd_name = "test-123" + } + } + } +} +``` + +## Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim_v1.example default/example-name +``` diff --git a/docs/resources/persistent_volume_v1.md b/docs/resources/persistent_volume_v1.md new file mode 100644 index 0000000000..89da63119a --- /dev/null +++ b/docs/resources/persistent_volume_v1.md @@ -0,0 +1,559 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_v1" +description: |- + A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. +--- + +# kubernetes_persistent_volume_v1 + +The resource provides a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1) Spec of the persistent volume owned by the cluster (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `access_modes` (Set of String) Contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `capacity` (Map of String) A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity +- `persistent_volume_source` (Block List, Min: 1, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--persistent_volume_source)) + +Optional: + +- `claim_ref` (Block List, Max: 1) A reference to the persistent volume claim details for statically managed PVs. More Info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding (see [below for nested schema](#nestedblock--spec--claim_ref)) +- `mount_options` (Set of String) A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply fail if one is invalid. +- `node_affinity` (Block List, Max: 1) A description of the persistent volume's node affinity. More info: https://kubernetes.io/docs/concepts/storage/volumes/#local (see [below for nested schema](#nestedblock--spec--node_affinity)) +- `persistent_volume_reclaim_policy` (String) What happens to a persistent volume when released from its claim. Valid options are Retain (default) and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming +- `storage_class_name` (String) A description of the persistent volume's class. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class +- `volume_mode` (String) Defines if a volume is intended to be used with a formatted filesystem. or to remain in raw block state. + + +### Nested Schema for `spec.persistent_volume_source` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--persistent_volume_source--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--persistent_volume_source--cinder)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--persistent_volume_source--gce_persistent_disk)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--persistent_volume_source--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--persistent_volume_source--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--persistent_volume_source--local)) +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--persistent_volume_source--nfs)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--persistent_volume_source--photon_persistent_disk)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--persistent_volume_source--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--rbd)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--persistent_volume_source--vsphere_volume)) + + +### Nested Schema for `spec.persistent_volume_source.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.persistent_volume_source.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.persistent_volume_source.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.persistent_volume_source.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--persistent_volume_source--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.persistent_volume_source.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.persistent_volume_source.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi +- `volume_handle` (String) A string value that uniquely identifies the volume. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `controller_expand_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--controller_expand_secret_ref)) +- `controller_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--controller_publish_secret_ref)) +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--node_publish_secret_ref)) +- `node_stage_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--csi--node_stage_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.persistent_volume_source.csi.controller_expand_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.controller_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.persistent_volume_source.csi.node_stage_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.persistent_volume_source.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--persistent_volume_source--flex_volume--secret_ref)) + + +### Nested Schema for `spec.persistent_volume_source.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.persistent_volume_source.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.persistent_volume_source.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.persistent_volume_source.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.persistent_volume_source.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.persistent_volume_source.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.persistent_volume_source.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.persistent_volume_source.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.persistent_volume_source.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.persistent_volume_source.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--persistent_volume_source--rbd--secret_ref)) + + +### Nested Schema for `spec.persistent_volume_source.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.persistent_volume_source.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + +### Nested Schema for `spec.claim_ref` + +Required: + +- `name` (String) The name of the PersistentVolumeClaim + +Optional: + +- `namespace` (String) The namespace of the PersistentVolumeClaim. Uses 'default' namespace if none is specified. + + + +### Nested Schema for `spec.node_affinity` + +Optional: + +- `required` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec--node_affinity--required)) + + +### Nested Schema for `spec.node_affinity.required` + +Required: + +- `node_selector_term` (Block List, Min: 1) (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term)) + + +### Nested Schema for `spec.node_affinity.required.node_selector_term` + +Optional: + +- `match_expressions` (Block List) A list of node selector requirements by node's labels. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--node_affinity--required--node_selector_term--match_fields)) + + +### Nested Schema for `spec.node_affinity.required.node_selector_term.match_expressions` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + +### Nested Schema for `spec.node_affinity.required.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_persistent_volume_v1" "example" { + metadata { + name = "terraform-example" + } + spec { + capacity = { + storage = "2Gi" + } + access_modes = ["ReadWriteMany"] + persistent_volume_source { + vsphere_volume { + volume_path = "/absolute/path" + } + } + } +} +``` + +## Example: Persistent Volume using Azure Managed Disk + +```terraform +resource "kubernetes_persistent_volume_v1" "example" { + metadata { + name = "example" + } + spec { + capacity = { + storage = "1Gi" + } + access_modes = ["ReadWriteOnce"] + persistent_volume_source { + azure_disk { + caching_mode = "None" + data_disk_uri = azurerm_managed_disk.example.id + disk_name = "example" + kind = "Managed" + } + } + } +} + +provider "azurerm" { + version = ">=2.20.0" + features {} +} + +resource "azurerm_resource_group" "example" { + name = "example" + location = "westus2" +} + + +resource "azurerm_managed_disk" "example" { + name = "example" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = "1" + tags = { + environment = azurerm_resource_group.example.name + } +} +``` + +## Import + +Persistent Volume can be imported using its name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_v1.example terraform-example +``` diff --git a/docs/resources/pod.md b/docs/resources/pod.md new file mode 100644 index 0000000000..636964a54b --- /dev/null +++ b/docs/resources/pod.md @@ -0,0 +1,2336 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# kubernetes_pod + +A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. + +Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Specification of the desired behavior of the pod. (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `target_state` (List of String) A list of the pod phases that indicate whether it was successfully created. Options: "Pending", "Running", "Succeeded", "Failed", "Unknown". Default: "Running". More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--volume)) + + +### Nested Schema for `spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--container--env--value_from)) + + +### Nested Schema for `spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--security_context--windows_options)) + + +### Nested Schema for `spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_pod" "test" { + metadata { + name = "terraform-example" + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + env { + name = "environment" + value = "test" + } + + port { + container_port = 80 + } + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + } + + dns_config { + nameservers = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] + searches = ["example.com"] + + option { + name = "ndots" + value = 1 + } + + option { + name = "use-vc" + } + } + + dns_policy = "None" + } +} +``` + +terraform version of the [pods/pod-with-node-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml) example. + +```terraform +resource "kubernetes_pod" "with_node_affinity" { + metadata { + name = "with-node-affinity" + } + + spec { + affinity { + node_affinity { + required_during_scheduling_ignored_during_execution { + node_selector_term { + match_expressions { + key = "kubernetes.io/e2e-az-name" + operator = "In" + values = ["e2e-az1", "e2e-az2"] + } + } + } + + preferred_during_scheduling_ignored_during_execution { + weight = 1 + + preference { + match_expressions { + key = "another-node-label-key" + operator = "In" + values = ["another-node-label-value"] + } + } + } + } + } + + container { + name = "with-node-affinity" + image = "k8s.gcr.io/pause:2.0" + } + } +} +``` + +terraform version of the [pods/pod-with-pod-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-pod-affinity.yaml) example. + +```terraform +resource "kubernetes_pod" "with_pod_affinity" { + metadata { + name = "with-pod-affinity" + } + + spec { + affinity { + pod_affinity { + required_during_scheduling_ignored_during_execution { + label_selector { + match_expressions { + key = "security" + operator = "In" + values = ["S1"] + } + } + + topology_key = "failure-domain.beta.kubernetes.io/zone" + } + } + + pod_anti_affinity { + preferred_during_scheduling_ignored_during_execution { + weight = 100 + + pod_affinity_term { + label_selector { + match_expressions { + key = "security" + operator = "In" + values = ["S2"] + } + } + + topology_key = "failure-domain.beta.kubernetes.io/zone" + } + } + } + } + + container { + name = "with-pod-affinity" + image = "k8s.gcr.io/pause:2.0" + } + } +} +``` + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod.example default/terraform-example +``` diff --git a/docs/resources/pod_disruption_budget.md b/docs/resources/pod_disruption_budget.md new file mode 100644 index 0000000000..f25aeb6ad1 --- /dev/null +++ b/docs/resources/pod_disruption_budget.md @@ -0,0 +1,92 @@ +--- +subcategory: "policy/v1beta1" +page_title: "Kubernetes: kubernetes_pod_disruption_budget" +description: |- + A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. +--- + +# kubernetes_pod_disruption_budget + +A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod disruption budget's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Specification of the desired behavior of the PodDisruptionBudget. (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod disruption budget that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod disruption budget. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod disruption budget, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod disruption budget must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod disruption budget that can be used by clients to determine when pod disruption budget has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod disruption budget. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `selector` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--spec--selector)) + +Optional: + +- `max_unavailable` (String) +- `min_available` (String) + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +## Example Usage + +```terraform +resource "kubernetes_pod_disruption_budget" "demo" { + metadata { + name = "demo" + } + spec { + max_unavailable = "20%" + selector { + match_labels = { + test = "MyExampleApp" + } + } + } +} +``` diff --git a/docs/resources/pod_disruption_budget_v1.md b/docs/resources/pod_disruption_budget_v1.md new file mode 100644 index 0000000000..4eb7c5d3a7 --- /dev/null +++ b/docs/resources/pod_disruption_budget_v1.md @@ -0,0 +1,94 @@ +--- +subcategory: "policy/v1" +page_title: "Kubernetes: kubernetes_pod_disruption_budget_v1" +description: |- + A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. +--- + +# kubernetes_pod_disruption_budget_v1 + +A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod disruption budget's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Specification of the desired behavior of the PodDisruptionBudget. (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod disruption budget that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod disruption budget. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod disruption budget, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod disruption budget must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod disruption budget that can be used by clients to determine when pod disruption budget has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod disruption budget. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `selector` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--spec--selector)) + +Optional: + +- `max_unavailable` (String) +- `min_available` (String) + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +## Example Usage + +```terraform +resource "kubernetes_pod_disruption_budget_v1" "demo" { + metadata { + name = "demo" + } + spec { + max_unavailable = "20%" + selector { + match_labels = { + test = "MyExampleApp" + } + } + } +} +``` + + diff --git a/docs/resources/pod_security_policy.md b/docs/resources/pod_security_policy.md new file mode 100644 index 0000000000..cbd540762f --- /dev/null +++ b/docs/resources/pod_security_policy.md @@ -0,0 +1,273 @@ +--- +subcategory: "policy/v1beta1" +page_title: "Kubernetes: kubernetes_pod_security_policy" +description: |- + A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. +--- + +# kubernetes_pod_security_policy + +A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard podsecuritypolicy's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec defines the policy enforced. (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the podsecuritypolicy that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the podsecuritypolicy. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the podsecuritypolicy, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this podsecuritypolicy that can be used by clients to determine when podsecuritypolicy has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this podsecuritypolicy. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `fs_group` (Block List, Min: 1, Max: 1) fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. (see [below for nested schema](#nestedblock--spec--fs_group)) +- `run_as_user` (Block List, Min: 1, Max: 1) runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. (see [below for nested schema](#nestedblock--spec--run_as_user)) +- `supplemental_groups` (Block List, Min: 1, Max: 1) supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. (see [below for nested schema](#nestedblock--spec--supplemental_groups)) + +Optional: + +- `allow_privilege_escalation` (Boolean) allowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true. +- `allowed_capabilities` (List of String) allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities. +- `allowed_flex_volumes` (Block List) allowedFlexVolumes is an allowlist of Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field. (see [below for nested schema](#nestedblock--spec--allowed_flex_volumes)) +- `allowed_host_paths` (Block List) allowedHostPaths is an allowlist of host paths. Empty indicates that all host paths may be used. (see [below for nested schema](#nestedblock--spec--allowed_host_paths)) +- `allowed_proc_mount_types` (List of String) AllowedProcMountTypes is an allowlist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled. +- `allowed_unsafe_sysctls` (List of String) allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to allowlist all allowed unsafe sysctls explicitly to avoid rejection. + +Examples: e.g. "foo/*" allows "foo/bar", "foo/baz", etc. e.g. "foo.*" allows "foo.bar", "foo.baz", etc. +- `default_add_capabilities` (List of String) defaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list. +- `default_allow_privilege_escalation` (Boolean) defaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process. +- `forbidden_sysctls` (List of String) forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden. + +Examples: e.g. "foo/*" forbids "foo/bar", "foo/baz", etc. e.g. "foo.*" forbids "foo.bar", "foo.baz", etc. +- `host_ipc` (Boolean) hostIPC determines if the policy allows the use of HostIPC in the pod spec. +- `host_network` (Boolean) hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. +- `host_pid` (Boolean) hostPID determines if the policy allows the use of HostPID in the pod spec. +- `host_ports` (Block List) hostPorts determines which host port ranges are allowed to be exposed. (see [below for nested schema](#nestedblock--spec--host_ports)) +- `privileged` (Boolean) privileged determines if a pod can request to be run as privileged. +- `read_only_root_filesystem` (Boolean) readOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to. +- `required_drop_capabilities` (List of String) requiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added. +- `run_as_group` (Block List, Max: 1) RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod's RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled. (see [below for nested schema](#nestedblock--spec--run_as_group)) +- `se_linux` (Block List, Max: 1) seLinux is the strategy that will dictate the allowable labels that may be set. (see [below for nested schema](#nestedblock--spec--se_linux)) +- `volumes` (List of String) volumes is an allowlist of volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'. + + +### Nested Schema for `spec.fs_group` + +Required: + +- `rule` (String) rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--fs_group--range)) + + +### Nested Schema for `spec.fs_group.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.run_as_user` + +Required: + +- `rule` (String) rule is the strategy that will dictate the allowable RunAsUser values that may be set. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--run_as_user--range)) + + +### Nested Schema for `spec.run_as_user.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.supplemental_groups` + +Required: + +- `rule` (String) rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--supplemental_groups--range)) + + +### Nested Schema for `spec.supplemental_groups.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.allowed_flex_volumes` + +Required: + +- `driver` (String) driver is the name of the Flexvolume driver. + + + +### Nested Schema for `spec.allowed_host_paths` + +Required: + +- `path_prefix` (String) pathPrefix is the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path. + +Examples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar` `/foo` would not allow `/food` or `/etc/foo` + +Optional: + +- `read_only` (Boolean) when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. + + + +### Nested Schema for `spec.host_ports` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + +### Nested Schema for `spec.run_as_group` + +Required: + +- `rule` (String) rule is the strategy that will dictate the allowable RunAsGroup values that may be set. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--run_as_group--range)) + + +### Nested Schema for `spec.run_as_group.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.se_linux` + +Required: + +- `rule` (String) rule is the strategy that will dictate the allowable labels that may be set. + +Optional: + +- `se_linux_options` (Block List) seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--se_linux--se_linux_options)) + + +### Nested Schema for `spec.se_linux.se_linux_options` + +Required: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + + + + +~> NOTE: With the release of Kubernetes v1.25, PodSecurityPolicy has been removed. You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes). + +## Example Usage + +```terraform +resource "kubernetes_pod_security_policy" "example" { + metadata { + name = "terraform-example" + } + spec { + privileged = false + allow_privilege_escalation = false + + volumes = [ + "configMap", + "emptyDir", + "projected", + "secret", + "downwardAPI", + "persistentVolumeClaim", + ] + + run_as_user { + rule = "MustRunAsNonRoot" + } + + se_linux { + rule = "RunAsAny" + } + + supplemental_groups { + rule = "MustRunAs" + range { + min = 1 + max = 65535 + } + } + + fs_group { + rule = "MustRunAs" + range { + min = 1 + max = 65535 + } + } + + read_only_root_filesystem = true + } +} +``` + +## Import + +Pod Security Policy can be imported using its name, e.g. + +``` +$ terraform import kubernetes_pod_security_policy.example terraform-example +``` diff --git a/docs/resources/pod_security_policy_v1beta1.md b/docs/resources/pod_security_policy_v1beta1.md new file mode 100644 index 0000000000..3cfca4e8b0 --- /dev/null +++ b/docs/resources/pod_security_policy_v1beta1.md @@ -0,0 +1,273 @@ +--- +subcategory: "policy/v1beta1" +page_title: "Kubernetes: kubernetes_pod_security_policy_v1beta1" +description: |- + A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. +--- + +# kubernetes_pod_security_policy_v1beta1 + +A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard podsecuritypolicy's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) spec defines the policy enforced. (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the podsecuritypolicy that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the podsecuritypolicy. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the podsecuritypolicy, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this podsecuritypolicy that can be used by clients to determine when podsecuritypolicy has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this podsecuritypolicy. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `fs_group` (Block List, Min: 1, Max: 1) fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. (see [below for nested schema](#nestedblock--spec--fs_group)) +- `run_as_user` (Block List, Min: 1, Max: 1) runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. (see [below for nested schema](#nestedblock--spec--run_as_user)) +- `supplemental_groups` (Block List, Min: 1, Max: 1) supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. (see [below for nested schema](#nestedblock--spec--supplemental_groups)) + +Optional: + +- `allow_privilege_escalation` (Boolean) allowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true. +- `allowed_capabilities` (List of String) allowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities. +- `allowed_flex_volumes` (Block List) allowedFlexVolumes is an allowlist of Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field. (see [below for nested schema](#nestedblock--spec--allowed_flex_volumes)) +- `allowed_host_paths` (Block List) allowedHostPaths is an allowlist of host paths. Empty indicates that all host paths may be used. (see [below for nested schema](#nestedblock--spec--allowed_host_paths)) +- `allowed_proc_mount_types` (List of String) AllowedProcMountTypes is an allowlist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled. +- `allowed_unsafe_sysctls` (List of String) allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to allowlist all allowed unsafe sysctls explicitly to avoid rejection. + +Examples: e.g. "foo/*" allows "foo/bar", "foo/baz", etc. e.g. "foo.*" allows "foo.bar", "foo.baz", etc. +- `default_add_capabilities` (List of String) defaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list. +- `default_allow_privilege_escalation` (Boolean) defaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process. +- `forbidden_sysctls` (List of String) forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden. + +Examples: e.g. "foo/*" forbids "foo/bar", "foo/baz", etc. e.g. "foo.*" forbids "foo.bar", "foo.baz", etc. +- `host_ipc` (Boolean) hostIPC determines if the policy allows the use of HostIPC in the pod spec. +- `host_network` (Boolean) hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. +- `host_pid` (Boolean) hostPID determines if the policy allows the use of HostPID in the pod spec. +- `host_ports` (Block List) hostPorts determines which host port ranges are allowed to be exposed. (see [below for nested schema](#nestedblock--spec--host_ports)) +- `privileged` (Boolean) privileged determines if a pod can request to be run as privileged. +- `read_only_root_filesystem` (Boolean) readOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to. +- `required_drop_capabilities` (List of String) requiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added. +- `run_as_group` (Block List, Max: 1) RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod's RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled. (see [below for nested schema](#nestedblock--spec--run_as_group)) +- `se_linux` (Block List, Max: 1) seLinux is the strategy that will dictate the allowable labels that may be set. (see [below for nested schema](#nestedblock--spec--se_linux)) +- `volumes` (List of String) volumes is an allowlist of volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'. + + +### Nested Schema for `spec.fs_group` + +Required: + +- `rule` (String) rule is the strategy that will dictate what FSGroup is used in the SecurityContext. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--fs_group--range)) + + +### Nested Schema for `spec.fs_group.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.run_as_user` + +Required: + +- `rule` (String) rule is the strategy that will dictate the allowable RunAsUser values that may be set. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--run_as_user--range)) + + +### Nested Schema for `spec.run_as_user.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.supplemental_groups` + +Required: + +- `rule` (String) rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--supplemental_groups--range)) + + +### Nested Schema for `spec.supplemental_groups.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.allowed_flex_volumes` + +Required: + +- `driver` (String) driver is the name of the Flexvolume driver. + + + +### Nested Schema for `spec.allowed_host_paths` + +Required: + +- `path_prefix` (String) pathPrefix is the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path. + +Examples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar` `/foo` would not allow `/food` or `/etc/foo` + +Optional: + +- `read_only` (Boolean) when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. + + + +### Nested Schema for `spec.host_ports` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + +### Nested Schema for `spec.run_as_group` + +Required: + +- `rule` (String) rule is the strategy that will dictate the allowable RunAsGroup values that may be set. + +Optional: + +- `range` (Block List) ranges are the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs. (see [below for nested schema](#nestedblock--spec--run_as_group--range)) + + +### Nested Schema for `spec.run_as_group.range` + +Required: + +- `max` (Number) max is the end of the range, inclusive. +- `min` (Number) min is the start of the range, inclusive. + + + + +### Nested Schema for `spec.se_linux` + +Required: + +- `rule` (String) rule is the strategy that will dictate the allowable labels that may be set. + +Optional: + +- `se_linux_options` (Block List) seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--se_linux--se_linux_options)) + + +### Nested Schema for `spec.se_linux.se_linux_options` + +Required: + +- `level` (String) +- `role` (String) +- `type` (String) +- `user` (String) + + + + + + +~> NOTE: With the release of Kubernetes v1.25, PodSecurityPolicy has been removed. You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes). + +## Example Usage + +```terraform +resource "kubernetes_pod_security_policy_v1beta1" "example" { + metadata { + name = "terraform-example" + } + spec { + privileged = false + allow_privilege_escalation = false + + volumes = [ + "configMap", + "emptyDir", + "projected", + "secret", + "downwardAPI", + "persistentVolumeClaim", + ] + + run_as_user { + rule = "MustRunAsNonRoot" + } + + se_linux { + rule = "RunAsAny" + } + + supplemental_groups { + rule = "MustRunAs" + range { + min = 1 + max = 65535 + } + } + + fs_group { + rule = "MustRunAs" + range { + min = 1 + max = 65535 + } + } + + read_only_root_filesystem = true + } +} +``` + +## Import + +Pod Security Policy can be imported using its name, e.g. + +``` +$ terraform import kubernetes_pod_security_policy_v1beta1.example terraform-example +``` diff --git a/docs/resources/pod_v1.md b/docs/resources/pod_v1.md new file mode 100644 index 0000000000..d9e6b72c67 --- /dev/null +++ b/docs/resources/pod_v1.md @@ -0,0 +1,2334 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod_v1" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# kubernetes_pod_v1 + +A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard pod's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Specification of the desired behavior of the pod. (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `target_state` (List of String) A list of the pod phases that indicate whether it was successfully created. Options: "Pending", "Running", "Succeeded", "Failed", "Unknown". Default: "Running". More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the pod, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the pod must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--volume)) + + +### Nested Schema for `spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--container--env--value_from)) + + +### Nested Schema for `spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--security_context--windows_options)) + + +### Nested Schema for `spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_pod_v1" "test" { + metadata { + name = "terraform-example" + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + env { + name = "environment" + value = "test" + } + + port { + container_port = 80 + } + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + } + + dns_config { + nameservers = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] + searches = ["example.com"] + + option { + name = "ndots" + value = 1 + } + + option { + name = "use-vc" + } + } + + dns_policy = "None" + } +} +``` + +terraform version of the [pods/pod-with-node-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml) example. + +```terraform +resource "kubernetes_pod_v1" "with_node_affinity" { + metadata { + name = "with-node-affinity" + } + + spec { + affinity { + node_affinity { + required_during_scheduling_ignored_during_execution { + node_selector_term { + match_expressions { + key = "kubernetes.io/e2e-az-name" + operator = "In" + values = ["e2e-az1", "e2e-az2"] + } + } + } + + preferred_during_scheduling_ignored_during_execution { + weight = 1 + + preference { + match_expressions { + key = "another-node-label-key" + operator = "In" + values = ["another-node-label-value"] + } + } + } + } + } + + container { + name = "with-node-affinity" + image = "k8s.gcr.io/pause:2.0" + } + } +} +``` + +terraform version of the [pods/pod-with-pod-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-pod-affinity.yaml) example. + +```terraform +resource "kubernetes_pod_v1" "with_pod_affinity" { + metadata { + name = "with-pod-affinity" + } + + spec { + affinity { + pod_affinity { + required_during_scheduling_ignored_during_execution { + label_selector { + match_expressions { + key = "security" + operator = "In" + values = ["S1"] + } + } + + topology_key = "failure-domain.beta.kubernetes.io/zone" + } + } + + pod_anti_affinity { + preferred_during_scheduling_ignored_during_execution { + weight = 100 + + pod_affinity_term { + label_selector { + match_expressions { + key = "security" + operator = "In" + values = ["S2"] + } + } + + topology_key = "failure-domain.beta.kubernetes.io/zone" + } + } + } + } + + container { + name = "with-pod-affinity" + image = "k8s.gcr.io/pause:2.0" + } + } +} +``` + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod_v1.example default/terraform-example +``` diff --git a/docs/resources/priority_class.md b/docs/resources/priority_class.md new file mode 100644 index 0000000000..bb98be660e --- /dev/null +++ b/docs/resources/priority_class.md @@ -0,0 +1,67 @@ +--- +subcategory: "scheduling/v1" +page_title: "Kubernetes: kubernetes_priority_class" +description: |- + A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. +--- + +# kubernetes_priority_class + +A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard priority class's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `value` (Number) The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec. + +### Optional + +- `description` (String) An arbitrary string that usually provides guidelines on when this priority class should be used. +- `global_default` (Boolean) Specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority. +- `preemption_policy` (String) PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the priority class that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the priority class. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the priority class, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this priority class that can be used by clients to determine when priority class has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this priority class. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +## Example Usage + +```terraform +resource "kubernetes_priority_class" "example" { + metadata { + name = "terraform-example" + } + + value = 100 +} +``` + +## Import + +Priority Class can be imported using its name, e.g. + +``` +$ terraform import kubernetes_priority_class.example terraform-example +``` diff --git a/docs/resources/priority_class_v1.md b/docs/resources/priority_class_v1.md new file mode 100644 index 0000000000..467ad82374 --- /dev/null +++ b/docs/resources/priority_class_v1.md @@ -0,0 +1,67 @@ +--- +subcategory: "scheduling/v1" +page_title: "Kubernetes: kubernetes_priority_class_v1" +description: |- + A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. +--- + +# kubernetes_priority_class_v1 + +A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard priority class's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `value` (Number) The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec. + +### Optional + +- `description` (String) An arbitrary string that usually provides guidelines on when this priority class should be used. +- `global_default` (Boolean) Specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority. +- `preemption_policy` (String) PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the priority class that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the priority class. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the priority class, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this priority class that can be used by clients to determine when priority class has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this priority class. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +## Example Usage + +```terraform +resource "kubernetes_priority_class_v1" "example" { + metadata { + name = "terraform-example" + } + + value = 100 +} +``` + +## Import + +Priority Class can be imported using its name, e.g. + +``` +$ terraform import kubernetes_priority_class_v1.example terraform-example +``` diff --git a/docs/resources/replication_controller.md b/docs/resources/replication_controller.md new file mode 100644 index 0000000000..f4d766cbd1 --- /dev/null +++ b/docs/resources/replication_controller.md @@ -0,0 +1,2290 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_replication_controller" +description: |- + A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. +--- + +# kubernetes_replication_controller + +A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. + +~> **WARNING:** In many cases it is recommended to create a Deployment instead of a Replication Controller. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard replication controller's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the replication controller. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the replication controller that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the replication controller. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the replication controller, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the replication controller must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this replication controller that can be used by clients to determine when replication controller has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this replication controller. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `selector` (Map of String) A label query over pods that should match the Replicas count. If Selector is empty, it is defaulted to the labels present on the Pod template. Label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors +- `template` (Block List, Min: 1, Max: 1) Describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `min_ready_seconds` (Number) 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) +- `replicas` (Number) The number of desired replicas. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard replication controller's template's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec of the pods managed by the replication controller (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the replication controller's template that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the replication controller's template. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the replication controller's template, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the replication controller's template must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this replication controller's template that can be used by clients to determine when replication controller's template has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this replication controller's template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_replication_controller" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyExampleApp" + } + } + + spec { + selector = { + test = "MyExampleApp" + } + template { + metadata { + labels = { + test = "MyExampleApp" + } + annotations = { + "key1" = "value1" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + } + requests = { + cpu = "250m" + memory = "50Mi" + } + } + } + } + } + } +} +``` + +## Import + +Replication Controller can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_replication_controller.example default/terraform-example +``` + +~> **NOTE:** Imported `kubernetes_replication_controller` resource will only have their fields from the `spec.template.spec` block in the state. Deprecated fields at the `spec.template` level are not updated during import. Configurations using the deprecated fields should be updated to only use the new fields under `spec.template.spec`. diff --git a/docs/resources/replication_controller_v1.md b/docs/resources/replication_controller_v1.md new file mode 100644 index 0000000000..10dafd5fe8 --- /dev/null +++ b/docs/resources/replication_controller_v1.md @@ -0,0 +1,2290 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_replication_controller_v1" +description: |- + A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. +--- + +# kubernetes_replication_controller_v1 + +A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard replication controller's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the specification of the desired behavior of the replication controller. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the replication controller that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the replication controller. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the replication controller, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the replication controller must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this replication controller that can be used by clients to determine when replication controller has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this replication controller. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `selector` (Map of String) A label query over pods that should match the Replicas count. If Selector is empty, it is defaulted to the labels present on the Pod template. Label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors +- `template` (Block List, Min: 1, Max: 1) Describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `min_ready_seconds` (Number) 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) +- `replicas` (Number) The number of desired replicas. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard replication controller's template's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec of the pods managed by the replication controller (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the replication controller's template that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the replication controller's template. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the replication controller's template, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the replication controller's template must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this replication controller's template that can be used by clients to determine when replication controller's template has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this replication controller's template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + + + + +~> **WARNING:** In many cases it is recommended to create a Deployment instead of a Replication Controller. + +## Example Usage + +```terraform +resource "kubernetes_replication_controller_v1" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyExampleApp" + } + } + + spec { + selector = { + test = "MyExampleApp" + } + template { + metadata { + labels = { + test = "MyExampleApp" + } + annotations = { + "key1" = "value1" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + + liveness_probe { + http_get { + path = "/" + port = 80 + + http_header { + name = "X-Custom-Header" + value = "Awesome" + } + } + + initial_delay_seconds = 3 + period_seconds = 3 + } + + resources { + limits = { + cpu = "0.5" + memory = "512Mi" + } + requests = { + cpu = "250m" + memory = "50Mi" + } + } + } + } + } + } +} +``` + +## Import + +Replication Controller can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_replication_controller_v1.example default/terraform-example +``` + +~> **NOTE:** Imported `kubernetes_replication_controller_v1` resource will only have their fields from the `spec.template.spec` block in the state. Deprecated fields at the `spec.template` level are not updated during import. Configurations using the deprecated fields should be updated to only use the new fields under `spec.template.spec`. diff --git a/docs/resources/resource_quota.md b/docs/resources/resource_quota.md new file mode 100644 index 0000000000..43632bb474 --- /dev/null +++ b/docs/resources/resource_quota.md @@ -0,0 +1,110 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_resource_quota" +description: |- + A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. +--- + +# kubernetes_resource_quota + +A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard resource quota's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) Spec defines the desired quota. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the resource quota, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the resource quota must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this resource quota. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `hard` (Map of String) The set of desired hard limits for each named resource. More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota +- `scope_selector` (Block List, Max: 1) A collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. (see [below for nested schema](#nestedblock--spec--scope_selector)) +- `scopes` (Set of String) A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. + + +### Nested Schema for `spec.scope_selector` + +Optional: + +- `match_expression` (Block List) A list of scope selector requirements by scope of the resources. (see [below for nested schema](#nestedblock--spec--scope_selector--match_expression)) + + +### Nested Schema for `spec.scope_selector.match_expression` + +Required: + +- `operator` (String) Represents a scope's relationship to a set of values. +- `scope_name` (String) The name of the scope that the selector applies to. + +Optional: + +- `values` (Set of String) A list of scope selector requirements by scope of the resources. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_resource_quota" "example" { + metadata { + name = "terraform-example" + } + spec { + hard = { + pods = 10 + } + scopes = ["BestEffort"] + } +} +``` + +## Import + +Resource Quota can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_resource_quota.example default/terraform-example +``` diff --git a/docs/resources/resource_quota_v1.md b/docs/resources/resource_quota_v1.md new file mode 100644 index 0000000000..f7c9d63a38 --- /dev/null +++ b/docs/resources/resource_quota_v1.md @@ -0,0 +1,110 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_resource_quota_v1" +description: |- + A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. +--- + +# kubernetes_resource_quota_v1 + +A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard resource quota's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) Spec defines the desired quota. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the resource quota, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the resource quota must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this resource quota. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `hard` (Map of String) The set of desired hard limits for each named resource. More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota +- `scope_selector` (Block List, Max: 1) A collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. (see [below for nested schema](#nestedblock--spec--scope_selector)) +- `scopes` (Set of String) A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. + + +### Nested Schema for `spec.scope_selector` + +Optional: + +- `match_expression` (Block List) A list of scope selector requirements by scope of the resources. (see [below for nested schema](#nestedblock--spec--scope_selector--match_expression)) + + +### Nested Schema for `spec.scope_selector.match_expression` + +Required: + +- `operator` (String) Represents a scope's relationship to a set of values. +- `scope_name` (String) The name of the scope that the selector applies to. + +Optional: + +- `values` (Set of String) A list of scope selector requirements by scope of the resources. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_resource_quota_v1" "example" { + metadata { + name = "terraform-example" + } + spec { + hard = { + pods = 10 + } + scopes = ["BestEffort"] + } +} +``` + +## Import + +Resource Quota can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_resource_quota_v1.example default/terraform-example +``` diff --git a/docs/resources/role.md b/docs/resources/role.md new file mode 100644 index 0000000000..1a7ecd611c --- /dev/null +++ b/docs/resources/role.md @@ -0,0 +1,89 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role" +description: |- + A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). +--- + +# kubernetes_role + +A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard role's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `rule` (Block List, Min: 1) Rule defining a set of permissions for the role (see [below for nested schema](#nestedblock--rule)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the role that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the role. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the role, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the role must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this role that can be used by clients to determine when role has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this role. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `rule` + +Required: + +- `api_groups` (Set of String) Name of the APIGroup that contains the resources +- `resources` (Set of String) List of resources that the rule applies to +- `verbs` (Set of String) List of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule + +Optional: + +- `resource_names` (Set of String) White list of names that the rule applies to + + + + +## Example Usage + +```terraform +resource "kubernetes_role" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyRole" + } + } + + rule { + api_groups = [""] + resources = ["pods"] + resource_names = ["foo"] + verbs = ["get", "list", "watch"] + } + rule { + api_groups = ["apps"] + resources = ["deployments"] + verbs = ["get", "list"] + } +} +``` + +## Import + +Role can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_role.example default/terraform-example +``` diff --git a/docs/resources/role_binding.md b/docs/resources/role_binding.md new file mode 100644 index 0000000000..ab52884e7f --- /dev/null +++ b/docs/resources/role_binding.md @@ -0,0 +1,106 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role_binding" +description: |- + A RoleBinding may be used to grant permission at the namespace level. +--- + +# kubernetes_role_binding + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard roleBinding's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `role_ref` (Block List, Min: 1, Max: 1) RoleRef references the Role for this binding (see [below for nested schema](#nestedblock--role_ref)) +- `subject` (Block List, Min: 1) Subjects defines the entities to bind a Role to. (see [below for nested schema](#nestedblock--subject)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the roleBinding that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the roleBinding. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the roleBinding, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the roleBinding must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this roleBinding that can be used by clients to determine when roleBinding has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this roleBinding. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `role_ref` + +Required: + +- `api_group` (String) The API group of the user. The only value possible at the moment is `rbac.authorization.k8s.io`. +- `kind` (String) The kind of resource. +- `name` (String) The name of the User to bind to. + + + +### Nested Schema for `subject` + +Required: + +- `kind` (String) The kind of resource. +- `name` (String) The name of the resource to bind to. + +Optional: + +- `api_group` (String) The API group of the subject resource. +- `namespace` (String) The Namespace of the subject resource. + + + + +A RoleBinding may be used to grant permission at the namespace level + +## Example Usage + +```terraform +resource "kubernetes_role_binding" "example" { + metadata { + name = "terraform-example" + namespace = "default" + } + role_ref { + api_group = "rbac.authorization.k8s.io" + kind = "Role" + name = "admin" + } + subject { + kind = "User" + name = "admin" + api_group = "rbac.authorization.k8s.io" + } + subject { + kind = "ServiceAccount" + name = "default" + namespace = "kube-system" + } + subject { + kind = "Group" + name = "system:masters" + api_group = "rbac.authorization.k8s.io" + } +} +``` + +## Import + +RoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_role_binding.example default/terraform-name +``` diff --git a/docs/resources/role_binding_v1.md b/docs/resources/role_binding_v1.md new file mode 100644 index 0000000000..20ee650028 --- /dev/null +++ b/docs/resources/role_binding_v1.md @@ -0,0 +1,106 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role_binding_v1" +description: |- + A RoleBinding may be used to grant permission at the namespace level. +--- + +# kubernetes_role_binding_v1 + +A RoleBinding may be used to grant permission at the namespace level + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard roleBinding's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `role_ref` (Block List, Min: 1, Max: 1) RoleRef references the Role for this binding (see [below for nested schema](#nestedblock--role_ref)) +- `subject` (Block List, Min: 1) Subjects defines the entities to bind a Role to. (see [below for nested schema](#nestedblock--subject)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the roleBinding that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the roleBinding. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the roleBinding, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the roleBinding must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this roleBinding that can be used by clients to determine when roleBinding has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this roleBinding. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `role_ref` + +Required: + +- `api_group` (String) The API group of the user. The only value possible at the moment is `rbac.authorization.k8s.io`. +- `kind` (String) The kind of resource. +- `name` (String) The name of the User to bind to. + + + +### Nested Schema for `subject` + +Required: + +- `kind` (String) The kind of resource. +- `name` (String) The name of the resource to bind to. + +Optional: + +- `api_group` (String) The API group of the subject resource. +- `namespace` (String) The Namespace of the subject resource. + + + + +## Example Usage + +```terraform +resource "kubernetes_role_binding_v1" "example" { + metadata { + name = "terraform-example" + namespace = "default" + } + role_ref { + api_group = "rbac.authorization.k8s.io" + kind = "Role" + name = "admin" + } + subject { + kind = "User" + name = "admin" + api_group = "rbac.authorization.k8s.io" + } + subject { + kind = "ServiceAccount" + name = "default" + namespace = "kube-system" + } + subject { + kind = "Group" + name = "system:masters" + api_group = "rbac.authorization.k8s.io" + } +} +``` + +## Import + +RoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_role_binding_v1.example default/terraform-name +``` diff --git a/docs/resources/role_v1.md b/docs/resources/role_v1.md new file mode 100644 index 0000000000..aeb433d449 --- /dev/null +++ b/docs/resources/role_v1.md @@ -0,0 +1,89 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role_v1" +description: |- + A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). +--- + +# kubernetes_role_v1 + +A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard role's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `rule` (Block List, Min: 1) Rule defining a set of permissions for the role (see [below for nested schema](#nestedblock--rule)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the role that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the role. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the role, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the role must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this role that can be used by clients to determine when role has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this role. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `rule` + +Required: + +- `api_groups` (Set of String) Name of the APIGroup that contains the resources +- `resources` (Set of String) List of resources that the rule applies to +- `verbs` (Set of String) List of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule + +Optional: + +- `resource_names` (Set of String) White list of names that the rule applies to + + + + +## Example Usage + +```terraform +resource "kubernetes_role_v1" "example" { + metadata { + name = "terraform-example" + labels = { + test = "MyRole" + } + } + + rule { + api_groups = [""] + resources = ["pods"] + resource_names = ["foo"] + verbs = ["get", "list", "watch"] + } + rule { + api_groups = ["apps"] + resources = ["deployments"] + verbs = ["get", "list"] + } +} +``` + +## Import + +Role can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_role_v1.example default/terraform-example +``` diff --git a/docs/resources/runtime_class_v1.md b/docs/resources/runtime_class_v1.md new file mode 100644 index 0000000000..5e091ae917 --- /dev/null +++ b/docs/resources/runtime_class_v1.md @@ -0,0 +1,60 @@ +--- +subcategory: "node/v1" +page_title: "Kubernetes: kubernetes_runtime_class_v1" +description: |- + A runtime class is used to determine which container runtime is used to run all containers in a pod. +--- + +# kubernetes_runtime_class_v1 + +A runtime class is used to determine which container runtime is used to run all containers in a pod. + + +## Schema + +### Required + +- `handler` (String) Specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class +- `metadata` (Block List, Min: 1, Max: 1) Standard runtimeclass's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the runtimeclass that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the runtimeclass. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the runtimeclass, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this runtimeclass that can be used by clients to determine when runtimeclass has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this runtimeclass. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + + +## Example usage + +```terraform +resource "kubernetes_runtime_class_v1" "example" { + metadata { + name = "myclass" + } + handler = "abcdeagh" +} +``` + +## Import + +Runtime class can be imported using the name only, e.g. + +``` +$ terraform import kubernetes_runtime_class_v1.example myclass +``` diff --git a/docs/resources/secret.md b/docs/resources/secret.md new file mode 100644 index 0000000000..d2729d9983 --- /dev/null +++ b/docs/resources/secret.md @@ -0,0 +1,153 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_secret" +description: |- + The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. +--- + +# kubernetes_secret + +The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace. + +~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) + +~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard secret's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `binary_data` (Map of String, Sensitive) A map of the secret data in base64 encoding. Use this for binary data. +- `data` (Map of String, Sensitive) A map of the secret data. +- `immutable` (Boolean) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `type` (String) Type of secret +- `wait_for_service_account_token` (Boolean) Terraform will wait for the service account token to be created. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the secret that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the secret. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the secret, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the secret must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this secret. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_secret" "example" { + metadata { + name = "basic-auth" + } + + data = { + username = "admin" + password = "P4ssw0rd" + } + + type = "kubernetes.io/basic-auth" +} +``` + +## Example Usage (Docker config) + +### Docker config file + +```terraform +resource "kubernetes_secret" "example" { + metadata { + name = "docker-cfg" + } + + data = { + ".dockerconfigjson" = "${file("${path.module}/.docker/config.json")}" + } + + type = "kubernetes.io/dockerconfigjson" +} +``` + +### Username and password + +```terraform +resource "kubernetes_secret" "example" { + metadata { + name = "docker-cfg" + } + + type = "kubernetes.io/dockerconfigjson" + + data = { + ".dockerconfigjson" = jsonencode({ + auths = { + "${var.registry_server}" = { + "username" = var.registry_username + "password" = var.registry_password + "email" = var.registry_email + "auth" = base64encode("${var.registry_username}:${var.registry_password}") + } + } + }) + } +} +``` + +This is equivalent to the following kubectl command: + +```sh +$ kubectl create secret docker-registry docker-cfg --docker-server=${registry_server} --docker-username=${registry_username} --docker-password=${registry_password} --docker-email=${registry_email} +``` + +## Example Usage (Service account token) + +```terraform +resource "kubernetes_secret" "example" { + metadata { + annotations = { + "kubernetes.io/service-account.name" = "my-service-account" + } + + generate_name = "my-service-account-" + } + + type = "kubernetes.io/service-account-token" + wait_for_service_account_token = true +} +``` + +## Import + +Secret can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_secret.example default/my-secret +``` diff --git a/docs/resources/secret_v1.md b/docs/resources/secret_v1.md new file mode 100644 index 0000000000..2caa70b5e2 --- /dev/null +++ b/docs/resources/secret_v1.md @@ -0,0 +1,153 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_secret_v1" +description: |- + The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. +--- + +# kubernetes_secret_v1 + +The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace. + +~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) + +~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard secret's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `binary_data` (Map of String, Sensitive) A map of the secret data in base64 encoding. Use this for binary data. +- `data` (Map of String, Sensitive) A map of the secret data. +- `immutable` (Boolean) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `type` (String) Type of secret +- `wait_for_service_account_token` (Boolean) Terraform will wait for the service account token to be created. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the secret that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the secret. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the secret, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the secret must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this secret. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_secret_v1" "example" { + metadata { + name = "basic-auth" + } + + data = { + username = "admin" + password = "P4ssw0rd" + } + + type = "kubernetes.io/basic-auth" +} +``` + +## Example Usage (Docker config) + +### Docker config file + +```terraform +resource "kubernetes_secret_v1" "example" { + metadata { + name = "docker-cfg" + } + + data = { + ".dockerconfigjson" = "${file("${path.module}/.docker/config.json")}" + } + + type = "kubernetes.io/dockerconfigjson" +} +``` + +### Username and password + +```terraform +resource "kubernetes_secret_v1" "example" { + metadata { + name = "docker-cfg" + } + + type = "kubernetes.io/dockerconfigjson" + + data = { + ".dockerconfigjson" = jsonencode({ + auths = { + "${var.registry_server}" = { + "username" = var.registry_username + "password" = var.registry_password + "email" = var.registry_email + "auth" = base64encode("${var.registry_username}:${var.registry_password}") + } + } + }) + } +} +``` + +This is equivalent to the following kubectl command: + +```sh +$ kubectl create secret docker-registry docker-cfg --docker-server=${registry_server} --docker-username=${registry_username} --docker-password=${registry_password} --docker-email=${registry_email} +``` + +## Example Usage (Service account token) + +```terraform +resource "kubernetes_secret_v1" "example" { + metadata { + annotations = { + "kubernetes.io/service-account.name" = "my-service-account" + } + + generate_name = "my-service-account-" + } + + type = "kubernetes.io/service-account-token" + wait_for_service_account_token = true +} +``` + +## Import + +Secret can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_secret_v1.example default/my-secret +``` diff --git a/docs/resources/service.md b/docs/resources/service.md new file mode 100644 index 0000000000..b35b2ba51a --- /dev/null +++ b/docs/resources/service.md @@ -0,0 +1,250 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# kubernetes_service + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the behavior of a service. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_load_balancer` (Boolean) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. + +### Read-Only + +- `id` (String) The ID of this resource. +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `allocate_load_balancer_node_ports` (Boolean) Defines if `NodePorts` will be automatically allocated for services with type `LoadBalancer`. It may be set to `false` if the cluster load-balancer does not rely on `NodePorts`. If the caller requests specific `NodePorts` (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type `LoadBalancer`. Default is `true`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation +- `cluster_ip` (String) The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies +- `cluster_ips` (List of String) List of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise creation of the service will fail. If this field is not specified, it will be initialized from the `clusterIP` field. If this field is specified, clients must ensure that `clusterIPs[0]` and `clusterIP` have the same value. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies +- `external_ips` (Set of String) A list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. +- `external_name` (String) The external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires `type` to be `ExternalName`. +- `external_traffic_policy` (String) Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. More info: https://kubernetes.io/docs/tutorials/services/source-ip/ +- `health_check_node_port` (Number) Specifies the Healthcheck NodePort for the service. Only effects when type is set to `LoadBalancer` and external_traffic_policy is set to `Local`. +- `internal_traffic_policy` (String) Specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. `Cluster` routes internal traffic to a Service to all endpoints. `Local` routes traffic to node-local endpoints only, traffic is dropped if no node-local endpoints are ready. The default value is `Cluster`. +- `ip_families` (List of String) IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the ipFamilyPolicy field. If this field is specified manually, the requested family is available in the cluster, and ipFamilyPolicy allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. +- `ip_family_policy` (String) IPFamilyPolicy represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to SingleStack. Services can be 'SingleStack' (a single IP family), 'PreferDualStack' (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or 'RequireDualStack' (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. +- `load_balancer_class` (String) The class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix. This field can only be set when the Service type is `LoadBalancer`. If not set, the default load balancer implementation is used. This field can only be set when creating or updating a Service to type `LoadBalancer`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class +- `load_balancer_ip` (String) Only applies to `type = LoadBalancer`. LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying this field when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. +- `load_balancer_source_ranges` (Set of String) If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. More info: http://kubernetes.io/docs/user-guide/services-firewalls +- `port` (Block List) The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies (see [below for nested schema](#nestedblock--spec--port)) +- `publish_not_ready_addresses` (Boolean) When set to true, indicates that DNS implementations must publish the `notReadyAddresses` of subsets for the Endpoints associated with the Service. The default value is `false`. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate `SRV` records for its Pods without respect to their readiness for purpose of peer discovery. +- `selector` (Map of String) Route service traffic to pods with label keys and values matching this selector. Only applies to types `ClusterIP`, `NodePort`, and `LoadBalancer`. More info: https://kubernetes.io/docs/concepts/services-networking/service/ +- `session_affinity` (String) Used to maintain session affinity. Supports `ClientIP` and `None`. Defaults to `None`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies +- `session_affinity_config` (Block List, Max: 1) Contains the configurations of session affinity. More info: https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs (see [below for nested schema](#nestedblock--spec--session_affinity_config)) +- `type` (String) Determines how the service is exposed. Defaults to `ClusterIP`. Valid options are `ExternalName`, `ClusterIP`, `NodePort`, and `LoadBalancer`. `ExternalName` maps to the specified `external_name`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + + +### Nested Schema for `spec.port` + +Required: + +- `port` (Number) The port that will be exposed by this service. + +Optional: + +- `app_protocol` (String) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. +- `name` (String) The name of this port within the service. All ports within the service must have unique names. Optional if only one ServicePort is defined on this service. +- `node_port` (Number) The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport +- `protocol` (String) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. +- `target_port` (String) Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service + + + +### Nested Schema for `spec.session_affinity_config` + +Optional: + +- `client_ip` (Block List, Max: 1) Contains the configurations of Client IP based session affinity. (see [below for nested schema](#nestedblock--spec--session_affinity_config--client_ip)) + + +### Nested Schema for `spec.session_affinity_config.client_ip` + +Optional: + +- `timeout_seconds` (Number) Specifies the seconds of `ClientIP` type session sticky time. The value must be > 0 and <= 86400(for 1 day) if `ServiceAffinity` == `ClientIP`. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +resource "kubernetes_service" "example" { + metadata { + name = "terraform-example" + } + spec { + selector = { + app = kubernetes_pod.example.metadata.0.labels.app + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "LoadBalancer" + } +} + +resource "kubernetes_pod" "example" { + metadata { + name = "terraform-example" + labels = { + app = "MyApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + } + } +} +``` + +## Example using AWS load balancer + +```terraform +variable "cluster_name" { + type = string +} + +data "aws_eks_cluster" "example" { + name = var.cluster_name +} + +data "aws_eks_cluster_auth" "example" { + name = var.cluster_name +} + +provider "aws" { + region = "us-west-1" +} + +provider "kubernetes" { + host = data.aws_eks_cluster.example.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.example.certificate_authority[0].data) + exec { + api_version = "client.authentication.k8s.io/v1beta1" + args = ["eks", "get-token", "--cluster-name", var.cluster_name] + command = "aws" + } +} + +resource "kubernetes_service" "example" { + metadata { + name = "example" + } + spec { + port { + port = 8080 + target_port = 80 + } + type = "LoadBalancer" + } +} + +# Create a local variable for the load balancer name. +locals { + lb_name = split("-", split(".", kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname).0).0 +} + +# Read information about the load balancer using the AWS provider. +data "aws_elb" "example" { + name = local.lb_name +} + +output "load_balancer_name" { + value = local.lb_name +} + +output "load_balancer_hostname" { + value = kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname +} + +output "load_balancer_info" { + value = data.aws_elb.example +} +``` + +## Import + +Service can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_service.example default/terraform-name +``` diff --git a/docs/resources/service_account.md b/docs/resources/service_account.md new file mode 100644 index 0000000000..645290bbc7 --- /dev/null +++ b/docs/resources/service_account.md @@ -0,0 +1,106 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# kubernetes_service_account + +A service account provides an identity for processes that run in a Pod. + +Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service account's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `automount_service_account_token` (Boolean) Enable automatic mounting of the service account token +- `image_pull_secret` (Block Set) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod (see [below for nested schema](#nestedblock--image_pull_secret)) +- `secret` (Block Set) A list of secrets allowed to be used by pods running using this Service Account. More info: https://kubernetes.io/docs/concepts/configuration/secret (see [below for nested schema](#nestedblock--secret)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `default_secret_name` (String, Deprecated) +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service account, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service account must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service account. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `image_pull_secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_service_account" "example" { + metadata { + name = "terraform-example" + } +} + +resource "kubernetes_secret" "example" { + metadata { + annotations = { + "kubernetes.io/service-account.name" = kubernetes_service_account.example.metadata.0.name + } + + generate_name = "terraform-example-" + } + + type = "kubernetes.io/service-account-token" + wait_for_service_account_token = true +} +``` + +## Import + +Service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_service_account.example default/terraform-example +``` diff --git a/docs/resources/service_account_v1.md b/docs/resources/service_account_v1.md new file mode 100644 index 0000000000..c595863fd9 --- /dev/null +++ b/docs/resources/service_account_v1.md @@ -0,0 +1,104 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account_v1" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# kubernetes_service_account_v1 + +A service account provides an identity for processes that run in a Pod. Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service account's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `automount_service_account_token` (Boolean) Enable automatic mounting of the service account token +- `image_pull_secret` (Block Set) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod (see [below for nested schema](#nestedblock--image_pull_secret)) +- `secret` (Block Set) A list of secrets allowed to be used by pods running using this Service Account. More info: https://kubernetes.io/docs/concepts/configuration/secret (see [below for nested schema](#nestedblock--secret)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `default_secret_name` (String, Deprecated) +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service account, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service account must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service account. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `image_pull_secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `secret` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_service_account_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "kubernetes_secret_v1" "example" { + metadata { + annotations = { + "kubernetes.io/service-account.name" = kubernetes_service_account_v1.example.metadata.0.name + } + + generate_name = "terraform-example-" + } + + type = "kubernetes.io/service-account-token" + wait_for_service_account_token = true +} +``` + +## Import + +Service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_service_account_v1.example default/terraform-example +``` diff --git a/docs/resources/service_v1.md b/docs/resources/service_v1.md new file mode 100644 index 0000000000..006428ce48 --- /dev/null +++ b/docs/resources/service_v1.md @@ -0,0 +1,250 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_v1" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# kubernetes_service_v1 + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard service's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the behavior of a service. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_load_balancer` (Boolean) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. + +### Read-Only + +- `id` (String) The ID of this resource. +- `status` (List of Object) (see [below for nested schema](#nestedatt--status)) + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the service that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the service, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the service must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this service. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `allocate_load_balancer_node_ports` (Boolean) Defines if `NodePorts` will be automatically allocated for services with type `LoadBalancer`. It may be set to `false` if the cluster load-balancer does not rely on `NodePorts`. If the caller requests specific `NodePorts` (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type `LoadBalancer`. Default is `true`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation +- `cluster_ip` (String) The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies +- `cluster_ips` (List of String) List of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise creation of the service will fail. If this field is not specified, it will be initialized from the `clusterIP` field. If this field is specified, clients must ensure that `clusterIPs[0]` and `clusterIP` have the same value. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies +- `external_ips` (Set of String) A list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. +- `external_name` (String) The external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires `type` to be `ExternalName`. +- `external_traffic_policy` (String) Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. More info: https://kubernetes.io/docs/tutorials/services/source-ip/ +- `health_check_node_port` (Number) Specifies the Healthcheck NodePort for the service. Only effects when type is set to `LoadBalancer` and external_traffic_policy is set to `Local`. +- `internal_traffic_policy` (String) Specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. `Cluster` routes internal traffic to a Service to all endpoints. `Local` routes traffic to node-local endpoints only, traffic is dropped if no node-local endpoints are ready. The default value is `Cluster`. +- `ip_families` (List of String) IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the ipFamilyPolicy field. If this field is specified manually, the requested family is available in the cluster, and ipFamilyPolicy allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. +- `ip_family_policy` (String) IPFamilyPolicy represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to SingleStack. Services can be 'SingleStack' (a single IP family), 'PreferDualStack' (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or 'RequireDualStack' (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. +- `load_balancer_class` (String) The class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix. This field can only be set when the Service type is `LoadBalancer`. If not set, the default load balancer implementation is used. This field can only be set when creating or updating a Service to type `LoadBalancer`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class +- `load_balancer_ip` (String) Only applies to `type = LoadBalancer`. LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying this field when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. +- `load_balancer_source_ranges` (Set of String) If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. More info: http://kubernetes.io/docs/user-guide/services-firewalls +- `port` (Block List) The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies (see [below for nested schema](#nestedblock--spec--port)) +- `publish_not_ready_addresses` (Boolean) When set to true, indicates that DNS implementations must publish the `notReadyAddresses` of subsets for the Endpoints associated with the Service. The default value is `false`. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate `SRV` records for its Pods without respect to their readiness for purpose of peer discovery. +- `selector` (Map of String) Route service traffic to pods with label keys and values matching this selector. Only applies to types `ClusterIP`, `NodePort`, and `LoadBalancer`. More info: https://kubernetes.io/docs/concepts/services-networking/service/ +- `session_affinity` (String) Used to maintain session affinity. Supports `ClientIP` and `None`. Defaults to `None`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies +- `session_affinity_config` (Block List, Max: 1) Contains the configurations of session affinity. More info: https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs (see [below for nested schema](#nestedblock--spec--session_affinity_config)) +- `type` (String) Determines how the service is exposed. Defaults to `ClusterIP`. Valid options are `ExternalName`, `ClusterIP`, `NodePort`, and `LoadBalancer`. `ExternalName` maps to the specified `external_name`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + + +### Nested Schema for `spec.port` + +Required: + +- `port` (Number) The port that will be exposed by this service. + +Optional: + +- `app_protocol` (String) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. +- `name` (String) The name of this port within the service. All ports within the service must have unique names. Optional if only one ServicePort is defined on this service. +- `node_port` (Number) The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport +- `protocol` (String) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. +- `target_port` (String) Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service + + + +### Nested Schema for `spec.session_affinity_config` + +Optional: + +- `client_ip` (Block List, Max: 1) Contains the configurations of Client IP based session affinity. (see [below for nested schema](#nestedblock--spec--session_affinity_config--client_ip)) + + +### Nested Schema for `spec.session_affinity_config.client_ip` + +Optional: + +- `timeout_seconds` (Number) Specifies the seconds of `ClientIP` type session sticky time. The value must be > 0 and <= 86400(for 1 day) if `ServiceAffinity` == `ClientIP`. + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) + + + +### Nested Schema for `status` + +Read-Only: + +- `load_balancer` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer)) + + +### Nested Schema for `status.load_balancer` + +Read-Only: + +- `ingress` (List of Object) (see [below for nested schema](#nestedobjatt--status--load_balancer--ingress)) + + +### Nested Schema for `status.load_balancer.ingress` + +Read-Only: + +- `hostname` (String) +- `ip` (String) + + + + + + +## Example Usage + +```terraform +resource "kubernetes_service_v1" "example" { + metadata { + name = "terraform-example" + } + spec { + selector = { + app = kubernetes_pod.example.metadata.0.labels.app + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "LoadBalancer" + } +} + +resource "kubernetes_pod" "example" { + metadata { + name = "terraform-example" + labels = { + app = "MyApp" + } + } + + spec { + container { + image = "nginx:1.21.6" + name = "example" + } + } +} +``` + +## Example using AWS load balancer + +```terraform +variable "cluster_name" { + type = string +} + +data "aws_eks_cluster" "example" { + name = var.cluster_name +} + +data "aws_eks_cluster_auth" "example" { + name = var.cluster_name +} + +provider "aws" { + region = "us-west-1" +} + +provider "kubernetes" { + host = data.aws_eks_cluster.example.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.example.certificate_authority[0].data) + exec { + api_version = "client.authentication.k8s.io/v1beta1" + args = ["eks", "get-token", "--cluster-name", var.cluster_name] + command = "aws" + } +} + +resource "kubernetes_service_v1" "example" { + metadata { + name = "example" + } + spec { + port { + port = 8080 + target_port = 80 + } + type = "LoadBalancer" + } +} + +# Create a local variable for the load balancer name. +locals { + lb_name = split("-", split(".", kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname).0).0 +} + +# Read information about the load balancer using the AWS provider. +data "aws_elb" "example" { + name = local.lb_name +} + +output "load_balancer_name" { + value = local.lb_name +} + +output "load_balancer_hostname" { + value = kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname +} + +output "load_balancer_info" { + value = data.aws_elb.example +} +``` + +## Import + +Service can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_service_v1.example default/terraform-name +``` diff --git a/docs/resources/stateful_set.md b/docs/resources/stateful_set.md new file mode 100644 index 0000000000..47c337c3b2 --- /dev/null +++ b/docs/resources/stateful_set.md @@ -0,0 +1,2547 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_stateful_set" +description: |- + StatefulSet is a Kubernetes resource used to manage stateful applications. +--- + +# kubernetes_stateful_set + +Manages the deployment and scaling of a set of Pods , and provides guarantees about the ordering and uniqueness of these Pods. + +Like a Deployment , a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling. + +A StatefulSet operates under the same pattern as any other Controller. You define your desired state in a StatefulSet object, and the StatefulSet controller makes any necessary updates to get there from the current state. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard stateful set's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the desired identities of pods in this set. (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_rollout` (Boolean) Wait for the rollout of the stateful set to complete. Defaults to true. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the stateful set that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the stateful set. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the stateful set, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the stateful set must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this stateful set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `selector` (Block List, Min: 1, Max: 1) A label query over pods that should match the replica count. It must match the pod template's labels. (see [below for nested schema](#nestedblock--spec--selector)) +- `service_name` (String) 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. +- `template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `persistent_volume_claim_retention_policy` (Block List) The field controls if and how PVCs are deleted during the lifecycle of a StatefulSet. (see [below for nested schema](#nestedblock--spec--persistent_volume_claim_retention_policy)) +- `pod_management_policy` (String) Controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. +- `replicas` (String) The desired number of replicas of the given Template, in the sense that they are instantiations of the same Template. Value must be a positive integer. +- `revision_history_limit` (Number) The maximum number of revisions that will be maintained in the StatefulSet's revision history. The default value is 10. +- `update_strategy` (Block List) The strategy that the StatefulSet controller will use to perform updates. (see [below for nested schema](#nestedblock--spec--update_strategy)) +- `volume_claim_template` (Block List) A list of claims that pods are allowed to reference. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. (see [below for nested schema](#nestedblock--spec--volume_claim_template)) + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard stateful set's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the stateful set (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the stateful set that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the stateful set. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the stateful set, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the stateful set must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this stateful set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.persistent_volume_claim_retention_policy` + +Optional: + +- `when_deleted` (String) This field controls what happens when a Statefulset is deleted. Default is Retain. +- `when_scaled` (String) This field controls what happens when a Statefulset is scaled. Default is Retain. + + + +### Nested Schema for `spec.update_strategy` + +Optional: + +- `rolling_update` (Block List) RollingUpdate strategy type for StatefulSet (see [below for nested schema](#nestedblock--spec--update_strategy--rolling_update)) +- `type` (String) Indicates the type of the StatefulSet update strategy. Default is RollingUpdate + + +### Nested Schema for `spec.update_strategy.rolling_update` + +Optional: + +- `partition` (Number) Indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0. + + + + +### Nested Schema for `spec.volume_claim_template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume claim's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--volume_claim_template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec)) + + +### Nested Schema for `spec.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume claim, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the persistent volume claim must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume claim. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `read` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_stateful_set" "prometheus" { + metadata { + annotations = { + SomeAnnotation = "foobar" + } + + labels = { + k8s-app = "prometheus" + "kubernetes.io/cluster-service" = "true" + "addonmanager.kubernetes.io/mode" = "Reconcile" + version = "v2.2.1" + } + + name = "prometheus" + } + + spec { + pod_management_policy = "Parallel" + replicas = 1 + revision_history_limit = 5 + + selector { + match_labels = { + k8s-app = "prometheus" + } + } + + service_name = "prometheus" + + template { + metadata { + labels = { + k8s-app = "prometheus" + } + + annotations = {} + } + + spec { + service_account_name = "prometheus" + + init_container { + name = "init-chown-data" + image = "busybox:latest" + image_pull_policy = "IfNotPresent" + command = ["chown", "-R", "65534:65534", "/data"] + + volume_mount { + name = "prometheus-data" + mount_path = "/data" + sub_path = "" + } + } + + container { + name = "prometheus-server-configmap-reload" + image = "jimmidyson/configmap-reload:v0.1" + image_pull_policy = "IfNotPresent" + + args = [ + "--volume-dir=/etc/config", + "--webhook-url=http://localhost:9090/-/reload", + ] + + volume_mount { + name = "config-volume" + mount_path = "/etc/config" + read_only = true + } + + resources { + limits = { + cpu = "10m" + memory = "10Mi" + } + + requests = { + cpu = "10m" + memory = "10Mi" + } + } + } + + container { + name = "prometheus-server" + image = "prom/prometheus:v2.2.1" + image_pull_policy = "IfNotPresent" + + args = [ + "--config.file=/etc/config/prometheus.yml", + "--storage.tsdb.path=/data", + "--web.console.libraries=/etc/prometheus/console_libraries", + "--web.console.templates=/etc/prometheus/consoles", + "--web.enable-lifecycle", + ] + + port { + container_port = 9090 + } + + resources { + limits = { + cpu = "200m" + memory = "1000Mi" + } + + requests = { + cpu = "200m" + memory = "1000Mi" + } + } + + volume_mount { + name = "config-volume" + mount_path = "/etc/config" + } + + volume_mount { + name = "prometheus-data" + mount_path = "/data" + sub_path = "" + } + + readiness_probe { + http_get { + path = "/-/ready" + port = 9090 + } + + initial_delay_seconds = 30 + timeout_seconds = 30 + } + + liveness_probe { + http_get { + path = "/-/healthy" + port = 9090 + scheme = "HTTPS" + } + + initial_delay_seconds = 30 + timeout_seconds = 30 + } + } + + termination_grace_period_seconds = 300 + + volume { + name = "config-volume" + + config_map { + name = "prometheus-config" + } + } + } + } + + update_strategy { + type = "RollingUpdate" + + rolling_update { + partition = 1 + } + } + + volume_claim_template { + metadata { + name = "prometheus-data" + } + + spec { + access_modes = ["ReadWriteOnce"] + storage_class_name = "standard" + + resources { + requests = { + storage = "16Gi" + } + } + } + } + + persistent_volume_claim_retention_policy { + when_deleted = "Delete" + when_scaled = "Delete" + } + } +} +``` + +## Import + +kubernetes_stateful_set can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_stateful_set.example default/terraform-example +``` diff --git a/docs/resources/stateful_set_v1.md b/docs/resources/stateful_set_v1.md new file mode 100644 index 0000000000..0b77a7fb5d --- /dev/null +++ b/docs/resources/stateful_set_v1.md @@ -0,0 +1,2543 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_stateful_set_v1" +description: |- + StatefulSet is a Kubernetes resource used to manage stateful applications. +--- + +# kubernetes_stateful_set_v1 + +Manages the deployment and scaling of a set of Pods , and provides guarantees about the ordering and uniqueness of these Pods. Like a Deployment , a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling. A StatefulSet operates under the same pattern as any other Controller. You define your desired state in a StatefulSet object, and the StatefulSet controller makes any necessary updates to get there from the current state. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard stateful set's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the desired identities of pods in this set. (see [below for nested schema](#nestedblock--spec)) + +### Optional + +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `wait_for_rollout` (Boolean) Wait for the rollout of the stateful set to complete. Defaults to true. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the stateful set that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the stateful set. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the stateful set, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the stateful set must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this stateful set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Required: + +- `selector` (Block List, Min: 1, Max: 1) A label query over pods that should match the replica count. It must match the pod template's labels. (see [below for nested schema](#nestedblock--spec--selector)) +- `service_name` (String) 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. +- `template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template)) + +Optional: + +- `persistent_volume_claim_retention_policy` (Block List) The field controls if and how PVCs are deleted during the lifecycle of a StatefulSet. (see [below for nested schema](#nestedblock--spec--persistent_volume_claim_retention_policy)) +- `pod_management_policy` (String) Controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. +- `replicas` (String) The desired number of replicas of the given Template, in the sense that they are instantiations of the same Template. Value must be a positive integer. +- `revision_history_limit` (Number) The maximum number of revisions that will be maintained in the StatefulSet's revision history. The default value is 10. +- `update_strategy` (Block List) The strategy that the StatefulSet controller will use to perform updates. (see [below for nested schema](#nestedblock--spec--update_strategy)) +- `volume_claim_template` (Block List) A list of claims that pods are allowed to reference. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. (see [below for nested schema](#nestedblock--spec--volume_claim_template)) + + +### Nested Schema for `spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `spec.template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard stateful set's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--template--metadata)) + +Optional: + +- `spec` (Block List, Max: 1) Spec of the pods owned by the stateful set (see [below for nested schema](#nestedblock--spec--template--spec)) + + +### Nested Schema for `spec.template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the stateful set that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the stateful set. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the stateful set, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the stateful set must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this stateful set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.template.spec` + +Optional: + +- `active_deadline_seconds` (Number) 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. +- `affinity` (Block List, Max: 1) Optional pod scheduling constraints. (see [below for nested schema](#nestedblock--spec--template--spec--affinity)) +- `automount_service_account_token` (Boolean) AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +- `container` (Block List) 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. More info: https://kubernetes.io/docs/concepts/containers/ (see [below for nested schema](#nestedblock--spec--template--spec--container)) +- `dns_config` (Block List, Max: 1) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--dns_config)) +- `dns_policy` (String) Set DNS policy for containers within the pod. 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'. Defaults to 'ClusterFirst'. More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy +- `enable_service_links` (Boolean) Enables generating environment variables for service discovery. Defaults to true. +- `host_aliases` (Block List) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. (see [below for nested schema](#nestedblock--spec--template--spec--host_aliases)) +- `host_ipc` (Boolean) Use the host's ipc namespace. Optional: Defaults to false. +- `host_network` (Boolean) 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. +- `host_pid` (Boolean) Use the host's pid namespace. +- `hostname` (String) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +- `image_pull_secrets` (Block List) 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 (see [below for nested schema](#nestedblock--spec--template--spec--image_pull_secrets)) +- `init_container` (Block List) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container)) +- `node_name` (String) 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. +- `node_selector` (Map of String) 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/. +- `os` (Block List, Max: 1) Specifies the OS of the containers in the pod. (see [below for nested schema](#nestedblock--spec--template--spec--os)) +- `priority_class_name` (String) 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. +- `readiness_gate` (Block List) 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/0007-pod-ready%2B%2B.md (see [below for nested schema](#nestedblock--spec--template--spec--readiness_gate)) +- `restart_policy` (String) Restart policy for all containers within the pod. One of Always, OnFailure, Never. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy. +- `runtime_class_name` (String) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. More info: https://kubernetes.io/docs/concepts/containers/runtime-class +- `scheduler_name` (String) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +- `security_context` (Block List, Max: 1) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--security_context)) +- `service_account_name` (String) ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md. +- `share_process_namespace` (Boolean) 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: Defaults to false. +- `subdomain` (String) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. +- `termination_grace_period_seconds` (Number) 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 delete immediately. 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. +- `toleration` (Block List) If specified, the pod's toleration. Optional: Defaults to empty (see [below for nested schema](#nestedblock--spec--template--spec--toleration)) +- `topology_spread_constraint` (Block List) describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint)) +- `volume` (Block List) List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume)) + + +### Nested Schema for `spec.template.spec.affinity` + +Optional: + +- `node_affinity` (Block List, Max: 1) Node affinity scheduling rules for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity)) +- `pod_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity)) +- `pod_anti_affinity` (Block List, Max: 1) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List, Max: 1) 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 node label update), the system may or may not try to eventually evict the pod from its node. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `preference` (Block List, Min: 1, Max: 1) A node selector term, associated with the corresponding weight. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference)) +- `weight` (Number) weight is in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--preferred_during_scheduling_ignored_during_execution--preference--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.preferred_during_scheduling_ignored_during_execution.preference.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution` + +Optional: + +- `node_selector_term` (Block List) List of node selector terms. The terms are ORed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term` + +Optional: + +- `match_expressions` (Block List) List of node selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_expressions)) +- `match_fields` (Block List) A list of node selector requirements by node's fields. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--node_affinity--required_during_scheduling_ignored_during_execution--node_selector_term--match_fields)) + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. +- `values` (Set of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.affinity.node_affinity.required_during_scheduling_ignored_during_execution.node_selector_term.match_fields` + +Required: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, and `Lt`. + +Optional: + +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity` + +Optional: + +- `preferred_during_scheduling_ignored_during_execution` (Block List) 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 matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution)) +- `required_during_scheduling_ignored_during_execution` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution)) + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution` + +Required: + +- `pod_affinity_term` (Block List, Min: 1, Max: 1) A pod affinity term, associated with the corresponding weight (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term)) +- `weight` (Number) weight associated with matching the corresponding podAffinityTerm, in the range 1-100 + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--preferred_during_scheduling_ignored_during_execution--pod_affinity_term--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.preferred_during_scheduling_ignored_during_execution.pod_affinity_term.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution` + +Required: + +- `topology_key` (String) empty topology key is interpreted by the scheduler as 'all topologies' + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector)) +- `namespaces` (Set of String) namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace' + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--affinity--pod_anti_affinity--required_during_scheduling_ignored_during_execution--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.affinity.pod_anti_affinity.required_during_scheduling_ignored_during_execution.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `spec.template.spec.container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from)) + + +### Nested Schema for `spec.template.spec.container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.dns_config` + +Optional: + +- `nameservers` (List of String) A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. +- `option` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--dns_config--option)) +- `searches` (List of String) 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. + + +### Nested Schema for `spec.template.spec.dns_config.option` + +Required: + +- `name` (String) Name of the option. + +Optional: + +- `value` (String) Value of the option. Optional: Defaults to empty. + + + + +### Nested Schema for `spec.template.spec.host_aliases` + +Required: + +- `hostnames` (List of String) Hostnames for the IP address. +- `ip` (String) IP address of the host file entry. + + + +### Nested Schema for `spec.template.spec.image_pull_secrets` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + +### Nested Schema for `spec.template.spec.init_container` + +Required: + +- `name` (String) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + +Optional: + +- `args` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `command` (List of String) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(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 +- `env` (Block List) List of environment variables to set in the container. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env)) +- `env_from` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from)) +- `image` (String) Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images/ +- `image_pull_policy` (String) 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 +- `lifecycle` (Block List, Max: 1) Actions that the management system should take in response to container lifecycle events (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle)) +- `liveness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe)) +- `port` (Block List) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--port)) +- `readiness_probe` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe)) +- `resources` (Block List, Max: 1) Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--init_container--resources)) +- `security_context` (Block List, Max: 1) Security options the pod should run with. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context)) +- `startup_probe` (Block List, Max: 1) 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. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe)) +- `stdin` (Boolean) 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. +- `stdin_once` (Boolean) 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. +- `termination_message_path` (String) 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. Defaults to /dev/termination-log. Cannot be updated. +- `termination_message_policy` (String) Optional: 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. +- `tty` (Boolean) Whether this container should allocate a TTY for itself +- `volume_mount` (Block List) Pod volumes to mount into the container's filesystem. Cannot be updated. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--volume_mount)) +- `working_dir` (String) 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. + + +### Nested Schema for `spec.template.spec.init_container.env` + +Required: + +- `name` (String) Name of the environment variable. Must be a C_IDENTIFIER + +Optional: + +- `value` (String) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". +- `value_from` (Block List, Max: 1) Source for the environment variable's value (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from` + +Optional: + +- `config_map_key_ref` (Block List, Max: 1) Selects a key of a ConfigMap. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--config_map_key_ref)) +- `field_ref` (Block List, Max: 1) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--field_ref)) +- `resource_field_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--resource_field_ref)) +- `secret_key_ref` (Block List, Max: 1) Selects a key of a secret in the pod's namespace. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env--value_from--secret_key_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.config_map_key_ref` + +Optional: + +- `key` (String) The key to select. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the ConfigMap or its key must be defined. + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.resource_field_ref` + +Required: + +- `resource` (String) Resource to select + +Optional: + +- `container_name` (String) +- `divisor` (String) + + + +### Nested Schema for `spec.template.spec.init_container.env.value_from.secret_key_ref` + +Optional: + +- `key` (String) The key of the secret to select from. Must be a valid secret key. +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Specify whether the Secret or its key must be defined. + + + + + +### Nested Schema for `spec.template.spec.init_container.env_from` + +Optional: + +- `config_map_ref` (Block List, Max: 1) The ConfigMap to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--config_map_ref)) +- `prefix` (String) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. +- `secret_ref` (Block List, Max: 1) The Secret to select from (see [below for nested schema](#nestedblock--spec--template--spec--init_container--env_from--secret_ref)) + + +### Nested Schema for `spec.template.spec.init_container.env_from.config_map_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the ConfigMap must be defined + + + +### Nested Schema for `spec.template.spec.init_container.env_from.secret_ref` + +Required: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Optional: + +- `optional` (Boolean) Specify whether the Secret must be defined + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle` + +Optional: + +- `post_start` (Block List) post_start 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 (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start)) +- `pre_stop` (Block List) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--post_start--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.post_start.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--exec)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get)) +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--tcp_socket)) + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--lifecycle--pre_stop--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.lifecycle.pre_stop.tcp_socket` + +Required: + +- `port` (String) 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. + + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--liveness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.liveness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.port` + +Required: + +- `container_port` (Number) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + +Optional: + +- `host_ip` (String) What host IP to bind the external port to. +- `host_port` (Number) 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. +- `name` (String) 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 +- `protocol` (String) Protocol for port. Must be UDP or TCP. Defaults to "TCP". + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--readiness_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.readiness_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.resources` + +Optional: + +- `limits` (Map of String) Describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) 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-compute-resources-container/ + + + +### Nested Schema for `spec.template.spec.init_container.security_context` + +Optional: + +- `allow_privilege_escalation` (Boolean) 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 +- `capabilities` (Block List, Max: 1) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--capabilities)) +- `privileged` (Boolean) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. +- `read_only_root_filesystem` (Boolean) Whether this container has a read-only root filesystem. Default is false. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--security_context--seccomp_profile)) + + +### Nested Schema for `spec.template.spec.init_container.security_context.capabilities` + +Optional: + +- `add` (List of String) Added capabilities +- `drop` (List of String) Removed capabilities + + + +### Nested Schema for `spec.template.spec.init_container.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.init_container.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe` + +Optional: + +- `exec` (Block List, Max: 1) exec specifies the action to take. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--exec)) +- `failure_threshold` (Number) Minimum consecutive failures for the probe to be considered failed after having succeeded. +- `grpc` (Block List) GRPC specifies an action involving a GRPC port. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--grpc)) +- `http_get` (Block List, Max: 1) Specifies the http request to perform. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get)) +- `initial_delay_seconds` (Number) 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 +- `period_seconds` (Number) How often (in seconds) to perform the probe +- `success_threshold` (Number) Minimum consecutive successes for the probe to be considered successful after having failed. +- `tcp_socket` (Block List) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--tcp_socket)) +- `timeout_seconds` (Number) Number of seconds after which the probe times out. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.exec` + +Optional: + +- `command` (List of String) 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. 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. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.grpc` + +Required: + +- `port` (Number) Number of the port to access on the container. Number must be in the range 1 to 65535. + +Optional: + +- `service` (String) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get` + +Optional: + +- `host` (String) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. +- `http_header` (Block List) Scheme to use for connecting to the host. (see [below for nested schema](#nestedblock--spec--template--spec--init_container--startup_probe--http_get--http_header)) +- `path` (String) Path to access on the HTTP server. +- `port` (String) 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. +- `scheme` (String) Scheme to use for connecting to the host. + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.http_get.http_header` + +Optional: + +- `name` (String) The header field name +- `value` (String) The header field value + + + + +### Nested Schema for `spec.template.spec.init_container.startup_probe.tcp_socket` + +Required: + +- `port` (String) 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. + + + + +### Nested Schema for `spec.template.spec.init_container.volume_mount` + +Required: + +- `mount_path` (String) Path within the container at which the volume should be mounted. Must not contain ':'. +- `name` (String) This must match the Name of a Volume. + +Optional: + +- `mount_propagation` (String) Mount propagation mode. mount_propagation determines how mounts are propagated from the host to container and the other way around. Valid values are None (default), HostToContainer and Bidirectional. +- `read_only` (Boolean) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. +- `sub_path` (String) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + + + + +### Nested Schema for `spec.template.spec.os` + +Required: + +- `name` (String) Name is the name of the operating system. The currently supported values are linux and windows. + + + +### Nested Schema for `spec.template.spec.readiness_gate` + +Required: + +- `condition_type` (String) refers to a condition in the pod's condition list with matching type. + + + +### Nested Schema for `spec.template.spec.security_context` + +Optional: + +- `fs_group` (String) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. +- `fs_group_change_policy` (String) 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. +- `run_as_group` (String) 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. +- `run_as_non_root` (Boolean) 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. +- `run_as_user` (String) 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. +- `se_linux_options` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--se_linux_options)) +- `seccomp_profile` (Block List, Max: 1) The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--seccomp_profile)) +- `supplemental_groups` (Set of Number) 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. +- `sysctl` (Block List) holds a list of namespaced sysctls used for the pod. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--sysctl)) +- `windows_options` (Block List, Max: 1) 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. Note that this field cannot be set when spec.os.name is linux. (see [below for nested schema](#nestedblock--spec--template--spec--security_context--windows_options)) + + +### Nested Schema for `spec.template.spec.security_context.se_linux_options` + +Optional: + +- `level` (String) Level is SELinux level label that applies to the container. +- `role` (String) Role is a SELinux role label that applies to the container. +- `type` (String) Type is a SELinux type label that applies to the container. +- `user` (String) User is a SELinux user label that applies to the container. + + + +### Nested Schema for `spec.template.spec.security_context.seccomp_profile` + +Optional: + +- `localhost_profile` (String) Localhost Profile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. +- `type` (String) Type indicates which kind of seccomp profile will be applied. Valid options are: Localhost, RuntimeDefault, Unconfined. + + + +### Nested Schema for `spec.template.spec.security_context.sysctl` + +Required: + +- `name` (String) Name of a property to set. +- `value` (String) Value of a property to set. + + + +### Nested Schema for `spec.template.spec.security_context.windows_options` + +Optional: + +- `gmsa_credential_spec` (String) GMSACredentialSpec is where the GMSA admission webhook inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field +- `gmsa_credential_spec_name` (String) GMSACredentialSpecName is the name of the GMSA credential spec to use. +- `host_process` (Boolean) HostProcess determines if a container should be run as a 'Host Process' container. Default value is false. +- `run_as_username` (String) 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. + + + + +### Nested Schema for `spec.template.spec.toleration` + +Optional: + +- `effect` (String) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. +- `key` (String) 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. +- `operator` (String) 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. +- `toleration_seconds` (String) 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. +- `value` (String) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + + + +### Nested Schema for `spec.template.spec.topology_spread_constraint` + +Optional: + +- `label_selector` (Block List) A label query over a set of resources, in this case pods. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector)) +- `match_label_keys` (Set of String) is a set of pod label keys to select the pods over which spreading will be calculated. +- `max_skew` (Number) describes the degree to which pods may be unevenly distributed. +- `min_domains` (Number) indicates a minimum number of eligible domains. +- `node_affinity_policy` (String) indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. +- `node_taints_policy` (String) indicates how we will treat node taints when calculating pod topology spread skew. +- `topology_key` (String) the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. +- `when_unsatisfiable` (String) indicates how to deal with a pod if it doesn't satisfy the spread constraint. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--topology_spread_constraint--label_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.topology_spread_constraint.label_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume` + +Optional: + +- `aws_elastic_block_store` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--aws_elastic_block_store)) +- `azure_disk` (Block List, Max: 1) Represents an Azure Data Disk mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_disk)) +- `azure_file` (Block List, Max: 1) Represents an Azure File Service mount on the host and bind mount to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--azure_file)) +- `ceph_fs` (Block List, Max: 1) Represents a Ceph FS mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs)) +- `cinder` (Block List, Max: 1) Represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--cinder)) +- `config_map` (Block List, Max: 1) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map)) +- `csi` (Block List, Max: 1) Represents a CSI Volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#csi (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api)) +- `empty_dir` (Block List, Max: 1) EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir (see [below for nested schema](#nestedblock--spec--template--spec--volume--empty_dir)) +- `ephemeral` (Block List, Max: 1) Represents an ephemeral volume that is handled by a normal storage driver. More info: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral)) +- `fc` (Block List, Max: 1) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. (see [below for nested schema](#nestedblock--spec--template--spec--volume--fc)) +- `flex_volume` (Block List, Max: 1) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume)) +- `flocker` (Block List, Max: 1) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running (see [below for nested schema](#nestedblock--spec--template--spec--volume--flocker)) +- `gce_persistent_disk` (Block List, Max: 1) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk (see [below for nested schema](#nestedblock--spec--template--spec--volume--gce_persistent_disk)) +- `git_repo` (Block List, Max: 1) GitRepo represents a git repository at a particular revision. (see [below for nested schema](#nestedblock--spec--template--spec--volume--git_repo)) +- `glusterfs` (Block List, Max: 1) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md (see [below for nested schema](#nestedblock--spec--template--spec--volume--glusterfs)) +- `host_path` (Block List, Max: 1) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath (see [below for nested schema](#nestedblock--spec--template--spec--volume--host_path)) +- `iscsi` (Block List, Max: 1) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. (see [below for nested schema](#nestedblock--spec--template--spec--volume--iscsi)) +- `local` (Block List, Max: 1) Represents a mounted local storage device such as a disk, partition or directory. Local volumes can only be used as a statically created PersistentVolume. Dynamic provisioning is not supported yet. More info: https://kubernetes.io/docs/concepts/storage/volumes#local (see [below for nested schema](#nestedblock--spec--template--spec--volume--local)) +- `name` (String) 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 +- `nfs` (Block List, Max: 1) Represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs (see [below for nested schema](#nestedblock--spec--template--spec--volume--nfs)) +- `persistent_volume_claim` (Block List, Max: 1) The specification of a persistent volume. (see [below for nested schema](#nestedblock--spec--template--spec--volume--persistent_volume_claim)) +- `photon_persistent_disk` (Block List, Max: 1) Represents a PhotonController persistent disk attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--photon_persistent_disk)) +- `projected` (Block List) Projected represents a single volume that projects several volume sources into the same directory. More info: https://kubernetes.io/docs/concepts/storage/volumes/#projected (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected)) +- `quobyte` (Block List, Max: 1) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime (see [below for nested schema](#nestedblock--spec--template--spec--volume--quobyte)) +- `rbd` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd)) +- `secret` (Block List, Max: 1) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret)) +- `vsphere_volume` (Block List, Max: 1) Represents a vSphere volume attached and mounted on kubelets host machine (see [below for nested schema](#nestedblock--spec--template--spec--volume--vsphere_volume)) + + +### Nested Schema for `spec.template.spec.volume.aws_elastic_block_store` + +Required: + +- `volume_id` (String) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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). +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + + + +### Nested Schema for `spec.template.spec.volume.azure_disk` + +Required: + +- `caching_mode` (String) Host Caching mode: None, Read Only, Read Write. +- `data_disk_uri` (String) The URI the data disk in the blob storage +- `disk_name` (String) The Name of the data disk in the blob storage + +Optional: + +- `fs_type` (String) 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. +- `kind` (String) The type for the data disk. Expected values: Shared, Dedicated, Managed. Defaults to Shared +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.azure_file` + +Required: + +- `secret_name` (String) The name of secret that contains Azure Storage Account Name and Key +- `share_name` (String) Share Name + +Optional: + +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). +- `secret_namespace` (String) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is "default" namespace. + + + +### Nested Schema for `spec.template.spec.volume.ceph_fs` + +Required: + +- `monitors` (Set of String) Monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + +Optional: + +- `path` (String) Used as the mounted root, rather than the full Ceph tree, default is / +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it +- `secret_file` (String) 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 +- `secret_ref` (Block List, Max: 1) Reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it (see [below for nested schema](#nestedblock--spec--template--spec--volume--ceph_fs--secret_ref)) +- `user` (String) User is the rados user name, default is admin. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it + + +### Nested Schema for `spec.template.spec.volume.ceph_fs.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.cinder` + +Required: + +- `volume_id` (String) Volume ID used to identify the volume in Cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md + +Optional: + +- `fs_type` (String) 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 +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). More info: https://examples.k8s.io/mysql-cinder-pd/README.md + + + +### Nested Schema for `spec.template.spec.volume.config_map` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or its keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.csi` + +Required: + +- `driver` (String) the name of the volume driver to use. More info: https://kubernetes.io/docs/concepts/storage/volumes/#csi + +Optional: + +- `fs_type` (String) 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. +- `node_publish_secret_ref` (Block List, Max: 1) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. (see [below for nested schema](#nestedblock--spec--template--spec--volume--csi--node_publish_secret_ref)) +- `read_only` (Boolean) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#csi +- `volume_attributes` (Map of String) Attributes of the volume to publish. + + +### Nested Schema for `spec.template.spec.volume.csi.node_publish_secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.downward_api` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items` + +Required: + +- `field_ref` (Block List, Min: 1, Max: 1) Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--field_ref)) +- `path` (String) 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 '..' + +Optional: + +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to "v1". +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.empty_dir` + +Optional: + +- `medium` (String) What type of storage medium should back this directory. The default is "" which means to use the node's default medium. Must be one of ["" "Memory" "HugePages" "HugePages-2Mi" "HugePages-1Gi"]. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir +- `size_limit` (String) Total amount of local storage required for this EmptyDir volume. + + + +### Nested Schema for `spec.template.spec.volume.ephemeral` + +Required: + +- `volume_claim_template` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template` + +Required: + +- `spec` (Block List, Min: 1, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec)) + +Optional: + +- `metadata` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--metadata)) + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--spec--volume--ephemeral--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + +### Nested Schema for `spec.template.spec.volume.ephemeral.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + + + + + +### Nested Schema for `spec.template.spec.volume.fc` + +Required: + +- `lun` (Number) FC target lun number +- `target_ww_ns` (Set of String) FC target worldwide names (WWNs) + +Optional: + +- `fs_type` (String) 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. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). + + + +### Nested Schema for `spec.template.spec.volume.flex_volume` + +Required: + +- `driver` (String) Driver is the name of the driver to use for this volume. + +Optional: + +- `fs_type` (String) 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. +- `options` (Map of String) Extra command options if any. +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). +- `secret_ref` (Block List, Max: 1) 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. (see [below for nested schema](#nestedblock--spec--template--spec--volume--flex_volume--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.flex_volume.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.flocker` + +Optional: + +- `dataset_name` (String) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated +- `dataset_uuid` (String) UUID of the dataset. This is unique identifier of a Flocker dataset + + + +### Nested Schema for `spec.template.spec.volume.gce_persistent_disk` + +Required: + +- `pd_name` (String) 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 + +Optional: + +- `fs_type` (String) 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 +- `partition` (Number) 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 +- `read_only` (Boolean) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + + + +### Nested Schema for `spec.template.spec.volume.git_repo` + +Optional: + +- `directory` (String) 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. +- `repository` (String) Repository URL +- `revision` (String) Commit hash for the specified revision. + + + +### Nested Schema for `spec.template.spec.volume.glusterfs` + +Required: + +- `endpoints_name` (String) The endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod +- `path` (String) The Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod + +Optional: + +- `read_only` (Boolean) Whether to 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 + + + +### Nested Schema for `spec.template.spec.volume.host_path` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath +- `type` (String) Type for HostPath volume. Allowed values are "" (default), DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice + + + +### Nested Schema for `spec.template.spec.volume.iscsi` + +Required: + +- `iqn` (String) Target iSCSI Qualified Name. +- `target_portal` (String) 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). + +Optional: + +- `fs_type` (String) 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 +- `iscsi_interface` (String) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). +- `lun` (Number) iSCSI target lun number. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. + + + +### Nested Schema for `spec.template.spec.volume.local` + +Optional: + +- `path` (String) Path of the directory on the host. More info: https://kubernetes.io/docs/concepts/storage/volumes#local + + + +### Nested Schema for `spec.template.spec.volume.nfs` + +Required: + +- `path` (String) Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs +- `server` (String) Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + +Optional: + +- `read_only` (Boolean) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs + + + +### Nested Schema for `spec.template.spec.volume.persistent_volume_claim` + +Optional: + +- `claim_name` (String) ClaimName is the name of a PersistentVolumeClaim in the same +- `read_only` (Boolean) Will force the ReadOnly setting in VolumeMounts. + + + +### Nested Schema for `spec.template.spec.volume.photon_persistent_disk` + +Required: + +- `pd_id` (String) ID that identifies Photon Controller persistent disk + +Optional: + +- `fs_type` (String) 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. + + + +### Nested Schema for `spec.template.spec.volume.projected` + +Required: + +- `sources` (Block List, Min: 1) Source of the volume to project in the directory. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources)) + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. + + +### Nested Schema for `spec.template.spec.volume.projected.sources` + +Optional: + +- `config_map` (Block List) ConfigMap represents a configMap that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map)) +- `downward_api` (Block List, Max: 1) DownwardAPI represents downward API about the pod that should populate this volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api)) +- `secret` (Block List) Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret)) +- `service_account_token` (Block List, Max: 1) A projected service account token volume (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--service_account_token)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map` + +Optional: + +- `items` (Block List) 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. Paths must be relative and may not contain the '..' path or start with '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--config_map--items)) +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `optional` (Boolean) Optional: Specify whether the ConfigMap or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.config_map.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api` + +Optional: + +- `items` (Block List) Represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items` + +Required: + +- `path` (String) 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 '..' + +Optional: + +- `field_ref` (Block List, Max: 1) Selects a field of the pod: only annotations, labels, name and namespace are supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--field_ref)) +- `mode` (String) Mode bits to use on this file, must be a value between 0 and 0777. 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. +- `resource_field_ref` (Block List, Max: 1) Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--downward_api--items--resource_field_ref)) + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.field_ref` + +Optional: + +- `api_version` (String) Version of the schema the FieldPath is written in terms of, defaults to 'v1'. +- `field_path` (String) Path of the field to select in the specified API version + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.downward_api.items.resource_field_ref` + +Required: + +- `container_name` (String) +- `resource` (String) Resource to select + +Optional: + +- `divisor` (String) + + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret` + +Optional: + +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--projected--sources--secret--items)) +- `name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets +- `optional` (Boolean) Optional: Specify whether the Secret or it's keys must be defined. + + +### Nested Schema for `spec.template.spec.volume.projected.sources.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.projected.sources.service_account_token` + +Required: + +- `path` (String) Path specifies a relative path to the mount point of the projected volume. + +Optional: + +- `audience` (String) Audience is the intended audience of the token +- `expiration_seconds` (Number) ExpirationSeconds is the expected duration of validity of the service account token. It defaults to 1 hour and must be at least 10 minutes (600 seconds). + + + + + +### Nested Schema for `spec.template.spec.volume.quobyte` + +Required: + +- `registry` (String) 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 +- `volume` (String) Volume is a string that references an already created Quobyte volume by name. + +Optional: + +- `group` (String) Group to map volume access to Default is no group +- `read_only` (Boolean) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. +- `user` (String) User to map volume access to Defaults to serivceaccount user + + + +### Nested Schema for `spec.template.spec.volume.rbd` + +Required: + +- `ceph_monitors` (Set of String) A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_image` (String) The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it + +Optional: + +- `fs_type` (String) 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 +- `keyring` (String) 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 +- `rados_user` (String) The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `rbd_pool` (String) The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. +- `read_only` (Boolean) Whether to force the read-only setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it +- `secret_ref` (Block List, Max: 1) 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 (see [below for nested schema](#nestedblock--spec--template--spec--volume--rbd--secret_ref)) + + +### Nested Schema for `spec.template.spec.volume.rbd.secret_ref` + +Optional: + +- `name` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + + + + +### Nested Schema for `spec.template.spec.volume.secret` + +Optional: + +- `default_mode` (String) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. +- `items` (Block List) 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 '..'. (see [below for nested schema](#nestedblock--spec--template--spec--volume--secret--items)) +- `optional` (Boolean) Optional: Specify whether the Secret or its keys must be defined. +- `secret_name` (String) Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secrets + + +### Nested Schema for `spec.template.spec.volume.secret.items` + +Optional: + +- `key` (String) The key to project. +- `mode` (String) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. +- `path` (String) 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 '..'. + + + + +### Nested Schema for `spec.template.spec.volume.vsphere_volume` + +Required: + +- `volume_path` (String) Path that identifies vSphere volume vmdk + +Optional: + +- `fs_type` (String) 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. + + + + + + +### Nested Schema for `spec.persistent_volume_claim_retention_policy` + +Optional: + +- `when_deleted` (String) This field controls what happens when a Statefulset is deleted. Default is Retain. +- `when_scaled` (String) This field controls what happens when a Statefulset is scaled. Default is Retain. + + + +### Nested Schema for `spec.update_strategy` + +Optional: + +- `rolling_update` (Block List) RollingUpdate strategy type for StatefulSet (see [below for nested schema](#nestedblock--spec--update_strategy--rolling_update)) +- `type` (String) Indicates the type of the StatefulSet update strategy. Default is RollingUpdate + + +### Nested Schema for `spec.update_strategy.rolling_update` + +Optional: + +- `partition` (Number) Indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0. + + + + +### Nested Schema for `spec.volume_claim_template` + +Required: + +- `metadata` (Block List, Min: 1, Max: 1) Standard persistent volume claim's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--spec--volume_claim_template--metadata)) +- `spec` (Block List, Min: 1, Max: 1) Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec)) + + +### Nested Schema for `spec.volume_claim_template.metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the persistent volume claim, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the persistent volume claim must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this persistent volume claim. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec.volume_claim_template.spec` + +Required: + +- `access_modes` (Set of String) A set of the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +- `resources` (Block List, Min: 1, Max: 1) A list of the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec--resources)) + +Optional: + +- `selector` (Block List, Max: 1) A label query over volumes to consider for binding. (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec--selector)) +- `storage_class_name` (String) Name of the storage class requested by the claim +- `volume_mode` (String) Defines what type of volume is required by the claim. +- `volume_name` (String) The binding reference to the PersistentVolume backing this claim. + + +### Nested Schema for `spec.volume_claim_template.spec.resources` + +Optional: + +- `limits` (Map of String) Map describing the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +- `requests` (Map of String) Map describing the minimum amount of compute resources required. If this 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/ + + + +### Nested Schema for `spec.volume_claim_template.spec.selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--volume_claim_template--spec--selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `spec.volume_claim_template.spec.selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `read` (String) +- `update` (String) + + + + +## Example Usage + +```terraform +resource "kubernetes_stateful_set_v1" "prometheus" { + metadata { + annotations = { + SomeAnnotation = "foobar" + } + + labels = { + k8s-app = "prometheus" + "kubernetes.io/cluster-service" = "true" + "addonmanager.kubernetes.io/mode" = "Reconcile" + version = "v2.2.1" + } + + name = "prometheus" + } + + spec { + pod_management_policy = "Parallel" + replicas = 1 + revision_history_limit = 5 + + selector { + match_labels = { + k8s-app = "prometheus" + } + } + + service_name = "prometheus" + + template { + metadata { + labels = { + k8s-app = "prometheus" + } + + annotations = {} + } + + spec { + service_account_name = "prometheus" + + init_container { + name = "init-chown-data" + image = "busybox:latest" + image_pull_policy = "IfNotPresent" + command = ["chown", "-R", "65534:65534", "/data"] + + volume_mount { + name = "prometheus-data" + mount_path = "/data" + sub_path = "" + } + } + + container { + name = "prometheus-server-configmap-reload" + image = "jimmidyson/configmap-reload:v0.1" + image_pull_policy = "IfNotPresent" + + args = [ + "--volume-dir=/etc/config", + "--webhook-url=http://localhost:9090/-/reload", + ] + + volume_mount { + name = "config-volume" + mount_path = "/etc/config" + read_only = true + } + + resources { + limits = { + cpu = "10m" + memory = "10Mi" + } + + requests = { + cpu = "10m" + memory = "10Mi" + } + } + } + + container { + name = "prometheus-server" + image = "prom/prometheus:v2.2.1" + image_pull_policy = "IfNotPresent" + + args = [ + "--config.file=/etc/config/prometheus.yml", + "--storage.tsdb.path=/data", + "--web.console.libraries=/etc/prometheus/console_libraries", + "--web.console.templates=/etc/prometheus/consoles", + "--web.enable-lifecycle", + ] + + port { + container_port = 9090 + } + + resources { + limits = { + cpu = "200m" + memory = "1000Mi" + } + + requests = { + cpu = "200m" + memory = "1000Mi" + } + } + + volume_mount { + name = "config-volume" + mount_path = "/etc/config" + } + + volume_mount { + name = "prometheus-data" + mount_path = "/data" + sub_path = "" + } + + readiness_probe { + http_get { + path = "/-/ready" + port = 9090 + } + + initial_delay_seconds = 30 + timeout_seconds = 30 + } + + liveness_probe { + http_get { + path = "/-/healthy" + port = 9090 + scheme = "HTTPS" + } + + initial_delay_seconds = 30 + timeout_seconds = 30 + } + } + + termination_grace_period_seconds = 300 + + volume { + name = "config-volume" + + config_map { + name = "prometheus-config" + } + } + } + } + + update_strategy { + type = "RollingUpdate" + + rolling_update { + partition = 1 + } + } + + volume_claim_template { + metadata { + name = "prometheus-data" + } + + spec { + access_modes = ["ReadWriteOnce"] + storage_class_name = "standard" + + resources { + requests = { + storage = "16Gi" + } + } + } + } + + persistent_volume_claim_retention_policy { + when_deleted = "Delete" + when_scaled = "Delete" + } + } +} +``` + +## Import + +kubernetes_stateful_set_v1 can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_stateful_set_v1.example default/terraform-example +``` diff --git a/docs/resources/storage_class.md b/docs/resources/storage_class.md new file mode 100644 index 0000000000..6b9bf20ee5 --- /dev/null +++ b/docs/resources/storage_class.md @@ -0,0 +1,93 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_storage_class" +description: |- + Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +--- + +# kubernetes_storage_class + +Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. + +Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard storage class's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `storage_provisioner` (String) Indicates the type of the provisioner + +### Optional + +- `allow_volume_expansion` (Boolean) Indicates whether the storage class allow volume expand +- `allowed_topologies` (Block List, Max: 1) Restrict the node topologies where volumes can be dynamically provisioned. (see [below for nested schema](#nestedblock--allowed_topologies)) +- `mount_options` (Set of String) Persistent Volumes that are dynamically created by a storage class will have the mount options specified +- `parameters` (Map of String) The parameters for the provisioner that should create volumes of this storage class +- `reclaim_policy` (String) Indicates the type of the reclaim policy +- `volume_binding_mode` (String) Indicates when volume binding and dynamic provisioning should occur + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the storage class that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the storage class. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the storage class, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this storage class. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `allowed_topologies` + +Optional: + +- `match_label_expressions` (Block List) A list of topology selector requirements by labels. (see [below for nested schema](#nestedblock--allowed_topologies--match_label_expressions)) + + +### Nested Schema for `allowed_topologies.match_label_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `values` (Set of String) An array of string values. One value must match the label to be selected. + + + + + +## Example Usage + +```terraform +resource "kubernetes_storage_class" "example" { + metadata { + name = "terraform-example" + } + storage_provisioner = "kubernetes.io/gce-pd" + reclaim_policy = "Retain" + parameters = { + type = "pd-standard" + } + mount_options = ["file_mode=0700", "dir_mode=0777", "mfsymlinks", "uid=1000", "gid=1000", "nobrl", "cache=none"] +} +``` + +## Import + +kubernetes_storage_class can be imported using its name, e.g. + +``` +$ terraform import kubernetes_storage_class.example terraform-example +``` diff --git a/docs/resources/storage_class_v1.md b/docs/resources/storage_class_v1.md new file mode 100644 index 0000000000..458b223fd0 --- /dev/null +++ b/docs/resources/storage_class_v1.md @@ -0,0 +1,91 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_storage_class_v1" +description: |- + Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +--- + +# kubernetes_storage_class_v1 + +Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. Read more [here] (https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/) + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard storage class's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `storage_provisioner` (String) Indicates the type of the provisioner + +### Optional + +- `allow_volume_expansion` (Boolean) Indicates whether the storage class allow volume expand +- `allowed_topologies` (Block List, Max: 1) Restrict the node topologies where volumes can be dynamically provisioned. (see [below for nested schema](#nestedblock--allowed_topologies)) +- `mount_options` (Set of String) Persistent Volumes that are dynamically created by a storage class will have the mount options specified +- `parameters` (Map of String) The parameters for the provisioner that should create volumes of this storage class +- `reclaim_policy` (String) Indicates the type of the reclaim policy +- `volume_binding_mode` (String) Indicates when volume binding and dynamic provisioning should occur + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the storage class that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the storage class. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the storage class, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this storage class. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `allowed_topologies` + +Optional: + +- `match_label_expressions` (Block List) A list of topology selector requirements by labels. (see [below for nested schema](#nestedblock--allowed_topologies--match_label_expressions)) + + +### Nested Schema for `allowed_topologies.match_label_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `values` (Set of String) An array of string values. One value must match the label to be selected. + + + + + +## Example Usage + +```terraform +resource "kubernetes_storage_class_v1" "example" { + metadata { + name = "terraform-example" + } + storage_provisioner = "kubernetes.io/gce-pd" + reclaim_policy = "Retain" + parameters = { + type = "pd-standard" + } + mount_options = ["file_mode=0700", "dir_mode=0777", "mfsymlinks", "uid=1000", "gid=1000", "nobrl", "cache=none"] +} +``` + +## Import + +kubernetes_storage_class_v1 can be imported using its name, e.g. + +``` +$ terraform import kubernetes_storage_class_v1.example terraform-example +``` diff --git a/docs/resources/token_request_v1.md b/docs/resources/token_request_v1.md new file mode 100644 index 0000000000..41cb69272e --- /dev/null +++ b/docs/resources/token_request_v1.md @@ -0,0 +1,95 @@ +--- +subcategory: "authentication/v1" +page_title: "Kubernetes: kubernetes_token_request_v1" +description: |- + TokenRequest requests a token for a given service account. +--- + +# kubernetes_token_request_v1 + +TokenRequest requests a token for a given service account. + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard token request's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) + +### Optional + +- `spec` (Block List, Max: 1) (see [below for nested schema](#nestedblock--spec)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `token` (String, Sensitive) Token is the opaque bearer token. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the token request that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the token request. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the token request, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +- `namespace` (String) Namespace defines the space within which name of the token request must be unique. + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this token request that can be used by clients to determine when token request has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this token request. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `spec` + +Optional: + +- `audiences` (List of String) Audiences are the intendend audiences of the token. A recipient of a token must identify themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences. +- `bound_object_ref` (Block List, Max: 1) BoundObjectRef is a reference to an object that the token will be bound to. The token will only be valid for as long as the bound object exists. NOTE: The API server's TokenReview endpoint will validate the BoundObjectRef, but other audiences may not. Keep ExpirationSeconds small if you want prompt revocation. (see [below for nested schema](#nestedblock--spec--bound_object_ref)) +- `expiration_seconds` (Number) expiration_seconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response. The expiration can't be less than 10 minutes. + + +### Nested Schema for `spec.bound_object_ref` + +Optional: + +- `api_version` (String) API version of the referent. +- `kind` (String) Kind of the referent. Valid kinds are 'Pod' and 'Secret'. +- `name` (String) Name of the referent. +- `uid` (String) UID of the referent. + + + + + +## Example Usage + +```terraform +resource "kubernetes_service_account_v1" "test" { + metadata { + name = "test" + } +} + +resource "kubernetes_token_request_v1" "test" { + metadata { + name = kubernetes_service_account_v1.test.metadata.0.name + } + spec { + audiences = [ + "api", + "vault", + "factors" + ] + } +} + +output "tokenValue" { + value = kubernetes_token_request_v1.test.token +} +``` + diff --git a/docs/resources/validating_webhook_configuration.md b/docs/resources/validating_webhook_configuration.md new file mode 100644 index 0000000000..21790bfde5 --- /dev/null +++ b/docs/resources/validating_webhook_configuration.md @@ -0,0 +1,231 @@ +--- +subcategory: "admissionregistration/v1beta1" +page_title: "Kubernetes: kubernetes_validating_webhook_configuration" +description: |- + Validating Webhook Configuration configures a validating admission webhook +--- + +# kubernetes_validating_webhook_configuration + +Validating Webhook Configuration configures a [validating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard validating webhook configuration's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `webhook` (Block List, Min: 1) Webhooks is a list of webhooks and the affected resources and operations. (see [below for nested schema](#nestedblock--webhook)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the validating webhook configuration that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the validating webhook configuration. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the validating webhook configuration, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this validating webhook configuration that can be used by clients to determine when validating webhook configuration has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this validating webhook configuration. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `webhook` + +Required: + +- `client_config` (Block List, Min: 1, Max: 1) ClientConfig defines how to communicate with the hook. Required (see [below for nested schema](#nestedblock--webhook--client_config)) +- `name` (String) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. Required. + +Optional: + +- `admission_review_versions` (List of String) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. +- `failure_policy` (String) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. +- `match_policy` (String) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". + +- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. + +- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. + +Defaults to "Equivalent" +- `namespace_selector` (Block List, Max: 1) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. + +For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "runlevel", + "operator": "NotIn", + "values": [ + "0", + "1" + ] + } + ] +} + +If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "environment", + "operator": "In", + "values": [ + "prod", + "staging" + ] + } + ] +} + +See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. + +Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--namespace_selector)) +- `object_selector` (Block List, Max: 1) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--object_selector)) +- `rule` (Block List) Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. (see [below for nested schema](#nestedblock--webhook--rule)) +- `side_effects` (String) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. +- `timeout_seconds` (Number) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. + + +### Nested Schema for `webhook.client_config` + +Optional: + +- `ca_bundle` (String) `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. +- `service` (Block List, Max: 1) `service` is a reference to the service for this webhook. Either `service` or `url` must be specified. + +If the webhook is running within the cluster, then you should use `service`. (see [below for nested schema](#nestedblock--webhook--client_config--service)) +- `url` (String) `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. + +The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. + +Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. + +The scheme must be "https"; the URL must begin with "https://". + +A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. + +Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. + + +### Nested Schema for `webhook.client_config.service` + +Required: + +- `name` (String) `name` is the name of the service. Required +- `namespace` (String) `namespace` is the namespace of the service. Required + +Optional: + +- `path` (String) `path` is an optional URL path which will be sent in any request to this service. +- `port` (Number) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). + + + + +### Nested Schema for `webhook.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.object_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--object_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.object_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.rule` + +Required: + +- `api_groups` (List of String) +- `api_versions` (List of String) +- `operations` (List of String) Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required. +- `resources` (List of String) + +Optional: + +- `scope` (String) + + + + + +## Example Usage + +```terraform +resource "kubernetes_validating_webhook_configuration" "example" { + metadata { + name = "test.terraform.io" + } + + webhook { + name = "test.terraform.io" + + admission_review_versions = ["v1", "v1beta1"] + + client_config { + service { + namespace = "example-namespace" + name = "example-service" + } + } + + rule { + api_groups = ["apps"] + api_versions = ["v1"] + operations = ["CREATE"] + resources = ["deployments"] + scope = "Namespaced" + } + + side_effects = "None" + } +} +``` + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +##Import + +Validating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_validating_webhook_configuration.example terraform-example +``` diff --git a/docs/resources/validating_webhook_configuration_v1.md b/docs/resources/validating_webhook_configuration_v1.md new file mode 100644 index 0000000000..1c5b1673e4 --- /dev/null +++ b/docs/resources/validating_webhook_configuration_v1.md @@ -0,0 +1,231 @@ +--- +subcategory: "admissionregistration/v1" +page_title: "Kubernetes: kubernetes_validating_webhook_configuration_v1" +description: |- + Validating Webhook Configuration configures a validating admission webhook +--- + +# kubernetes_validating_webhook_configuration_v1 + +Validating Webhook Configuration configures a [validating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). + + +## Schema + +### Required + +- `metadata` (Block List, Min: 1, Max: 1) Standard validating webhook configuration's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata (see [below for nested schema](#nestedblock--metadata)) +- `webhook` (Block List, Min: 1) Webhooks is a list of webhooks and the affected resources and operations. (see [below for nested schema](#nestedblock--webhook)) + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `metadata` + +Optional: + +- `annotations` (Map of String) An unstructured key value map stored with the validating webhook configuration that may be used to store arbitrary metadata. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +- `generate_name` (String) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency +- `labels` (Map of String) Map of string keys and values that can be used to organize and categorize (scope and select) the validating webhook configuration. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +- `name` (String) Name of the validating webhook configuration, must be unique. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + +Read-Only: + +- `generation` (Number) A sequence number representing a specific generation of the desired state. +- `resource_version` (String) An opaque value that represents the internal version of this validating webhook configuration that can be used by clients to determine when validating webhook configuration has changed. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +- `uid` (String) The unique in time and space value for this validating webhook configuration. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + + + +### Nested Schema for `webhook` + +Required: + +- `client_config` (Block List, Min: 1, Max: 1) ClientConfig defines how to communicate with the hook. Required (see [below for nested schema](#nestedblock--webhook--client_config)) +- `name` (String) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. Required. + +Optional: + +- `admission_review_versions` (List of String) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. +- `failure_policy` (String) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. +- `match_policy` (String) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". + +- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. + +- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. + +Defaults to "Equivalent" +- `namespace_selector` (Block List, Max: 1) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. + +For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "runlevel", + "operator": "NotIn", + "values": [ + "0", + "1" + ] + } + ] +} + +If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { + "matchExpressions": [ + { + "key": "environment", + "operator": "In", + "values": [ + "prod", + "staging" + ] + } + ] +} + +See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. + +Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--namespace_selector)) +- `object_selector` (Block List, Max: 1) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. (see [below for nested schema](#nestedblock--webhook--object_selector)) +- `rule` (Block List) Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. (see [below for nested schema](#nestedblock--webhook--rule)) +- `side_effects` (String) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. +- `timeout_seconds` (Number) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. + + +### Nested Schema for `webhook.client_config` + +Optional: + +- `ca_bundle` (String) `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. +- `service` (Block List, Max: 1) `service` is a reference to the service for this webhook. Either `service` or `url` must be specified. + +If the webhook is running within the cluster, then you should use `service`. (see [below for nested schema](#nestedblock--webhook--client_config--service)) +- `url` (String) `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. + +The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. + +Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. + +The scheme must be "https"; the URL must begin with "https://". + +A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. + +Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. + + +### Nested Schema for `webhook.client_config.service` + +Required: + +- `name` (String) `name` is the name of the service. Required +- `namespace` (String) `namespace` is the namespace of the service. Required + +Optional: + +- `path` (String) `path` is an optional URL path which will be sent in any request to this service. +- `port` (Number) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). + + + + +### Nested Schema for `webhook.namespace_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--namespace_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.namespace_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.object_selector` + +Optional: + +- `match_expressions` (Block List) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--webhook--object_selector--match_expressions)) +- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + + +### Nested Schema for `webhook.object_selector.match_expressions` + +Optional: + +- `key` (String) The label key that the selector applies to. +- `operator` (String) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. +- `values` (Set of String) 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. + + + + +### Nested Schema for `webhook.rule` + +Required: + +- `api_groups` (List of String) +- `api_versions` (List of String) +- `operations` (List of String) Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required. +- `resources` (List of String) + +Optional: + +- `scope` (String) + + + + + +## Example Usage + +```terraform +resource "kubernetes_validating_webhook_configuration_v1" "example" { + metadata { + name = "test.terraform.io" + } + + webhook { + name = "test.terraform.io" + + admission_review_versions = ["v1", "v1beta1"] + + client_config { + service { + namespace = "example-namespace" + name = "example-service" + } + } + + rule { + api_groups = ["apps"] + api_versions = ["v1"] + operations = ["CREATE"] + resources = ["deployments"] + scope = "Namespaced" + } + + side_effects = "None" + } +} +``` + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +## Import + +Validating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_validating_webhook_configuration_v1.example terraform-example +``` diff --git a/examples/data-sources/all_namespaces/example_1.tf b/examples/data-sources/all_namespaces/example_1.tf new file mode 100644 index 0000000000..d19a859ed8 --- /dev/null +++ b/examples/data-sources/all_namespaces/example_1.tf @@ -0,0 +1,10 @@ +data "kubernetes_all_namespaces" "allns" {} + +output "all-ns" { + value = data.kubernetes_all_namespaces.allns.namespaces +} + +output "ns-present" { + value = contains(data.kubernetes_all_namespaces.allns.namespaces, "kube-system") +} + diff --git a/examples/data-sources/all_namespaces/example_2.tf b/examples/data-sources/all_namespaces/example_2.tf new file mode 100644 index 0000000000..4066c8b054 --- /dev/null +++ b/examples/data-sources/all_namespaces/example_2.tf @@ -0,0 +1,9 @@ +data "kubernetes_all_namespaces" "allns" {} + +output "all-ns" { + value = data.kubernetes_all_namespaces.allns.namespaces +} + +output "ns-present" { + value = contains(data.kubernetes_all_namespaces.allns.namespaces, "kube-system") +} diff --git a/examples/data-sources/config_map/example_1.tf b/examples/data-sources/config_map/example_1.tf new file mode 100644 index 0000000000..52cc89e1a5 --- /dev/null +++ b/examples/data-sources/config_map/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_config_map" "example" { + metadata { + name = "my-config" + } +} diff --git a/examples/data-sources/config_map/example_2.tf b/examples/data-sources/config_map/example_2.tf new file mode 100644 index 0000000000..52cc89e1a5 --- /dev/null +++ b/examples/data-sources/config_map/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_config_map" "example" { + metadata { + name = "my-config" + } +} diff --git a/examples/data-sources/config_map_v1/example_1.tf b/examples/data-sources/config_map_v1/example_1.tf new file mode 100644 index 0000000000..cc8655553d --- /dev/null +++ b/examples/data-sources/config_map_v1/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_config_map_v1" "example" { + metadata { + name = "my-config" + } +} diff --git a/examples/data-sources/config_map_v1/example_2.tf b/examples/data-sources/config_map_v1/example_2.tf new file mode 100644 index 0000000000..cc8655553d --- /dev/null +++ b/examples/data-sources/config_map_v1/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_config_map_v1" "example" { + metadata { + name = "my-config" + } +} diff --git a/examples/data-sources/endpoints_v1/example_1.tf b/examples/data-sources/endpoints_v1/example_1.tf new file mode 100644 index 0000000000..80e58ccf62 --- /dev/null +++ b/examples/data-sources/endpoints_v1/example_1.tf @@ -0,0 +1,6 @@ +data "kubernetes_endpoints_v1" "api_endpoints" { + metadata { + name = "kubernetes" + namespace = "default" + } +} diff --git a/examples/data-sources/endpoints_v1/example_2.tf b/examples/data-sources/endpoints_v1/example_2.tf new file mode 100644 index 0000000000..80e58ccf62 --- /dev/null +++ b/examples/data-sources/endpoints_v1/example_2.tf @@ -0,0 +1,6 @@ +data "kubernetes_endpoints_v1" "api_endpoints" { + metadata { + name = "kubernetes" + namespace = "default" + } +} diff --git a/examples/data-sources/ingress/example_1.tf b/examples/data-sources/ingress/example_1.tf new file mode 100644 index 0000000000..6395e2763c --- /dev/null +++ b/examples/data-sources/ingress/example_1.tf @@ -0,0 +1,13 @@ +data "kubernetes_ingress" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = data.aws_route53_zone.k8.zone_id + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/ingress/example_2.tf b/examples/data-sources/ingress/example_2.tf new file mode 100644 index 0000000000..6395e2763c --- /dev/null +++ b/examples/data-sources/ingress/example_2.tf @@ -0,0 +1,13 @@ +data "kubernetes_ingress" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = data.aws_route53_zone.k8.zone_id + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/ingress_v1/example_1.tf b/examples/data-sources/ingress_v1/example_1.tf new file mode 100644 index 0000000000..13998586b7 --- /dev/null +++ b/examples/data-sources/ingress_v1/example_1.tf @@ -0,0 +1,13 @@ +data "kubernetes_ingress_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = data.aws_route53_zone.k8.zone_id + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/ingress_v1/example_2.tf b/examples/data-sources/ingress_v1/example_2.tf new file mode 100644 index 0000000000..13998586b7 --- /dev/null +++ b/examples/data-sources/ingress_v1/example_2.tf @@ -0,0 +1,13 @@ +data "kubernetes_ingress_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = data.aws_route53_zone.k8.zone_id + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/mutating_webhook_configuration_v1/example_1.tf b/examples/data-sources/mutating_webhook_configuration_v1/example_1.tf new file mode 100644 index 0000000000..90d4003734 --- /dev/null +++ b/examples/data-sources/mutating_webhook_configuration_v1/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_mutating_webhook_configuration_v1" "example" { + metadata { + name = "terraform-example" + } +} diff --git a/examples/data-sources/mutating_webhook_configuration_v1/example_2.tf b/examples/data-sources/mutating_webhook_configuration_v1/example_2.tf new file mode 100644 index 0000000000..90d4003734 --- /dev/null +++ b/examples/data-sources/mutating_webhook_configuration_v1/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_mutating_webhook_configuration_v1" "example" { + metadata { + name = "terraform-example" + } +} diff --git a/examples/data-sources/namespace/example_1.tf b/examples/data-sources/namespace/example_1.tf new file mode 100644 index 0000000000..1f6f411cf7 --- /dev/null +++ b/examples/data-sources/namespace/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_namespace" "example" { + metadata { + name = "kube-system" + } +} diff --git a/examples/data-sources/namespace/example_2.tf b/examples/data-sources/namespace/example_2.tf new file mode 100644 index 0000000000..1f6f411cf7 --- /dev/null +++ b/examples/data-sources/namespace/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_namespace" "example" { + metadata { + name = "kube-system" + } +} diff --git a/examples/data-sources/namespace_v1/example_1.tf b/examples/data-sources/namespace_v1/example_1.tf new file mode 100644 index 0000000000..7cb15e2ed0 --- /dev/null +++ b/examples/data-sources/namespace_v1/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_namespace_v1" "example" { + metadata { + name = "kube-system" + } +} diff --git a/examples/data-sources/namespace_v1/example_2.tf b/examples/data-sources/namespace_v1/example_2.tf new file mode 100644 index 0000000000..7cb15e2ed0 --- /dev/null +++ b/examples/data-sources/namespace_v1/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_namespace_v1" "example" { + metadata { + name = "kube-system" + } +} diff --git a/examples/data-sources/nodes/example_1.tf b/examples/data-sources/nodes/example_1.tf new file mode 100644 index 0000000000..249e46028d --- /dev/null +++ b/examples/data-sources/nodes/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_nodes" "example" {} + +output "node-ids" { + value = [for node in data.kubernetes_nodes.example.nodes : node.spec.0.provider_id] +} diff --git a/examples/data-sources/nodes/example_2.tf b/examples/data-sources/nodes/example_2.tf new file mode 100644 index 0000000000..ee82af5047 --- /dev/null +++ b/examples/data-sources/nodes/example_2.tf @@ -0,0 +1,11 @@ +data "kubernetes_nodes" "example" { + metadata { + labels = { + "kubernetes.io/os" = "linux" + } + } +} + +output "linux-node-names" { + value = [for node in data.kubernetes_nodes.example.nodes : node.metadata.0.name] +} diff --git a/examples/data-sources/nodes/example_3.tf b/examples/data-sources/nodes/example_3.tf new file mode 100644 index 0000000000..249e46028d --- /dev/null +++ b/examples/data-sources/nodes/example_3.tf @@ -0,0 +1,5 @@ +data "kubernetes_nodes" "example" {} + +output "node-ids" { + value = [for node in data.kubernetes_nodes.example.nodes : node.spec.0.provider_id] +} diff --git a/examples/data-sources/nodes/example_4.tf b/examples/data-sources/nodes/example_4.tf new file mode 100644 index 0000000000..ee82af5047 --- /dev/null +++ b/examples/data-sources/nodes/example_4.tf @@ -0,0 +1,11 @@ +data "kubernetes_nodes" "example" { + metadata { + labels = { + "kubernetes.io/os" = "linux" + } + } +} + +output "linux-node-names" { + value = [for node in data.kubernetes_nodes.example.nodes : node.metadata.0.name] +} diff --git a/examples/data-sources/nodes/example_5.tf b/examples/data-sources/nodes/example_5.tf new file mode 100644 index 0000000000..249e46028d --- /dev/null +++ b/examples/data-sources/nodes/example_5.tf @@ -0,0 +1,5 @@ +data "kubernetes_nodes" "example" {} + +output "node-ids" { + value = [for node in data.kubernetes_nodes.example.nodes : node.spec.0.provider_id] +} diff --git a/examples/data-sources/nodes/example_6.tf b/examples/data-sources/nodes/example_6.tf new file mode 100644 index 0000000000..ee82af5047 --- /dev/null +++ b/examples/data-sources/nodes/example_6.tf @@ -0,0 +1,11 @@ +data "kubernetes_nodes" "example" { + metadata { + labels = { + "kubernetes.io/os" = "linux" + } + } +} + +output "linux-node-names" { + value = [for node in data.kubernetes_nodes.example.nodes : node.metadata.0.name] +} diff --git a/examples/data-sources/persistent_volume_claim/example_1.tf b/examples/data-sources/persistent_volume_claim/example_1.tf new file mode 100644 index 0000000000..d510cb1e06 --- /dev/null +++ b/examples/data-sources/persistent_volume_claim/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_persistent_volume_claim" "example" { + metadata { + name = "terraform-example" + } +} diff --git a/examples/data-sources/persistent_volume_claim/example_2.tf b/examples/data-sources/persistent_volume_claim/example_2.tf new file mode 100644 index 0000000000..d510cb1e06 --- /dev/null +++ b/examples/data-sources/persistent_volume_claim/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_persistent_volume_claim" "example" { + metadata { + name = "terraform-example" + } +} diff --git a/examples/data-sources/persistent_volume_claim_v1/example_1.tf b/examples/data-sources/persistent_volume_claim_v1/example_1.tf new file mode 100644 index 0000000000..86e253d1e3 --- /dev/null +++ b/examples/data-sources/persistent_volume_claim_v1/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_persistent_volume_claim_v1" "example" { + metadata { + name = "terraform-example" + } +} diff --git a/examples/data-sources/persistent_volume_claim_v1/example_2.tf b/examples/data-sources/persistent_volume_claim_v1/example_2.tf new file mode 100644 index 0000000000..86e253d1e3 --- /dev/null +++ b/examples/data-sources/persistent_volume_claim_v1/example_2.tf @@ -0,0 +1,5 @@ +data "kubernetes_persistent_volume_claim_v1" "example" { + metadata { + name = "terraform-example" + } +} diff --git a/examples/data-sources/persistent_volume_v1/example_1.tf b/examples/data-sources/persistent_volume_v1/example_1.tf new file mode 100644 index 0000000000..b91e3f23e5 --- /dev/null +++ b/examples/data-sources/persistent_volume_v1/example_1.tf @@ -0,0 +1,16 @@ +data "kubernetes_persistent_volume_v1" "example" { + metadata { + name = "terraform-example" + } +} +data "kubernetes_secret" "example" { + metadata { + name = data.kubernetes_persistent_volume_v1.example.spec[0].persistent_volume_source[0].azure_file[0].secret_name + } +} +output "azure_storageaccount_name" { + value = data.kubernetes_secret.example.data.azurestorageaccountname +} +output "azure_storageaccount_key" { + value = data.kubernetes_secret.example.data.azurestorageaccountkey +} diff --git a/examples/data-sources/persistent_volume_v1/example_2.tf b/examples/data-sources/persistent_volume_v1/example_2.tf new file mode 100644 index 0000000000..b91e3f23e5 --- /dev/null +++ b/examples/data-sources/persistent_volume_v1/example_2.tf @@ -0,0 +1,16 @@ +data "kubernetes_persistent_volume_v1" "example" { + metadata { + name = "terraform-example" + } +} +data "kubernetes_secret" "example" { + metadata { + name = data.kubernetes_persistent_volume_v1.example.spec[0].persistent_volume_source[0].azure_file[0].secret_name + } +} +output "azure_storageaccount_name" { + value = data.kubernetes_secret.example.data.azurestorageaccountname +} +output "azure_storageaccount_key" { + value = data.kubernetes_secret.example.data.azurestorageaccountkey +} diff --git a/examples/data-sources/pod/example_1.tf b/examples/data-sources/pod/example_1.tf new file mode 100644 index 0000000000..dfd9cac623 --- /dev/null +++ b/examples/data-sources/pod/example_1.tf @@ -0,0 +1,4 @@ +resources { + limits = {} + requests = {} +} diff --git a/examples/data-sources/pod/example_2.tf b/examples/data-sources/pod/example_2.tf new file mode 100644 index 0000000000..dfd9cac623 --- /dev/null +++ b/examples/data-sources/pod/example_2.tf @@ -0,0 +1,4 @@ +resources { + limits = {} + requests = {} +} diff --git a/examples/data-sources/pod_v1/example_1.tf b/examples/data-sources/pod_v1/example_1.tf new file mode 100644 index 0000000000..dfd9cac623 --- /dev/null +++ b/examples/data-sources/pod_v1/example_1.tf @@ -0,0 +1,4 @@ +resources { + limits = {} + requests = {} +} diff --git a/examples/data-sources/pod_v1/example_2.tf b/examples/data-sources/pod_v1/example_2.tf new file mode 100644 index 0000000000..dfd9cac623 --- /dev/null +++ b/examples/data-sources/pod_v1/example_2.tf @@ -0,0 +1,4 @@ +resources { + limits = {} + requests = {} +} diff --git a/examples/data-sources/resource/example_1.tf b/examples/data-sources/resource/example_1.tf new file mode 100644 index 0000000000..1e9c465d39 --- /dev/null +++ b/examples/data-sources/resource/example_1.tf @@ -0,0 +1,13 @@ +data "kubernetes_resource" "example" { + api_version = "v1" + kind = "ConfigMap" + + metadata { + name = "example" + namespace = "default" + } +} + +output "test" { + value = data.kubernetes_resource.example.object.data.TEST +} diff --git a/examples/data-sources/resource/example_2.tf b/examples/data-sources/resource/example_2.tf new file mode 100644 index 0000000000..1e9c465d39 --- /dev/null +++ b/examples/data-sources/resource/example_2.tf @@ -0,0 +1,13 @@ +data "kubernetes_resource" "example" { + api_version = "v1" + kind = "ConfigMap" + + metadata { + name = "example" + namespace = "default" + } +} + +output "test" { + value = data.kubernetes_resource.example.object.data.TEST +} diff --git a/examples/data-sources/resources/example_1.tf b/examples/data-sources/resources/example_1.tf new file mode 100644 index 0000000000..b3923985b7 --- /dev/null +++ b/examples/data-sources/resources/example_1.tf @@ -0,0 +1,9 @@ +data "kubernetes_resources" "example" { + api_version = "v1" + kind = "Namespace" + field_selector = "metadata.name!=kube-system" +} + +output "test" { + value = length(data.kubernetes_resources.example.objects) +} diff --git a/examples/data-sources/resources/example_2.tf b/examples/data-sources/resources/example_2.tf new file mode 100644 index 0000000000..db1f848367 --- /dev/null +++ b/examples/data-sources/resources/example_2.tf @@ -0,0 +1,9 @@ +data "kubernetes_resources" "example" { + api_version = "v1" + kind = "Namespace" + label_selector = "kubernetes.io/metadata.name!=kube-system" +} + +output "test" { + value = length(data.kubernetes_resources.example.objects) +} diff --git a/examples/data-sources/resources/example_3.tf b/examples/data-sources/resources/example_3.tf new file mode 100644 index 0000000000..b3923985b7 --- /dev/null +++ b/examples/data-sources/resources/example_3.tf @@ -0,0 +1,9 @@ +data "kubernetes_resources" "example" { + api_version = "v1" + kind = "Namespace" + field_selector = "metadata.name!=kube-system" +} + +output "test" { + value = length(data.kubernetes_resources.example.objects) +} diff --git a/examples/data-sources/resources/example_4.tf b/examples/data-sources/resources/example_4.tf new file mode 100644 index 0000000000..db1f848367 --- /dev/null +++ b/examples/data-sources/resources/example_4.tf @@ -0,0 +1,9 @@ +data "kubernetes_resources" "example" { + api_version = "v1" + kind = "Namespace" + label_selector = "kubernetes.io/metadata.name!=kube-system" +} + +output "test" { + value = length(data.kubernetes_resources.example.objects) +} diff --git a/examples/data-sources/secret/example_1.tf b/examples/data-sources/secret/example_1.tf new file mode 100644 index 0000000000..122927200a --- /dev/null +++ b/examples/data-sources/secret/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_secret" "example" { + metadata { + name = "basic-auth" + } +} diff --git a/examples/data-sources/secret/example_2.tf b/examples/data-sources/secret/example_2.tf new file mode 100644 index 0000000000..8fba7cfdd1 --- /dev/null +++ b/examples/data-sources/secret/example_2.tf @@ -0,0 +1,10 @@ +data "kubernetes_secret" "example" { + metadata { + name = "example-secret" + namespace = "kube-system" + } + binary_data = { + "keystore.p12" = "" + another_field = "" + } +} diff --git a/examples/data-sources/secret/example_3.tf b/examples/data-sources/secret/example_3.tf new file mode 100644 index 0000000000..122927200a --- /dev/null +++ b/examples/data-sources/secret/example_3.tf @@ -0,0 +1,5 @@ +data "kubernetes_secret" "example" { + metadata { + name = "basic-auth" + } +} diff --git a/examples/data-sources/secret/example_4.tf b/examples/data-sources/secret/example_4.tf new file mode 100644 index 0000000000..8fba7cfdd1 --- /dev/null +++ b/examples/data-sources/secret/example_4.tf @@ -0,0 +1,10 @@ +data "kubernetes_secret" "example" { + metadata { + name = "example-secret" + namespace = "kube-system" + } + binary_data = { + "keystore.p12" = "" + another_field = "" + } +} diff --git a/examples/data-sources/secret_v1/example_1.tf b/examples/data-sources/secret_v1/example_1.tf new file mode 100644 index 0000000000..e79186316e --- /dev/null +++ b/examples/data-sources/secret_v1/example_1.tf @@ -0,0 +1,5 @@ +data "kubernetes_secret_v1" "example" { + metadata { + name = "basic-auth" + } +} diff --git a/examples/data-sources/secret_v1/example_2.tf b/examples/data-sources/secret_v1/example_2.tf new file mode 100644 index 0000000000..6b043aaa1e --- /dev/null +++ b/examples/data-sources/secret_v1/example_2.tf @@ -0,0 +1,10 @@ +data "kubernetes_secret_v1" "example" { + metadata { + name = "example-secret" + namespace = "kube-system" + } + binary_data = { + "keystore.p12" = "" + another_field = "" + } +} diff --git a/examples/data-sources/secret_v1/example_3.tf b/examples/data-sources/secret_v1/example_3.tf new file mode 100644 index 0000000000..e79186316e --- /dev/null +++ b/examples/data-sources/secret_v1/example_3.tf @@ -0,0 +1,5 @@ +data "kubernetes_secret_v1" "example" { + metadata { + name = "basic-auth" + } +} diff --git a/examples/data-sources/secret_v1/example_4.tf b/examples/data-sources/secret_v1/example_4.tf new file mode 100644 index 0000000000..6b043aaa1e --- /dev/null +++ b/examples/data-sources/secret_v1/example_4.tf @@ -0,0 +1,10 @@ +data "kubernetes_secret_v1" "example" { + metadata { + name = "example-secret" + namespace = "kube-system" + } + binary_data = { + "keystore.p12" = "" + another_field = "" + } +} diff --git a/examples/data-sources/service/example_1.tf b/examples/data-sources/service/example_1.tf new file mode 100644 index 0000000000..57694540c4 --- /dev/null +++ b/examples/data-sources/service/example_1.tf @@ -0,0 +1,13 @@ +data "kubernetes_service" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = "data.aws_route53_zone.k8.zone_id" + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/service/example_2.tf b/examples/data-sources/service/example_2.tf new file mode 100644 index 0000000000..57694540c4 --- /dev/null +++ b/examples/data-sources/service/example_2.tf @@ -0,0 +1,13 @@ +data "kubernetes_service" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = "data.aws_route53_zone.k8.zone_id" + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/service_account/example_1.tf b/examples/data-sources/service_account/example_1.tf new file mode 100644 index 0000000000..7ff47d0e3b --- /dev/null +++ b/examples/data-sources/service_account/example_1.tf @@ -0,0 +1,11 @@ +data "kubernetes_service_account" "example" { + metadata { + name = "terraform-example" + } +} + +data "kubernetes_secret" "example" { + metadata { + name = "${data.kubernetes_service_account.example.default_secret_name}" + } +} diff --git a/examples/data-sources/service_account/example_2.tf b/examples/data-sources/service_account/example_2.tf new file mode 100644 index 0000000000..7ff47d0e3b --- /dev/null +++ b/examples/data-sources/service_account/example_2.tf @@ -0,0 +1,11 @@ +data "kubernetes_service_account" "example" { + metadata { + name = "terraform-example" + } +} + +data "kubernetes_secret" "example" { + metadata { + name = "${data.kubernetes_service_account.example.default_secret_name}" + } +} diff --git a/examples/data-sources/service_account_v1/example_1.tf b/examples/data-sources/service_account_v1/example_1.tf new file mode 100644 index 0000000000..7782a8779e --- /dev/null +++ b/examples/data-sources/service_account_v1/example_1.tf @@ -0,0 +1,11 @@ +data "kubernetes_service_account_v1" "example" { + metadata { + name = "terraform-example" + } +} + +data "kubernetes_secret" "example" { + metadata { + name = "${data.kubernetes_service_account_v1.example.default_secret_name}" + } +} diff --git a/examples/data-sources/service_account_v1/example_2.tf b/examples/data-sources/service_account_v1/example_2.tf new file mode 100644 index 0000000000..7782a8779e --- /dev/null +++ b/examples/data-sources/service_account_v1/example_2.tf @@ -0,0 +1,11 @@ +data "kubernetes_service_account_v1" "example" { + metadata { + name = "terraform-example" + } +} + +data "kubernetes_secret" "example" { + metadata { + name = "${data.kubernetes_service_account_v1.example.default_secret_name}" + } +} diff --git a/examples/data-sources/service_v1/example_1.tf b/examples/data-sources/service_v1/example_1.tf new file mode 100644 index 0000000000..0028750d62 --- /dev/null +++ b/examples/data-sources/service_v1/example_1.tf @@ -0,0 +1,13 @@ +data "kubernetes_service_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = "data.aws_route53_zone.k8.zone_id" + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/data-sources/service_v1/example_2.tf b/examples/data-sources/service_v1/example_2.tf new file mode 100644 index 0000000000..52e00a3c31 --- /dev/null +++ b/examples/data-sources/service_v1/example_2.tf @@ -0,0 +1,13 @@ +=data "kubernetes_service_v1" "example" { + metadata { + name = "terraform-example" + } +} + +resource "aws_route53_record" "example" { + zone_id = "data.aws_route53_zone.k8.zone_id" + name = "example" + type = "CNAME" + ttl = "300" + records = [data.kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname] +} diff --git a/examples/example_1.tf b/examples/example_1.tf new file mode 100644 index 0000000000..78dcd9eb6c --- /dev/null +++ b/examples/example_1.tf @@ -0,0 +1,10 @@ +provider "kubernetes" { + config_path = "~/.kube/config" + config_context = "my-context" +} + +resource "kubernetes_namespace" "example" { + metadata { + name = "my-first-namespace" + } +} diff --git a/examples/example_2.tf b/examples/example_2.tf new file mode 100644 index 0000000000..c4b7768187 --- /dev/null +++ b/examples/example_2.tf @@ -0,0 +1,3 @@ +provider "kubernetes" { + config_path = "~/.kube/config" +} diff --git a/examples/example_3.tf b/examples/example_3.tf new file mode 100644 index 0000000000..71cb566bc7 --- /dev/null +++ b/examples/example_3.tf @@ -0,0 +1,6 @@ +provider "kubernetes" { + config_paths = [ + "/path/to/config_a.yaml", + "/path/to/config_b.yaml" + ] +} diff --git a/examples/example_4.tf b/examples/example_4.tf new file mode 100644 index 0000000000..a8471a9368 --- /dev/null +++ b/examples/example_4.tf @@ -0,0 +1,7 @@ +provider "kubernetes" { + host = "https://cluster_endpoint:port" + + client_certificate = file("~/.kube/client-cert.pem") + client_key = file("~/.kube/client-key.pem") + cluster_ca_certificate = file("~/.kube/cluster-ca-cert.pem") +} diff --git a/examples/example_5.tf b/examples/example_5.tf new file mode 100644 index 0000000000..d64d362945 --- /dev/null +++ b/examples/example_5.tf @@ -0,0 +1,9 @@ +provider "kubernetes" { + host = var.cluster_endpoint + cluster_ca_certificate = base64decode(var.cluster_ca_cert) + exec { + api_version = "client.authentication.k8s.io/v1beta1" + args = ["eks", "get-token", "--cluster-name", var.cluster_name] + command = "aws" + } +} diff --git a/examples/example_6.tf b/examples/example_6.tf new file mode 100644 index 0000000000..a5a2c1aaa6 --- /dev/null +++ b/examples/example_6.tf @@ -0,0 +1,8 @@ +resource "kubernetes_deployment_v1" "this" { + // omit the resource config + lifecycle { + ignore_changes = [ + spec[0].template[0].metadata[0].annotations["kubectl.kubernetes.io/restartedAt"], + ] + } +} diff --git a/examples/example_7.tf b/examples/example_7.tf new file mode 100644 index 0000000000..72f2d7ad45 --- /dev/null +++ b/examples/example_7.tf @@ -0,0 +1,6 @@ +provider "kubernetes" { + ignore_annotations = [ + "cni\\.projectcalico\\.org\\/podIP", + "cni\\.projectcalico\\.org\\/podIPs", + ] +} diff --git a/examples/example_8.tf b/examples/example_8.tf new file mode 100644 index 0000000000..673db28ab2 --- /dev/null +++ b/examples/example_8.tf @@ -0,0 +1,5 @@ +provider "kubernetes" { + ignore_annotations = [ + "^service\\.beta\\.kubernetes\\.io\\/aws-load-balancer.*", + ] +} diff --git a/examples/functions/manifest_decode/example_1.tf b/examples/functions/manifest_decode/example_1.tf new file mode 100644 index 0000000000..8b3fac8a7f --- /dev/null +++ b/examples/functions/manifest_decode/example_1.tf @@ -0,0 +1,16 @@ +# Configuration using provider functions must include required_providers configuration. +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + # Setting the provider version is a strongly recommended practice + # version = "..." + } + } + # Provider functions require Terraform 1.8 and later. + required_version = ">= 1.8.0" +} + +output "example_output" { + value = provider::kubernetes::manifest_decode(file("manifest.yaml")) +} diff --git a/examples/functions/manifest_decode_multi/example_1.tf b/examples/functions/manifest_decode_multi/example_1.tf new file mode 100644 index 0000000000..b30bc0da76 --- /dev/null +++ b/examples/functions/manifest_decode_multi/example_1.tf @@ -0,0 +1,16 @@ +# Configuration using provider functions must include required_providers configuration. +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + # Setting the provider version is a strongly recommended practice + # version = "..." + } + } + # Provider functions require Terraform 1.8 and later. + required_version = ">= 1.8.0" +} + +output "example_output" { + value = provider::kubernetes::manifest_decode_multi(file("manifest.yaml")) +} diff --git a/examples/functions/manifest_encode/example_1.tf b/examples/functions/manifest_encode/example_1.tf new file mode 100644 index 0000000000..c00f95daa4 --- /dev/null +++ b/examples/functions/manifest_encode/example_1.tf @@ -0,0 +1,29 @@ +# Configuration using provider functions must include required_providers configuration. +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + # Setting the provider version is a strongly recommended practice + # version = "..." + } + } + # Provider functions require Terraform 1.8 and later. + required_version = ">= 1.8.0" +} + +locals { + manifest = { + apiVersion = "v1" + kind = "ConfigMap" + metadata = { + name = "example" + } + data = { + EXAMPLE = "example" + } + } +} + +output "example_output" { + value = provider::kubernetes::manifest_encode(local.manifest) +} diff --git a/examples/resources/annotations/example_1.tf b/examples/resources/annotations/example_1.tf new file mode 100644 index 0000000000..653ab01116 --- /dev/null +++ b/examples/resources/annotations/example_1.tf @@ -0,0 +1,10 @@ +resource "kubernetes_annotations" "example" { + api_version = "v1" + kind = "ConfigMap" + metadata { + name = "my-config" + } + annotations = { + "owner" = "myteam" + } +} diff --git a/examples/resources/annotations/example_2.tf b/examples/resources/annotations/example_2.tf new file mode 100644 index 0000000000..e52f85af5a --- /dev/null +++ b/examples/resources/annotations/example_2.tf @@ -0,0 +1,15 @@ +resource "kubernetes_annotations" "example" { + api_version = "apps/v1" + kind = "Deployment" + metadata { + name = "my-config" + } + # These annotations will be applied to the Deployment resource itself + annotations = { + "owner" = "myteam" + } + # These annotations will be applied to the Pods created by the Deployment + template_annotations = { + "owner" = "myteam" + } +} diff --git a/examples/resources/api_service/example_1.tf b/examples/resources/api_service/example_1.tf new file mode 100644 index 0000000000..7dedafa2e4 --- /dev/null +++ b/examples/resources/api_service/example_1.tf @@ -0,0 +1,17 @@ +resource "kubernetes_api_service" "example" { + metadata { + name = "terraform-example" + } + spec { + selector { + app = "${kubernetes_pod.example.metadata.0.labels.app}" + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "LoadBalancer" + } +} diff --git a/examples/resources/api_service_v1/example_1.tf b/examples/resources/api_service_v1/example_1.tf new file mode 100644 index 0000000000..09e3010938 --- /dev/null +++ b/examples/resources/api_service_v1/example_1.tf @@ -0,0 +1,17 @@ +resource "kubernetes_api_service_v1" "example" { + metadata { + name = "terraform-example" + } + spec { + selector { + app = "${kubernetes_pod.example.metadata.0.labels.app}" + } + session_affinity = "ClientIP" + port { + port = 8080 + target_port = 80 + } + + type = "LoadBalancer" + } +} diff --git a/examples/resources/certificate_signing_request/example_1.tf b/examples/resources/certificate_signing_request/example_1.tf new file mode 100644 index 0000000000..05a08ee58b --- /dev/null +++ b/examples/resources/certificate_signing_request/example_1.tf @@ -0,0 +1,30 @@ +resource "kubernetes_certificate_signing_request" "example" { + metadata { + name = "example" + } + spec { + usages = ["client auth", "server auth"] + request = < 1 { + resp.Error = function.NewFuncError("YAML manifest contains multiple resources: use decode_manifest_multi to decode manifests containing more than one resource") + return + } + + dynamResp := types.DynamicValue(elems[0]) + resp.Error = resp.Result.Set(ctx, &dynamResp) +} diff --git a/internal/framework/provider/functions/manifest_decode_multi.go b/internal/framework/provider/functions/manifest_decode_multi.go new file mode 100644 index 0000000000..b3f3fec7f1 --- /dev/null +++ b/internal/framework/provider/functions/manifest_decode_multi.go @@ -0,0 +1,55 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package functions + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/function" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var _ function.Function = ManifestDecodeMultiFunction{} + +func NewManifestDecodeMultiFunction() function.Function { + return &ManifestDecodeMultiFunction{} +} + +type ManifestDecodeMultiFunction struct{} + +func (f ManifestDecodeMultiFunction) Metadata(_ context.Context, req function.MetadataRequest, resp *function.MetadataResponse) { + resp.Name = "manifest_decode_multi" +} + +func (f ManifestDecodeMultiFunction) Definition(_ context.Context, req function.DefinitionRequest, resp *function.DefinitionResponse) { + resp.Definition = function.Definition{ + Summary: "Decode a Kubernetes YAML manifest containing multiple resources", + MarkdownDescription: "Given a YAML text containing a Kubernetes manifest with multiple resources, will decode the manifest and return a tuple of object representations for each resource.", + Parameters: []function.Parameter{ + function.StringParameter{ + Name: "manifest", + MarkdownDescription: "The YAML plaintext for a Kubernetes manifest", + }, + }, + Return: function.DynamicReturn{}, + } +} + +func (f ManifestDecodeMultiFunction) Run(ctx context.Context, req function.RunRequest, resp *function.RunResponse) { + var manifest string + + resp.Error = req.Arguments.Get(ctx, &manifest) + if resp.Error != nil { + return + } + + tv, diags := decode(ctx, manifest) + if diags.HasError() { + resp.Error = function.FuncErrorFromDiags(ctx, diags) + return + } + + dynamResp := types.DynamicValue(tv) + resp.Error = resp.Result.Set(ctx, &dynamResp) +} diff --git a/internal/framework/provider/functions/manifest_decode_multi_test.go b/internal/framework/provider/functions/manifest_decode_multi_test.go new file mode 100644 index 0000000000..016596bb77 --- /dev/null +++ b/internal/framework/provider/functions/manifest_decode_multi_test.go @@ -0,0 +1,221 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package functions_test + +import ( + "fmt" + "math/big" + "os" + "path" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" +) + +func TestManifestDecodeMulti(t *testing.T) { + t.Parallel() + + outputName := "test" + + resource.UnitTest(t, resource.TestCase{ + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testManifestDecodeMultiConfig("testdata/decode_single.yaml"), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownOutputValue(outputName, knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "apiVersion": knownvalue.StringExact("v1"), + "data": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "configfile": knownvalue.StringExact("---\ntest: document\n"), + }), + "kind": knownvalue.StringExact("ConfigMap"), + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "annotations": knownvalue.Null(), + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "test": knownvalue.StringExact("test---label"), + }), + "name": knownvalue.StringExact("test-configmap"), + }), + "status": knownvalue.Null(), + }), + })), + }, + }, + { + Config: testManifestDecodeMultiConfig("testdata/decode_multi.yaml"), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownOutputValue(outputName, knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "apiVersion": knownvalue.StringExact("apps/v1"), + "kind": knownvalue.StringExact("DaemonSet"), + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "k8s-app": knownvalue.StringExact("fluentd-logging"), + }), + "name": knownvalue.StringExact("fluentd-elasticsearch"), + "namespace": knownvalue.StringExact("kube-system"), + }), + "spec": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "selector": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "matchLabels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "name": knownvalue.StringExact("fluentd-elasticsearch"), + }), + }), + "template": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "name": knownvalue.StringExact("fluentd-elasticsearch"), + }), + }), + "spec": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "containers": knownvalue.ListExact([]knownvalue.Check{knownvalue.ObjectExact(map[string]knownvalue.Check{ + "image": knownvalue.StringExact("quay.io/fluentd_elasticsearch/fluentd:v2.5.2"), + "name": knownvalue.StringExact("fluentd-elasticsearch"), + "resources": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "limits": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "cpu": knownvalue.NumberExact(big.NewFloat(1.5)), + "memory": knownvalue.StringExact("200Mi"), + }), + "requests": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "cpu": knownvalue.Int64Exact(1), + "memory": knownvalue.StringExact("200Mi"), + }), + }), + "volumeMounts": knownvalue.ListExact([]knownvalue.Check{knownvalue.ObjectExact(map[string]knownvalue.Check{ + "mountPath": knownvalue.StringExact("/var/log"), + "name": knownvalue.StringExact("varlog"), + })}), + })}), + "terminationGracePeriodSeconds": knownvalue.Int64Exact(30), + "tolerations": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "effect": knownvalue.StringExact("NoSchedule"), + "key": knownvalue.StringExact("node-role.kubernetes.io/control-plane"), + "operator": knownvalue.StringExact("Exists"), + }), + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "effect": knownvalue.StringExact("NoSchedule"), + "key": knownvalue.StringExact("node-role.kubernetes.io/master"), + "operator": knownvalue.StringExact("Exists"), + }), + }), + "volumes": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "hostPath": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "path": knownvalue.StringExact("/var/log"), + }), + "name": knownvalue.StringExact("varlog"), + }), + }), + }), + }), + }), + }), + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "apiVersion": knownvalue.StringExact("v1"), + "data": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "configfile": knownvalue.StringExact("---\ntest: document"), + "immutable": knownvalue.Bool(false), + }), + "kind": knownvalue.StringExact("ConfigMap"), + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "test": knownvalue.StringExact("test---label"), + }), + "name": knownvalue.StringExact("test-configmap"), + "namespace": knownvalue.StringExact("kube-system"), + }), + }), + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "apiVersion": knownvalue.StringExact("apps/v1"), + "kind": knownvalue.StringExact("DaemonSet"), + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "k8s-app": knownvalue.StringExact("fluentd-logging"), + }), + "name": knownvalue.StringExact("fluentd-elasticsearch2"), + "namespace": knownvalue.StringExact("kube-system"), + }), + "spec": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "selector": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "matchLabels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "name": knownvalue.StringExact("fluentd-elasticsearch"), + }), + }), + "template": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "name": knownvalue.StringExact("fluentd-elasticsearch"), + "something": knownvalue.StringExact("helloworld"), + }), + }), + "spec": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "containers": knownvalue.ListExact([]knownvalue.Check{knownvalue.ObjectExact(map[string]knownvalue.Check{ + "image": knownvalue.StringExact("quay.io/fluentd_elasticsearch/fluentd:v2.5.2"), + "name": knownvalue.StringExact("fluentd-elasticsearch"), + "resources": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "limits": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "memory": knownvalue.StringExact("200Mi"), + }), + "requests": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "cpu": knownvalue.StringExact("100m"), + "memory": knownvalue.StringExact("200Mi"), + }), + }), + "volumeMounts": knownvalue.ListExact([]knownvalue.Check{knownvalue.ObjectExact(map[string]knownvalue.Check{ + "mountPath": knownvalue.StringExact("/var/log"), + "name": knownvalue.StringExact("varlog"), + })}), + })}), + "terminationGracePeriodSeconds": knownvalue.Int64Exact(30), + "tolerations": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "effect": knownvalue.StringExact("NoSchedule"), + "key": knownvalue.StringExact("node-role.kubernetes.io/control-plane"), + "operator": knownvalue.StringExact("Exists"), + }), + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "effect": knownvalue.StringExact("NoSchedule"), + "key": knownvalue.StringExact("node-role.kubernetes.io/master"), + "operator": knownvalue.StringExact("Exists"), + }), + }), + "volumes": knownvalue.ListExact([]knownvalue.Check{ + knownvalue.ObjectExact(map[string]knownvalue.Check{ + "hostPath": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "path": knownvalue.StringExact("/var/log"), + }), + "name": knownvalue.StringExact("varlog"), + }), + }), + }), + }), + }), + }), + })), + }, + }, + { + Config: testManifestDecodeMultiConfig("testdata/decode_manifest_invalid.yaml"), + ExpectError: regexp.MustCompile(`Invalid\s+Kubernetes\s+manifest`), + }, + { + Config: testManifestDecodeMultiConfig("testdata/decode_manifest_invalid_syntax.yaml"), + ExpectError: regexp.MustCompile(`Invalid\s+YAML\s+document`), + }, + }, + }) +} + +func testManifestDecodeMultiConfig(filename string) string { + cwd, _ := os.Getwd() + return fmt.Sprintf(` +output "test" { + value = provider::kubernetes::manifest_decode_multi(file(%q)) +}`, path.Join(cwd, filename)) +} diff --git a/internal/framework/provider/functions/manifest_decode_test.go b/internal/framework/provider/functions/manifest_decode_test.go new file mode 100644 index 0000000000..4a2d9e645b --- /dev/null +++ b/internal/framework/provider/functions/manifest_decode_test.go @@ -0,0 +1,70 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package functions_test + +import ( + "fmt" + "os" + "path" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" +) + +func TestManifestDecode(t *testing.T) { + t.Parallel() + + outputName := "test" + + resource.UnitTest(t, resource.TestCase{ + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testManifestDecodeConfig("testdata/decode_single.yaml"), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownOutputValue(outputName, knownvalue.ObjectExact(map[string]knownvalue.Check{ + "apiVersion": knownvalue.StringExact("v1"), + "data": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "configfile": knownvalue.StringExact("---\ntest: document\n"), + }), + "kind": knownvalue.StringExact("ConfigMap"), + "metadata": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "annotations": knownvalue.Null(), + "labels": knownvalue.ObjectExact(map[string]knownvalue.Check{ + "test": knownvalue.StringExact("test---label"), + }), + "name": knownvalue.StringExact("test-configmap"), + }), + "status": knownvalue.Null(), + })), + }, + }, + }, + }) +} + +func TestManifestDecode_ErrorOnMulti(t *testing.T) { + t.Parallel() + + resource.UnitTest(t, resource.TestCase{ + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testManifestDecodeConfig("testdata/decode_multi.yaml"), + ExpectError: regexp.MustCompile(`YAML\s+manifest\s+contains\s+multiple\s+resources`), + }, + }, + }) +} + +func testManifestDecodeConfig(filename string) string { + cwd, _ := os.Getwd() + return fmt.Sprintf(` +output "test" { + value = provider::kubernetes::manifest_decode(file(%q)) +}`, path.Join(cwd, filename)) +} diff --git a/internal/framework/provider/functions/manifest_encode.go b/internal/framework/provider/functions/manifest_encode.go new file mode 100644 index 0000000000..7c474d1fdf --- /dev/null +++ b/internal/framework/provider/functions/manifest_encode.go @@ -0,0 +1,56 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package functions + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/function" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var _ function.Function = ManifestEncodeFunction{} + +func NewManifestEncodeFunction() function.Function { + return &ManifestEncodeFunction{} +} + +type ManifestEncodeFunction struct{} + +func (f ManifestEncodeFunction) Metadata(_ context.Context, req function.MetadataRequest, resp *function.MetadataResponse) { + resp.Name = "manifest_encode" +} + +func (f ManifestEncodeFunction) Definition(_ context.Context, req function.DefinitionRequest, resp *function.DefinitionResponse) { + resp.Definition = function.Definition{ + Summary: "Encode an object to Kubernetes YAML", + MarkdownDescription: "Given an object representation of a Kubernetes manifest, will encode and return a YAML string for that resource.", + Parameters: []function.Parameter{ + function.DynamicParameter{ + Name: "manifest", + MarkdownDescription: "The object representation of a Kubernetes manifest", + }, + }, + Return: function.StringReturn{}, + } +} + +func (f ManifestEncodeFunction) Run(ctx context.Context, req function.RunRequest, resp *function.RunResponse) { + var manifest types.Dynamic + + resp.Error = req.Arguments.Get(ctx, &manifest) + if resp.Error != nil { + return + } + + uv := manifest.UnderlyingValue() + s, diags := encode(uv) + if diags.HasError() { + resp.Error = function.FuncErrorFromDiags(ctx, diags) + return + } + + svalue := types.StringValue(s) + resp.Error = resp.Result.Set(ctx, &svalue) +} diff --git a/internal/framework/provider/functions/manifest_encode_test.go b/internal/framework/provider/functions/manifest_encode_test.go new file mode 100644 index 0000000000..9a4c131cef --- /dev/null +++ b/internal/framework/provider/functions/manifest_encode_test.go @@ -0,0 +1,219 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package functions_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +func TestManifestEncode(t *testing.T) { + t.Parallel() + + outputName := "test" + + resource.UnitTest(t, resource.TestCase{ + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testManifestEncodeConfig(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckOutput(outputName, `apiVersion: v1 +data: + test: test +kind: ConfigMap +metadata: + name: test + namespace: null +`), + ), + }, + }, + }) +} + +func TestManifestEncodeMulti(t *testing.T) { + t.Parallel() + + outputName := "test" + + resource.UnitTest(t, resource.TestCase{ + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testManifestEncodeMultiConfig(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckOutput(outputName, `--- +apiVersion: v1 +data: + test: test +immutable: false +kind: ConfigMap +metadata: + name: test +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + labels: + k8s-app: fluentd-logging + name: fluentd-elasticsearch2 + namespace: kube-system +spec: + selector: + matchLabels: + name: fluentd-elasticsearch + template: + metadata: + labels: + name: fluentd-elasticsearch + something: helloworld + spec: + containers: + - image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2 + name: fluentd-elasticsearch + resources: + limits: + cpu: 1.5 + memory: 200Mi + requests: + cpu: 100m + memory: 200Mi + volumeMounts: + - mountPath: /var/log + name: varlog + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoSchedule + key: node-role.kubernetes.io/control-plane + operator: Exists + - effect: NoSchedule + key: node-role.kubernetes.io/master + operator: Exists + volumes: + - hostPath: + path: /var/log + name: varlog +`), + ), + }, + }, + }) +} + +func testManifestEncodeConfig() string { + return ` +locals { + single_manifest = { + apiVersion = "v1" + kind = "ConfigMap" + metadata = { + name = "test" + namespace = null + } + data = { + "test" = "test" + } + } +} + +output "test" { + value = provider::kubernetes::manifest_encode(local.single_manifest) +}` +} + +func testManifestEncodeMultiConfig() string { + return ` +locals { + multi_manifest = [ + { + apiVersion = "v1" + kind = "ConfigMap" + metadata = { + name = "test" + } + data = { + "test" = "test" + } + immutable = false + }, + { + apiVersion = "apps/v1" + kind = "DaemonSet" + metadata = { + name = "fluentd-elasticsearch2" + namespace = "kube-system" + labels = { + "k8s-app" = "fluentd-logging" + } + } + spec = { + selector = { + matchLabels = { + name = "fluentd-elasticsearch" + } + } + template = { + metadata = { + labels = { + "something" = "helloworld" + "name" = "fluentd-elasticsearch" + } + } + spec = { + tolerations = [ + { + key = "node-role.kubernetes.io/control-plane" + operator = "Exists" + effect = "NoSchedule" + }, + { + key = "node-role.kubernetes.io/master" + operator = "Exists" + effect = "NoSchedule" + } + ] + containers = [ + { + name = "fluentd-elasticsearch" + image = "quay.io/fluentd_elasticsearch/fluentd:v2.5.2" + resources = { + limits = { + cpu = 1.5 + memory = "200Mi" + } + requests = { + cpu = "100m" + memory = "200Mi" + } + } + volumeMounts = [ + { + mountPath = "/var/log" + name = "varlog" + } + ] + } + ] + terminationGracePeriodSeconds = 30 + volumes = [ + { + name = "varlog" + hostPath = { + path = "/var/log" + } + } + ] + } + } + } + } + ] +} + +output "test" { + value = provider::kubernetes::manifest_encode(local.multi_manifest) +}` +} diff --git a/internal/framework/provider/functions/testdata/decode_manifest_invalid.yaml b/internal/framework/provider/functions/testdata/decode_manifest_invalid.yaml new file mode 100644 index 0000000000..c04e64f535 --- /dev/null +++ b/internal/framework/provider/functions/testdata/decode_manifest_invalid.yaml @@ -0,0 +1,7 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +--- +this: is +not: a +kubernetes: manifest diff --git a/internal/framework/provider/functions/testdata/decode_manifest_invalid_syntax.yaml b/internal/framework/provider/functions/testdata/decode_manifest_invalid_syntax.yaml new file mode 100644 index 0000000000..950820f5f8 --- /dev/null +++ b/internal/framework/provider/functions/testdata/decode_manifest_invalid_syntax.yaml @@ -0,0 +1,14 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +-- +apiVersion: v1 +kind: ConfigMap +metadata: + name: test-configmap + labels: + test: "test---label" + &data: + configfile: | + --- + test: document diff --git a/internal/framework/provider/functions/testdata/decode_multi.yaml b/internal/framework/provider/functions/testdata/decode_multi.yaml new file mode 100644 index 0000000000..b59897eacc --- /dev/null +++ b/internal/framework/provider/functions/testdata/decode_multi.yaml @@ -0,0 +1,119 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +# test comment +--- +# test comment +--- +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: fluentd-elasticsearch + namespace: kube-system + labels: + k8s-app: fluentd-logging +spec: + selector: + matchLabels: + name: fluentd-elasticsearch + template: + metadata: + labels: + name: fluentd-elasticsearch + spec: + tolerations: + # these tolerations are to have the daemonset runnable on control plane nodes + # remove them if your control plane nodes should not run pods + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + containers: + - name: fluentd-elasticsearch + image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2 + resources: + limits: + cpu: 1.5 + memory: 200Mi + requests: + cpu: 1 + memory: 200Mi + volumeMounts: + - name: varlog + mountPath: /var/log + # it may be desirable to set a high priority class to ensure that a DaemonSet Pod + # preempts running Pods + # priorityClassName: important + terminationGracePeriodSeconds: 30 + volumes: + - name: varlog + hostPath: + path: /var/log +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: test-configmap + namespace: kube-system + labels: + test: "test---label" +data: + immutable: false + configfile: | + --- + test: document + +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: fluentd-elasticsearch2 + namespace: kube-system + labels: + k8s-app: fluentd-logging +spec: + selector: + matchLabels: + name: fluentd-elasticsearch + template: + metadata: + labels: + something: "helloworld" + name: fluentd-elasticsearch + spec: + tolerations: + # these tolerations are to have the daemonset runnable on control plane nodes + # remove them if your control plane nodes should not run pods + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + containers: + - name: fluentd-elasticsearch + image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2 + resources: + limits: + memory: 200Mi + requests: + cpu: 100m + memory: 200Mi + volumeMounts: + - name: varlog + mountPath: /var/log + # it may be desirable to set a high priority class to ensure that a DaemonSet Pod + # preempts running Pods + # priorityClassName: important + terminationGracePeriodSeconds: 30 + volumes: + - name: varlog + hostPath: + path: /var/log +--- +--- +# test comment +--- diff --git a/internal/framework/provider/functions/testdata/decode_single.yaml b/internal/framework/provider/functions/testdata/decode_single.yaml new file mode 100644 index 0000000000..2c89d46c35 --- /dev/null +++ b/internal/framework/provider/functions/testdata/decode_single.yaml @@ -0,0 +1,16 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: test-configmap + annotations: null + labels: + test: "test---label" +data: + configfile: | + --- + test: document +status: diff --git a/internal/framework/provider/provider.go b/internal/framework/provider/provider.go index bbfd63ed06..f953b38875 100644 --- a/internal/framework/provider/provider.go +++ b/internal/framework/provider/provider.go @@ -7,14 +7,19 @@ import ( "context" "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" + pfunctions "github.com/hashicorp/terraform-provider-kubernetes/internal/framework/provider/functions" ) // Ensure KubernetesProvider satisfies various provider interfaces. -var _ provider.Provider = &KubernetesProvider{} +var ( + _ provider.Provider = &KubernetesProvider{} + _ provider.ProviderWithFunctions = &KubernetesProvider{} +) // KubernetesProvider defines the provider implementation. type KubernetesProvider struct { @@ -168,8 +173,9 @@ func (p *KubernetesProvider) Schema(ctx context.Context, req provider.SchemaRequ NestedObject: schema.NestedBlockObject{ Attributes: map[string]schema.Attribute{ "manifest_resource": schema.BoolAttribute{ - Description: "Enable the `kubernetes_manifest` resource.", - Optional: true, + Description: "Enable the `kubernetes_manifest` resource.", + Optional: true, + DeprecationMessage: "The kubernetes_manifest resource is now permanently enabled and no longer considered an experiment. This flag has no effect and will be removed in the near future.", }, }, }, @@ -186,6 +192,14 @@ func (p *KubernetesProvider) DataSources(ctx context.Context) []func() datasourc return []func() datasource.DataSource{} } +func (p *KubernetesProvider) Functions(ctx context.Context) []func() function.Function { + return []func() function.Function{ + pfunctions.NewManifestDecodeFunction, + pfunctions.NewManifestDecodeMultiFunction, + pfunctions.NewManifestEncodeFunction, + } +} + func New(version string) provider.Provider { return &KubernetesProvider{ version: version, diff --git a/internal/mux/mux.go b/internal/mux/mux.go new file mode 100644 index 0000000000..c4c279e1ff --- /dev/null +++ b/internal/mux/mux.go @@ -0,0 +1,25 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package mux + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-mux/tf5muxserver" + framework "github.com/hashicorp/terraform-provider-kubernetes/internal/framework/provider" + "github.com/hashicorp/terraform-provider-kubernetes/kubernetes" + manifest "github.com/hashicorp/terraform-provider-kubernetes/manifest/provider" +) + +func MuxServer(ctx context.Context, v string) (tfprotov5.ProviderServer, error) { + providers := []func() tfprotov5.ProviderServer{ + kubernetes.Provider().GRPCProvider, + manifest.Provider(), + providerserver.NewProtocol5(framework.New(v)), + } + + return tf5muxserver.NewMuxServer(ctx, providers...) +} diff --git a/kubernetes/data_source_kubernetes_all_namespaces.go b/kubernetes/data_source_kubernetes_all_namespaces.go index 5b51565d59..4d9d78a410 100644 --- a/kubernetes/data_source_kubernetes_all_namespaces.go +++ b/kubernetes/data_source_kubernetes_all_namespaces.go @@ -7,15 +7,17 @@ import ( "context" "crypto/sha256" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "log" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesAllNamespaces() *schema.Resource { return &schema.Resource{ + Description: "This data source provides a mechanism for listing the names of all available namespaces in a Kubernetes cluster. It can be used to check for existence of a specific namespaces or to apply another resource to all or a subset of existing namespaces in a cluster.In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users.", ReadContext: dataSourceKubernetesAllNamespacesRead, Schema: map[string]*schema.Schema{ "namespaces": { diff --git a/kubernetes/data_source_kubernetes_config_map_v1.go b/kubernetes/data_source_kubernetes_config_map_v1.go index c65cf9fb5e..01e920a07d 100644 --- a/kubernetes/data_source_kubernetes_config_map_v1.go +++ b/kubernetes/data_source_kubernetes_config_map_v1.go @@ -9,11 +9,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesConfigMapV1() *schema.Resource { return &schema.Resource{ + Description: "Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs.", ReadContext: dataSourceKubernetesConfigMapV1Read, Schema: map[string]*schema.Schema{ @@ -54,6 +56,9 @@ func dataSourceKubernetesConfigMapV1Read(ctx context.Context, d *schema.Resource log.Printf("[INFO] Reading config map %s", metadata.Name) cfgMap, err := conn.CoreV1().ConfigMaps(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_config_map_v1_test.go b/kubernetes/data_source_kubernetes_config_map_v1_test.go index 8e74e979d9..4edd022cc0 100644 --- a/kubernetes/data_source_kubernetes_config_map_v1_test.go +++ b/kubernetes/data_source_kubernetes_config_map_v1_test.go @@ -47,6 +47,25 @@ func TestAccKubernetesDataSourceConfigMapV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceConfigMapV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_config_map_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-config-map-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { // Use the data source to read the existing resource. + Config: testAccKubernetesDataSourceConfigMapV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "data.%", "0"), + ), + }, + }, + }) +} + // testAccKubernetesDataSourceConfigMapConfig_basic provides the terraform config // used to test basic functionality of the config_map data source. func testAccKubernetesDataSourceConfigMapV1_basic(name string) string { @@ -82,3 +101,12 @@ func testAccKubernetesDataSourceConfigMapV1_read() string { } ` } + +func testAccKubernetesDataSourceConfigMapV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_config_map_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_endpoints_v1.go b/kubernetes/data_source_kubernetes_endpoints_v1.go index 05c4833f6f..4b209a6821 100644 --- a/kubernetes/data_source_kubernetes_endpoints_v1.go +++ b/kubernetes/data_source_kubernetes_endpoints_v1.go @@ -9,11 +9,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesEndpointsV1() *schema.Resource { return &schema.Resource{ + Description: "An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service.", ReadContext: dataSourceKubernetesEndpointsV1Read, Schema: map[string]*schema.Schema{ "metadata": namespacedMetadataSchema("endpoints", true), @@ -45,6 +47,9 @@ func dataSourceKubernetesEndpointsV1Read(ctx context.Context, d *schema.Resource log.Printf("[INFO] Reading endpoints %s", metadata.Name) ep, err := conn.CoreV1().Endpoints(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.Errorf("Failed to read endpoint because: %s", err) } diff --git a/kubernetes/data_source_kubernetes_endpoints_v1_test.go b/kubernetes/data_source_kubernetes_endpoints_v1_test.go index a5139f98cf..bc11cfed59 100644 --- a/kubernetes/data_source_kubernetes_endpoints_v1_test.go +++ b/kubernetes/data_source_kubernetes_endpoints_v1_test.go @@ -60,6 +60,26 @@ func TestAccKubernetesDataSourceEndpointsV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceEndpointsV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_endpoints_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-endpoint-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckKubernetesEndpointV1Destroy, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceEndpointsV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "subset.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceEndpointsV1_read() string { return `data "kubernetes_endpoints_v1" "test" { metadata { @@ -68,3 +88,12 @@ func testAccKubernetesDataSourceEndpointsV1_read() string { } ` } + +func testAccKubernetesDataSourceEndpointsV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_endpoints_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_ingress.go b/kubernetes/data_source_kubernetes_ingress.go index dd5f5dcd60..2b95b0a2d4 100644 --- a/kubernetes/data_source_kubernetes_ingress.go +++ b/kubernetes/data_source_kubernetes_ingress.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" networking "k8s.io/api/networking/v1beta1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -22,6 +23,7 @@ func dataSourceKubernetesIngress() *schema.Resource { docIngressSpec := networking.IngressSpec{}.SwaggerDoc() return &schema.Resource{ + Description: "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. This data source allows you to pull data about such ingress.", ReadContext: dataSourceKubernetesIngressRead, Schema: map[string]*schema.Schema{ "metadata": namespacedMetadataSchema("ingress", false), @@ -151,6 +153,9 @@ func dataSourceKubernetesIngressRead(ctx context.Context, d *schema.ResourceData log.Printf("[INFO] Reading ingress %s", metadata.Name) ing, err := conn.ExtensionsV1beta1().Ingresses(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_ingress_test.go b/kubernetes/data_source_kubernetes_ingress_test.go index e859da34ba..3897e7b415 100644 --- a/kubernetes/data_source_kubernetes_ingress_test.go +++ b/kubernetes/data_source_kubernetes_ingress_test.go @@ -68,6 +68,28 @@ func TestAccKubernetesDataSourceIngress_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceIngress_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_ingress.test" + name := fmt.Sprintf("ceci-n.est-pas-une-ingress-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + skipIfClusterVersionGreaterThanOrEqual(t, "1.22.0") + }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceIngress_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "spec.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceIngress_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_ingress" "test" { metadata { @@ -104,3 +126,12 @@ func testAccKubernetesDataSourceIngress_read() string { } ` } + +func testAccKubernetesDataSourceIngress_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_ingress" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_ingress_v1.go b/kubernetes/data_source_kubernetes_ingress_v1.go index 1aa2865b9e..11d3d0b031 100644 --- a/kubernetes/data_source_kubernetes_ingress_v1.go +++ b/kubernetes/data_source_kubernetes_ingress_v1.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" networking "k8s.io/api/networking/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -23,6 +24,7 @@ func dataSourceKubernetesIngressV1() *schema.Resource { docIngressSpec := networking.IngressSpec{}.SwaggerDoc() return &schema.Resource{ + Description: "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. This data source allows you to pull data about such ingress.", ReadContext: dataSourceKubernetesIngressV1Read, Schema: map[string]*schema.Schema{ "metadata": namespacedMetadataSchema("ingress", false), @@ -162,6 +164,9 @@ func dataSourceKubernetesIngressV1Read(ctx context.Context, d *schema.ResourceDa log.Printf("[INFO] Reading ingress %s", metadata.Name) ing, err := conn.NetworkingV1().Ingresses(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_ingress_v1_test.go b/kubernetes/data_source_kubernetes_ingress_v1_test.go index 8f542d19ec..495f90df0f 100644 --- a/kubernetes/data_source_kubernetes_ingress_v1_test.go +++ b/kubernetes/data_source_kubernetes_ingress_v1_test.go @@ -70,6 +70,28 @@ func TestAccKubernetesDataSourceIngressV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceIngressV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_ingress_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-ingress-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + skipIfClusterVersionLessThan(t, "1.22.0") + }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceIngressV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "spec.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceIngressV1_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_ingress_v1" "test" { metadata { @@ -115,3 +137,12 @@ func testAccKubernetesDataSourceIngressV1_read() string { } ` } + +func testAccKubernetesDataSourceIngressV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_ingress_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1.go b/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1.go index 9e29bcbdc5..459511bfc5 100644 --- a/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1.go +++ b/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -18,6 +19,7 @@ func dataSourceKubernetesMutatingWebhookConfigurationV1() *schema.Resource { apiDoc := admissionregistrationv1.MutatingWebhookConfiguration{}.SwaggerDoc() webhookDoc := admissionregistrationv1.MutatingWebhook{}.SwaggerDoc() return &schema.Resource{ + Description: "A Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). This data source allows you to pull data about a given mutating webhook configuration based on its name.", ReadContext: dataSourceKubernetesMutatingWebhookConfigurationV1Read, Schema: map[string]*schema.Schema{ "metadata": metadataSchema("mutating webhook configuration", false), @@ -124,6 +126,9 @@ func dataSourceKubernetesMutatingWebhookConfigurationV1Read(ctx context.Context, log.Printf("[INFO] Reading mutating webhook configuration %s", metadata.Name) cfg, err := conn.AdmissionregistrationV1().MutatingWebhookConfigurations().Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1_test.go b/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1_test.go index 6b3c4c769f..e85f6a9b1d 100644 --- a/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1_test.go +++ b/kubernetes/data_source_kubernetes_mutating_webhook_configuration_v1_test.go @@ -101,6 +101,26 @@ func TestAccKubernetesDataSourceMutatingWebhookConfigurationV1_basic(t *testing. }) } +func TestAccKubernetesDataSourceMutatingWebhookConfigurationV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_mutating_webhook_configuration_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-webhook-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceMutatingWebhookConfigurationV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "webhook.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceMutatingWebhookConfigurationV1_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_mutating_webhook_configuration_v1" "test" { metadata { @@ -141,3 +161,12 @@ func testAccKubernetesDataSourceMutatingWebhookConfigurationV1_read() string { } ` } + +func testAccKubernetesDataSourceMutatingWebhookConfigurationV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_mutating_webhook_configuration_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_namespace_v1.go b/kubernetes/data_source_kubernetes_namespace_v1.go index 06b7de5e53..613ad49cdc 100644 --- a/kubernetes/data_source_kubernetes_namespace_v1.go +++ b/kubernetes/data_source_kubernetes_namespace_v1.go @@ -10,11 +10,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesNamespaceV1() *schema.Resource { return &schema.Resource{ + Description: "This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users.", ReadContext: dataSourceKubernetesNamespaceV1Read, Schema: map[string]*schema.Schema{ @@ -51,6 +53,9 @@ func dataSourceKubernetesNamespaceV1Read(ctx context.Context, d *schema.Resource namespace, err := conn.CoreV1().Namespaces().Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_namespace_v1_test.go b/kubernetes/data_source_kubernetes_namespace_v1_test.go index bf25951473..8da98962a5 100644 --- a/kubernetes/data_source_kubernetes_namespace_v1_test.go +++ b/kubernetes/data_source_kubernetes_namespace_v1_test.go @@ -4,8 +4,10 @@ package kubernetes import ( + "fmt" "testing" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -31,6 +33,24 @@ func TestAccKubernetesDataSourceNamespaceV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceNamespaceV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_namespace_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-namespace-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceNamespaceV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "spec.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceNamespaceV1_basic() string { return `data "kubernetes_namespace_v1" "test" { metadata { @@ -39,3 +59,12 @@ func testAccKubernetesDataSourceNamespaceV1_basic() string { } ` } + +func testAccKubernetesDataSourceNamespaceV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_namespace_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_nodes.go b/kubernetes/data_source_kubernetes_nodes.go index 9231f95a72..54439718c9 100644 --- a/kubernetes/data_source_kubernetes_nodes.go +++ b/kubernetes/data_source_kubernetes_nodes.go @@ -12,12 +12,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" ) func dataSourceKubernetesNodes() *schema.Resource { return &schema.Resource{ + Description: "This data source provides a mechanism for listing the names of nodes in a kubernetes cluster.By default, all nodes in the cluster are returned, but queries by node label are also supported. It can be used to check for the existence of a specific node or to lookup a node to apply a taint with the `kubernetes_node_taint` resource.", ReadContext: dataSourceKubernetesNodesRead, Schema: map[string]*schema.Schema{ "metadata": { @@ -89,6 +91,9 @@ func dataSourceKubernetesNodesRead(ctx context.Context, d *schema.ResourceData, log.Printf("[INFO] Listing nodes") nodesRaw, err := conn.CoreV1().Nodes().List(ctx, listOptions) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } return diag.FromErr(err) } nodes := make([]interface{}, len(nodesRaw.Items)) diff --git a/kubernetes/data_source_kubernetes_nodes_test.go b/kubernetes/data_source_kubernetes_nodes_test.go index 36b5832abd..d733fa1105 100644 --- a/kubernetes/data_source_kubernetes_nodes_test.go +++ b/kubernetes/data_source_kubernetes_nodes_test.go @@ -50,6 +50,23 @@ func TestAccKubernetesDataSourceNodes_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceNodes_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_nodes.test" + checkFuncs := resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "nodes.#", "0"), + ) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceNodes_nonexistent(), + Check: checkFuncs, + }, + }, + }) +} + func testAccKubernetesDataSourceNodes_basic() string { return `data "kubernetes_nodes" "test" {} ` @@ -65,3 +82,14 @@ func testAccKubernetesDataSourceNodes_labels() string { } ` } + +func testAccKubernetesDataSourceNodes_nonexistent() string { + return `data "kubernetes_nodes" "test" { + metadata { + labels = { + "ceci-n.est-pas" = "une-node" + } + } +} +` +} diff --git a/kubernetes/data_source_kubernetes_persistent_volume_claim_v1.go b/kubernetes/data_source_kubernetes_persistent_volume_claim_v1.go index 92771fd595..9f44fc5f03 100644 --- a/kubernetes/data_source_kubernetes_persistent_volume_claim_v1.go +++ b/kubernetes/data_source_kubernetes_persistent_volume_claim_v1.go @@ -9,11 +9,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesPersistentVolumeClaimV1() *schema.Resource { return &schema.Resource{ + Description: "A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC.", ReadContext: dataSourceKubernetesPersistentVolumeClaimV1Read, Schema: map[string]*schema.Schema{ @@ -105,6 +107,9 @@ func dataSourceKubernetesPersistentVolumeClaimV1Read(ctx context.Context, d *sch log.Printf("[INFO] Reading persistent volume claim %s", metadata.Name) claim, err := conn.CoreV1().PersistentVolumeClaims(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_persistent_volume_claim_v1_test.go b/kubernetes/data_source_kubernetes_persistent_volume_claim_v1_test.go index 325bd757cc..33019a68cd 100644 --- a/kubernetes/data_source_kubernetes_persistent_volume_claim_v1_test.go +++ b/kubernetes/data_source_kubernetes_persistent_volume_claim_v1_test.go @@ -56,6 +56,25 @@ func TestAccKubernetesDataSourcePersistentVolumeClaimV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourcePersistentVolumeClaimV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_persistent_volume_claim_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-pvc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { // The first apply creates the resource. The second apply reads the resource using the data source. + Config: testAccKubernetesDataSourcePersistentVolumeClaimV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "spec.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourcePersistentVolumeClaimV1_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_persistent_volume_claim_v1" "test" { metadata { @@ -98,3 +117,12 @@ func testAccKubernetesDataSourcePersistentVolumeClaimV1_read() string { } ` } + +func testAccKubernetesDataSourcePersistentVolumeClaimV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_persistent_volume_claim_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_persistent_volume_v1.go b/kubernetes/data_source_kubernetes_persistent_volume_v1.go index 163fe60a09..9fad47b977 100644 --- a/kubernetes/data_source_kubernetes_persistent_volume_v1.go +++ b/kubernetes/data_source_kubernetes_persistent_volume_v1.go @@ -15,6 +15,7 @@ import ( func dataSourceKubernetesPersistentVolumeV1() *schema.Resource { return &schema.Resource{ + Description: "A PersistentVolume (PV) is a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. This data source retrieves information about the specified PV.", ReadContext: dataSourceKubernetesPersistentVolumeV1Read, Schema: map[string]*schema.Schema{ @@ -35,6 +36,7 @@ func dataSourceKubernetesPersistentVolumeV1() *schema.Resource { "ReadWriteOnce", "ReadOnlyMany", "ReadWriteMany", + "ReadWriteOncePod", }, false), }, Set: schema.HashString, diff --git a/kubernetes/data_source_kubernetes_pod_v1.go b/kubernetes/data_source_kubernetes_pod_v1.go index c944d0aa33..b482b78fa4 100644 --- a/kubernetes/data_source_kubernetes_pod_v1.go +++ b/kubernetes/data_source_kubernetes_pod_v1.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -18,6 +19,7 @@ func dataSourceKubernetesPodV1() *schema.Resource { // being mutated on the server side as Kubernetes automatically adds a mount // for the service account token return &schema.Resource{ + Description: "A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context.Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/)", ReadContext: dataSourceKubernetesPodV1Read, Schema: map[string]*schema.Schema{ @@ -55,6 +57,9 @@ func dataSourceKubernetesPodV1Read(ctx context.Context, d *schema.ResourceData, log.Printf("[INFO] Reading pod %s", metadata.Name) pod, err := conn.CoreV1().Pods(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_pod_v1_test.go b/kubernetes/data_source_kubernetes_pod_v1_test.go index e823013171..b01d428f35 100644 --- a/kubernetes/data_source_kubernetes_pod_v1_test.go +++ b/kubernetes/data_source_kubernetes_pod_v1_test.go @@ -40,6 +40,25 @@ func TestAccKubernetesDataSourcePodV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourcePodV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_pod_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-pod-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourcePodV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "spec.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourcePodV1_basic(name, imageName string) string { return fmt.Sprintf(`resource "kubernetes_pod_v1" "test" { metadata { @@ -63,3 +82,12 @@ func testAccKubernetesDataSourcePodV1_read() string { } ` } + +func testAccKubernetesDataSourcePodV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_pod_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_secret_v1.go b/kubernetes/data_source_kubernetes_secret_v1.go index 49e6261e1f..8cba1989a7 100644 --- a/kubernetes/data_source_kubernetes_secret_v1.go +++ b/kubernetes/data_source_kubernetes_secret_v1.go @@ -9,11 +9,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesSecretV1() *schema.Resource { return &schema.Resource{ + Description: "The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace.", ReadContext: dataSourceKubernetesSecretV1Read, Schema: map[string]*schema.Schema{ @@ -61,6 +63,9 @@ func dataSourceKubernetesSecretV1Read(ctx context.Context, d *schema.ResourceDat log.Printf("[INFO] Reading secret %s", metadata.Name) secret, err := conn.CoreV1().Secrets(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } return diag.FromErr(err) } log.Printf("[INFO] Received secret: %#v", secret.ObjectMeta) diff --git a/kubernetes/data_source_kubernetes_secret_v1_test.go b/kubernetes/data_source_kubernetes_secret_v1_test.go index 2a2ba84cb3..05b585ddef 100644 --- a/kubernetes/data_source_kubernetes_secret_v1_test.go +++ b/kubernetes/data_source_kubernetes_secret_v1_test.go @@ -81,6 +81,25 @@ func TestAccKubernetesDataSourceSecretV1_generateName(t *testing.T) { }) } +func TestAccKubernetesDataSourceSecretV1_not_found(t *testing.T) { + name := fmt.Sprintf("ceci-n.est-pas-une-secret-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + datasourceName := "data.kubernetes_secret_v1.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceSecretV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(datasourceName, "data.%", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceSecretV1_generateName(generate_name string) string { return fmt.Sprintf(`resource "kubernetes_secret_v1" "test" { metadata { @@ -147,3 +166,12 @@ func testAccKubernetesDataSourceSecretV1_read() string { } ` } + +func testAccKubernetesDataSourceSecretV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_secret_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_service_account_v1.go b/kubernetes/data_source_kubernetes_service_account_v1.go index 8dadbb2fbc..c48683750a 100644 --- a/kubernetes/data_source_kubernetes_service_account_v1.go +++ b/kubernetes/data_source_kubernetes_service_account_v1.go @@ -9,11 +9,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesServiceAccountV1() *schema.Resource { return &schema.Resource{ + Description: "A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/)", ReadContext: dataSourceKubernetesServiceAccountV1Read, Schema: map[string]*schema.Schema{ @@ -69,7 +71,11 @@ func dataSourceKubernetesServiceAccountV1Read(ctx context.Context, d *schema.Res metadata := expandMetadata(d.Get("metadata").([]interface{})) sa, err := conn.CoreV1().ServiceAccounts(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { - return diag.Errorf("Unable to fetch service account from Kubernetes: %s", err) + if apierrors.IsNotFound(err) { + d.SetId(buildId(sa.ObjectMeta)) + return nil + } + return diag.Errorf(`Unable to fetch service account "%s/%s" from Kubernetes: %s`, metadata.Namespace, metadata.Name, err) } defaultSecret, diagMsg := findDefaultServiceAccountV1(ctx, sa, conn) @@ -84,6 +90,9 @@ func dataSourceKubernetesServiceAccountV1Read(ctx context.Context, d *schema.Res log.Printf("[INFO] Reading service account %s", metadata.Name) svcAcc, err := conn.CoreV1().ServiceAccounts(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) diagMsg = append(diagMsg, diag.FromErr(err)...) return diagMsg diff --git a/kubernetes/data_source_kubernetes_service_account_v1_test.go b/kubernetes/data_source_kubernetes_service_account_v1_test.go index ebdb5cfcbf..fd80fde50a 100644 --- a/kubernetes/data_source_kubernetes_service_account_v1_test.go +++ b/kubernetes/data_source_kubernetes_service_account_v1_test.go @@ -80,6 +80,26 @@ func TestAccKubernetesDataSourceServiceAccountV1_default_secret(t *testing.T) { }) } +func TestAccKubernetesDataSourceServiceAccountV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_service_account_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-service-account-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceServiceAccountV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "secret.#", "0"), + resource.TestCheckResourceAttr(dataSourceName, "image_pull_secret.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceServiceAccountV1_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_service_account_v1" "test" { metadata { @@ -162,3 +182,12 @@ func testAccKubernetesDataSourceServiceAccountV1_default_secret_read(name string } `, name) } + +func testAccKubernetesDataSourceServiceAccountV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_service_account_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_service_v1.go b/kubernetes/data_source_kubernetes_service_v1.go index 8999de8476..634f9f658f 100644 --- a/kubernetes/data_source_kubernetes_service_v1.go +++ b/kubernetes/data_source_kubernetes_service_v1.go @@ -11,11 +11,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesServiceV1() *schema.Resource { return &schema.Resource{ + Description: "A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service.", ReadContext: dataSourceKubernetesServiceV1Read, Schema: map[string]*schema.Schema{ "metadata": namespacedMetadataSchema("service", false), @@ -257,6 +259,9 @@ func dataSourceKubernetesServiceV1Read(ctx context.Context, d *schema.ResourceDa log.Printf("[INFO] Reading service %s", metadata.Name) svc, err := conn.CoreV1().Services(metadata.Namespace).Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_service_v1_test.go b/kubernetes/data_source_kubernetes_service_v1_test.go index 4e9f24a35a..31bd1bf593 100644 --- a/kubernetes/data_source_kubernetes_service_v1_test.go +++ b/kubernetes/data_source_kubernetes_service_v1_test.go @@ -83,6 +83,26 @@ func TestAccKubernetesDataSourceServiceV1_basic(t *testing.T) { }) } +func TestAccKubernetesDataSourceServiceV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_service_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-service-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesConfig_ignoreAnnotations() + + testAccKubernetesDataSourceServiceV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "spec.#", "0"), + ), + }, + }, + }) +} + func testAccKubernetesDataSourceServiceV1_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_service_v1" "test" { metadata { @@ -118,3 +138,12 @@ func testAccKubernetesDataSourceServiceV1_read() string { } ` } + +func testAccKubernetesDataSourceServiceV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_service_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/data_source_kubernetes_storage_class_v1.go b/kubernetes/data_source_kubernetes_storage_class_v1.go index 19d1bcf6cf..04ea88a353 100644 --- a/kubernetes/data_source_kubernetes_storage_class_v1.go +++ b/kubernetes/data_source_kubernetes_storage_class_v1.go @@ -9,11 +9,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dataSourceKubernetesStorageClassV1() *schema.Resource { return &schema.Resource{ + Description: "Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform.Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/", ReadContext: dataSourceKubernetesStorageClassV1Read, Schema: map[string]*schema.Schema{ "metadata": metadataSchema("storage class", false), @@ -100,6 +102,9 @@ func dataSourceKubernetesStorageClassV1Read(ctx context.Context, d *schema.Resou log.Printf("[INFO] Reading storage class %s", metadata.Name) storageClass, err := conn.StorageV1().StorageClasses().Get(ctx, metadata.Name, metav1.GetOptions{}) if err != nil { + if apierrors.IsNotFound(err) { + return nil + } log.Printf("[DEBUG] Received error: %#v", err) return diag.FromErr(err) } diff --git a/kubernetes/data_source_kubernetes_storage_class_v1_test.go b/kubernetes/data_source_kubernetes_storage_class_v1_test.go index 633b32fc65..c1a6f89bc1 100644 --- a/kubernetes/data_source_kubernetes_storage_class_v1_test.go +++ b/kubernetes/data_source_kubernetes_storage_class_v1_test.go @@ -73,6 +73,26 @@ func TestAccKubernetesDataSourceStorageClassV1_minikube(t *testing.T) { }) } +func TestAccKubernetesDataSourceStorageClassV1_not_found(t *testing.T) { + dataSourceName := "data.kubernetes_storage_class_v1.test" + name := fmt.Sprintf("ceci-n.est-pas-une-storage-class-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); skipIfNotRunningInKind(t) }, + ProviderFactories: testAccProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesDataSourceStorageClassV1_nonexistent(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "metadata.0.name", name), + resource.TestCheckResourceAttr(dataSourceName, "mount_options.#", "0"), + resource.TestCheckResourceAttr(dataSourceName, "parameters.%", "0"), + ), + }, + }, + }) +} + func TestAccKubernetesDataSourceStorageClassV1_gke(t *testing.T) { resourceName := "kubernetes_storage_class_v1.test" dataSourceName := "data.kubernetes_storage_class_v1.test" @@ -178,3 +198,12 @@ func testAccKubernetesDataSourceStorageClassV1_read() string { } ` } + +func testAccKubernetesDataSourceStorageClassV1_nonexistent(name string) string { + return fmt.Sprintf(`data "kubernetes_storage_class_v1" "test" { + metadata { + name = "%s" + } +} +`, name) +} diff --git a/kubernetes/provider.go b/kubernetes/provider.go index c81bd92966..430bcf7d61 100644 --- a/kubernetes/provider.go +++ b/kubernetes/provider.go @@ -190,6 +190,7 @@ func Provider() *schema.Provider { return true, nil }, Description: "Enable the `kubernetes_manifest` resource.", + Deprecated: "The kubernetes_manifest resource is now permanently enabled and no longer considered an experiment. This flag has no effect and will be removed in the near future.", }, }, }, @@ -360,8 +361,13 @@ func Provider() *schema.Provider { }, } - p.ConfigureContextFunc = func(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { - return providerConfigure(ctx, d, p.TerraformVersion) + p.ConfigureProvider = func(ctx context.Context, req schema.ConfigureProviderRequest, res *schema.ConfigureProviderResponse) { + if req.DeferralAllowed && !req.ResourceData.GetRawConfig().IsWhollyKnown() { + res.Deferred = &schema.Deferred{ + Reason: schema.DeferredReasonProviderConfigUnknown, + } + } + res.Meta, res.Diagnostics = providerConfigure(ctx, req.ResourceData, p.TerraformVersion) } return p @@ -374,7 +380,7 @@ type KubeClientsets interface { DiscoveryClient() (discovery.DiscoveryInterface, error) } -type kubeClientsets struct { +type providerMetadata struct { // TODO: this struct has become overloaded we should // rename this or break it into smaller structs config *restclient.Config @@ -387,7 +393,7 @@ type kubeClientsets struct { IgnoreLabels []string } -func (k kubeClientsets) MainClientset() (*kubernetes.Clientset, error) { +func (k providerMetadata) MainClientset() (*kubernetes.Clientset, error) { if k.mainClientset != nil { return k.mainClientset, nil } @@ -402,7 +408,7 @@ func (k kubeClientsets) MainClientset() (*kubernetes.Clientset, error) { return k.mainClientset, nil } -func (k kubeClientsets) AggregatorClientset() (*aggregator.Clientset, error) { +func (k providerMetadata) AggregatorClientset() (*aggregator.Clientset, error) { if k.aggregatorClientset != nil { return k.aggregatorClientset, nil } @@ -416,7 +422,7 @@ func (k kubeClientsets) AggregatorClientset() (*aggregator.Clientset, error) { return k.aggregatorClientset, nil } -func (k kubeClientsets) DynamicClient() (dynamic.Interface, error) { +func (k providerMetadata) DynamicClient() (dynamic.Interface, error) { if k.dynamicClient != nil { return k.dynamicClient, nil } @@ -431,7 +437,7 @@ func (k kubeClientsets) DynamicClient() (dynamic.Interface, error) { return k.dynamicClient, nil } -func (k kubeClientsets) DiscoveryClient() (discovery.DiscoveryInterface, error) { +func (k providerMetadata) DiscoveryClient() (discovery.DiscoveryInterface, error) { if k.discoveryClient != nil { return k.discoveryClient, nil } @@ -448,9 +454,9 @@ func (k kubeClientsets) DiscoveryClient() (discovery.DiscoveryInterface, error) func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVersion string) (interface{}, diag.Diagnostics) { // Config initialization - cfg, err := initializeConfiguration(d) - if err != nil { - return nil, diag.FromErr(err) + cfg, diags := initializeConfiguration(d) + if diags.HasError() { + return nil, diags } if cfg == nil { // This is a TEMPORARY measure to work around https://github.com/hashicorp/terraform/issues/24055 @@ -479,7 +485,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVer ignoreLabels = expandStringSlice(v) } - m := kubeClientsets{ + m := providerMetadata{ config: cfg, mainClientset: nil, aggregatorClientset: nil, @@ -489,7 +495,8 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVer return m, diag.Diagnostics{} } -func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, error) { +func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, diag.Diagnostics) { + diags := make(diag.Diagnostics, 0) overrides := &clientcmd.ConfigOverrides{} loader := &clientcmd.ClientConfigLoadingRules{} @@ -512,7 +519,7 @@ func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, error) for _, p := range configPaths { path, err := homedir.Expand(p) if err != nil { - return nil, err + return nil, append(diags, diag.FromErr(err)...) } log.Printf("[DEBUG] Using kubeconfig: %s", path) @@ -571,12 +578,17 @@ func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, error) // see https://github.com/kubernetes/client-go/blob/v12.0.0/rest/url_utils.go#L85-L87 hasCA := len(overrides.ClusterInfo.CertificateAuthorityData) != 0 hasCert := len(overrides.AuthInfo.ClientCertificateData) != 0 - defaultTLS := hasCA || hasCert || overrides.ClusterInfo.InsecureSkipTLSVerify + defaultTLS := (hasCA || hasCert) && !overrides.ClusterInfo.InsecureSkipTLSVerify host, _, err := restclient.DefaultServerURL(v.(string), "", apimachineryschema.GroupVersion{}, defaultTLS) if err != nil { - return nil, fmt.Errorf("Failed to parse host: %s", err) + nd := diag.Diagnostic{ + Severity: diag.Error, + Summary: fmt.Sprintf("Failed to parse value for host: %s", v.(string)), + Detail: err.Error(), + AttributePath: cty.Path{}.IndexString("host"), + } + return nil, append(diags, nd) } - overrides.ClusterInfo.Server = host.String() } if v, ok := d.GetOk("username"); ok { @@ -603,7 +615,12 @@ func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, error) exec.Env = append(exec.Env, clientcmdapi.ExecEnvVar{Name: kk, Value: vv.(string)}) } } else { - return nil, fmt.Errorf("Failed to parse exec") + nd := diag.Diagnostic{ + Severity: diag.Error, + Summary: "Failed to parse 'exec' provider configuration", + AttributePath: cty.Path{}.IndexString("exec"), + } + return nil, append(diags, nd) } overrides.AuthInfo.Exec = exec } @@ -615,11 +632,16 @@ func initializeConfiguration(d *schema.ResourceData) (*restclient.Config, error) cc := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loader, overrides) cfg, err := cc.ClientConfig() if err != nil { - log.Printf("[WARN] Invalid provider configuration was supplied. Provider operations likely to fail: %v", err) - return nil, nil + nd := diag.Diagnostic{ + Severity: diag.Warning, + Summary: "Provider was supplied an invalid configuration. Further operations likely to fail.", + Detail: err.Error(), + } + log.Printf("[WARN] Provider was supplied an invalid configuration. Further operations likely to fail: %v", err) + return nil, append(diags, nd) } - return cfg, nil + return cfg, diags } var useadmissionregistrationv1beta1 *bool diff --git a/kubernetes/resource_kubernetes_annotations.go b/kubernetes/resource_kubernetes_annotations.go index c3f3ef9e52..7333f09fb9 100644 --- a/kubernetes/resource_kubernetes_annotations.go +++ b/kubernetes/resource_kubernetes_annotations.go @@ -26,6 +26,7 @@ import ( func resourceKubernetesAnnotations() *schema.Resource { return &schema.Resource{ + Description: "This resource allows Terraform to manage the annotations for a resource that already exists. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the annotations that are defined in the Terraform configuration. Existing annotations not specified in the configuration will be ignored. If an annotation specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true.", CreateContext: resourceKubernetesAnnotationsCreate, ReadContext: resourceKubernetesAnnotationsRead, UpdateContext: resourceKubernetesAnnotationsUpdate, diff --git a/kubernetes/resource_kubernetes_api_service_v1.go b/kubernetes/resource_kubernetes_api_service_v1.go index b186b89fb5..9e1799a3ec 100644 --- a/kubernetes/resource_kubernetes_api_service_v1.go +++ b/kubernetes/resource_kubernetes_api_service_v1.go @@ -19,6 +19,7 @@ import ( func resourceKubernetesAPIServiceV1() *schema.Resource { return &schema.Resource{ + Description: "An API Service is an abstraction which defines for locating and communicating with servers.", CreateContext: resourceKubernetesAPIServiceV1Create, ReadContext: resourceKubernetesAPIServiceV1Read, UpdateContext: resourceKubernetesAPIServiceV1Update, diff --git a/kubernetes/resource_kubernetes_certificate_signing_request.go b/kubernetes/resource_kubernetes_certificate_signing_request.go index 393a4d5df5..e552230530 100644 --- a/kubernetes/resource_kubernetes_certificate_signing_request.go +++ b/kubernetes/resource_kubernetes_certificate_signing_request.go @@ -24,6 +24,7 @@ func resourceKubernetesCertificateSigningRequest() *schema.Resource { apiDocStatus := v1beta1.CertificateSigningRequestStatus{}.SwaggerDoc() return &schema.Resource{ + Description: "Use this resource to generate TLS certificates using Kubernetes. This is a *logical resource*, so it contributes only to the current Terraform state and does not persist any external managed resources. This resource enables automation of [X.509](https://www.itu.int/rec/T-REC-X.509) credential provisioning (including TLS/SSL certificates). It does this by creating a CertificateSigningRequest using the Kubernetes API, which generates a certificate from the Certificate Authority (CA) configured in the Kubernetes cluster. The CSR can be approved automatically by Terraform, or it can be approved by a custom controller running in Kubernetes. See [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/) for all available options pertaining to CertificateSigningRequests.", CreateContext: resourceKubernetesCertificateSigningRequestCreate, ReadContext: resourceKubernetesCertificateSigningRequestRead, DeleteContext: resourceKubernetesCertificateSigningRequestDelete, diff --git a/kubernetes/resource_kubernetes_certificate_signing_request_v1.go b/kubernetes/resource_kubernetes_certificate_signing_request_v1.go index 242f279ff7..48e9f4361a 100644 --- a/kubernetes/resource_kubernetes_certificate_signing_request_v1.go +++ b/kubernetes/resource_kubernetes_certificate_signing_request_v1.go @@ -25,6 +25,7 @@ func resourceKubernetesCertificateSigningRequestV1() *schema.Resource { apiDocStatus := certificates.CertificateSigningRequestStatus{}.SwaggerDoc() return &schema.Resource{ + Description: "Use this resource to generate TLS certificates using Kubernetes. This is a *logical resource*, so it contributes only to the current Terraform state and does not persist any external managed resources. This resource enables automation of [X.509](https://www.itu.int/rec/T-REC-X.509) credential provisioning (including TLS/SSL certificates). It does this by creating a CertificateSigningRequest using the Kubernetes API, which generates a certificate from the Certificate Authority (CA) configured in the Kubernetes cluster. The CSR can be approved automatically by Terraform, or it can be approved by a custom controller running in Kubernetes. See [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/) for all available options pertaining to CertificateSigningRequests.", CreateContext: resourceKubernetesCertificateSigningRequestV1Create, ReadContext: resourceKubernetesCertificateSigningRequestV1Read, DeleteContext: resourceKubernetesCertificateSigningRequestV1Delete, diff --git a/kubernetes/resource_kubernetes_cluster_role_binding_v1.go b/kubernetes/resource_kubernetes_cluster_role_binding_v1.go index d8ffdcd0ac..2b5575e784 100644 --- a/kubernetes/resource_kubernetes_cluster_role_binding_v1.go +++ b/kubernetes/resource_kubernetes_cluster_role_binding_v1.go @@ -17,6 +17,7 @@ import ( func resourceKubernetesClusterRoleBindingV1() *schema.Resource { return &schema.Resource{ + Description: "A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces", CreateContext: resourceKubernetesClusterRoleBindingV1Create, ReadContext: resourceKubernetesClusterRoleBindingV1Read, UpdateContext: resourceKubernetesClusterRoleBindingV1Update, diff --git a/kubernetes/resource_kubernetes_cluster_role_v1.go b/kubernetes/resource_kubernetes_cluster_role_v1.go index 3ea88445c3..59e0bd25a5 100644 --- a/kubernetes/resource_kubernetes_cluster_role_v1.go +++ b/kubernetes/resource_kubernetes_cluster_role_v1.go @@ -17,6 +17,7 @@ import ( func resourceKubernetesClusterRoleV1() *schema.Resource { return &schema.Resource{ + Description: "A ClusterRole creates a role at the cluster level and in all namespaces.", CreateContext: resourceKubernetesClusterRoleV1Create, ReadContext: resourceKubernetesClusterRoleV1Read, UpdateContext: resourceKubernetesClusterRoleV1Update, diff --git a/kubernetes/resource_kubernetes_config_map_v1.go b/kubernetes/resource_kubernetes_config_map_v1.go index 51d798e1c2..1f3a7e5e08 100644 --- a/kubernetes/resource_kubernetes_config_map_v1.go +++ b/kubernetes/resource_kubernetes_config_map_v1.go @@ -19,6 +19,7 @@ import ( func resourceKubernetesConfigMapV1() *schema.Resource { return &schema.Resource{ + Description: "The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs.", CreateContext: resourceKubernetesConfigMapV1Create, ReadContext: resourceKubernetesConfigMapV1Read, UpdateContext: resourceKubernetesConfigMapV1Update, diff --git a/kubernetes/resource_kubernetes_config_map_v1_data.go b/kubernetes/resource_kubernetes_config_map_v1_data.go index abc242fe10..7b450ead19 100644 --- a/kubernetes/resource_kubernetes_config_map_v1_data.go +++ b/kubernetes/resource_kubernetes_config_map_v1_data.go @@ -20,6 +20,7 @@ import ( func resourceKubernetesConfigMapV1Data() *schema.Resource { return &schema.Resource{ + Description: "This resource allows Terraform to manage data within a pre-existing ConfigMap. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the data that is defined in the Terraform configuration. Existing data not specified in the configuration will be ignored. If data specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true.", CreateContext: resourceKubernetesConfigMapV1DataCreate, ReadContext: resourceKubernetesConfigMapV1DataRead, UpdateContext: resourceKubernetesConfigMapV1DataUpdate, diff --git a/kubernetes/resource_kubernetes_cron_job_v1.go b/kubernetes/resource_kubernetes_cron_job_v1.go index 3dda5f05bc..21c282aad5 100644 --- a/kubernetes/resource_kubernetes_cron_job_v1.go +++ b/kubernetes/resource_kubernetes_cron_job_v1.go @@ -21,6 +21,7 @@ import ( func resourceKubernetesCronJobV1() *schema.Resource { return &schema.Resource{ + Description: "A Cron Job creates Jobs on a time-based schedule.One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format.Note: All CronJob `schedule` times are based on the timezone of the master where the job is initiated. For instructions on creating and working with cron jobs, and for an example of a spec file for a cron job, see [Kubernetes reference](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/).", CreateContext: resourceKubernetesCronJobV1Create, ReadContext: resourceKubernetesCronJobV1Read, UpdateContext: resourceKubernetesCronJobV1Update, diff --git a/kubernetes/resource_kubernetes_csi_driver_v1.go b/kubernetes/resource_kubernetes_csi_driver_v1.go index 4e36f29c91..feb83b922b 100644 --- a/kubernetes/resource_kubernetes_csi_driver_v1.go +++ b/kubernetes/resource_kubernetes_csi_driver_v1.go @@ -23,6 +23,7 @@ import ( func resourceKubernetesCSIDriverV1() *schema.Resource { return &schema.Resource{ + Description: "The [Container Storage Interface](https://kubernetes-csi.github.io/docs/introduction.html) (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes.", CreateContext: resourceKubernetesCSIDriverV1Create, ReadContext: resourceKubernetesCSIDriverV1Read, UpdateContext: resourceKubernetesCSIDriverV1Update, diff --git a/kubernetes/resource_kubernetes_daemon_set_v1.go b/kubernetes/resource_kubernetes_daemon_set_v1.go index 14ce54aa4f..f98ea14c8e 100644 --- a/kubernetes/resource_kubernetes_daemon_set_v1.go +++ b/kubernetes/resource_kubernetes_daemon_set_v1.go @@ -24,6 +24,7 @@ import ( func resourceKubernetesDaemonSetV1() *schema.Resource { return &schema.Resource{ + Description: "A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.", CreateContext: resourceKubernetesDaemonSetV1Create, ReadContext: resourceKubernetesDaemonSetV1Read, UpdateContext: resourceKubernetesDaemonSetV1Update, diff --git a/kubernetes/resource_kubernetes_deployment_v1.go b/kubernetes/resource_kubernetes_deployment_v1.go index e6730cd2ba..a28338ff22 100644 --- a/kubernetes/resource_kubernetes_deployment_v1.go +++ b/kubernetes/resource_kubernetes_deployment_v1.go @@ -29,6 +29,7 @@ const ( func resourceKubernetesDeploymentV1() *schema.Resource { return &schema.Resource{ + Description: "A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more.", CreateContext: resourceKubernetesDeploymentV1Create, ReadContext: resourceKubernetesDeploymentV1Read, UpdateContext: resourceKubernetesDeploymentV1Update, diff --git a/kubernetes/resource_kubernetes_endpoints_v1.go b/kubernetes/resource_kubernetes_endpoints_v1.go index fa3c1d00f9..2654b0bb41 100644 --- a/kubernetes/resource_kubernetes_endpoints_v1.go +++ b/kubernetes/resource_kubernetes_endpoints_v1.go @@ -18,6 +18,7 @@ import ( func resourceKubernetesEndpointsV1() *schema.Resource { return &schema.Resource{ + Description: "An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service.", CreateContext: resourceKubernetesEndpointsV1Create, ReadContext: resourceKubernetesEndpointsV1Read, UpdateContext: resourceKubernetesEndpointsV1Update, diff --git a/kubernetes/resource_kubernetes_endpointslice_v1.go b/kubernetes/resource_kubernetes_endpointslice_v1.go index eae31ba04a..5da75d0857 100644 --- a/kubernetes/resource_kubernetes_endpointslice_v1.go +++ b/kubernetes/resource_kubernetes_endpointslice_v1.go @@ -19,6 +19,7 @@ import ( func resourceKubernetesEndpointSliceV1() *schema.Resource { return &schema.Resource{ + Description: "An EndpointSlice contains references to a set of network endpoints.", CreateContext: resourceKubernetesEndpointSliceV1Create, ReadContext: resourceKubernetesEndpointSliceV1Read, UpdateContext: resourceKubernetesEndpointSliceV1Update, diff --git a/kubernetes/resource_kubernetes_env.go b/kubernetes/resource_kubernetes_env.go index 36151ffa04..275b9a2c30 100644 --- a/kubernetes/resource_kubernetes_env.go +++ b/kubernetes/resource_kubernetes_env.go @@ -27,6 +27,7 @@ import ( func resourceKubernetesEnv() *schema.Resource { return &schema.Resource{ + Description: "This resource provides a way to manage environment variables in resources that were created outside of Terraform. This resource provides functionality similar to the `kubectl set env` command.", CreateContext: resourceKubernetesEnvCreate, ReadContext: resourceKubernetesEnvRead, UpdateContext: resourceKubernetesEnvUpdate, diff --git a/kubernetes/resource_kubernetes_env_test.go b/kubernetes/resource_kubernetes_env_test.go index b134b2063b..162ee5c64b 100644 --- a/kubernetes/resource_kubernetes_env_test.go +++ b/kubernetes/resource_kubernetes_env_test.go @@ -253,7 +253,7 @@ func TestAccKubernetesEnv_CronJob_initContainer(t *testing.T) { } func createInitContainerEnv(t *testing.T, name, namespace string) error { - conn, err := testAccProvider.Meta().(kubeClientsets).MainClientset() + conn, err := testAccProvider.Meta().(providerMetadata).MainClientset() if err != nil { return err } @@ -315,7 +315,7 @@ func createInitContainerEnv(t *testing.T, name, namespace string) error { } func createEnv(t *testing.T, name, namespace string) error { - conn, err := testAccProvider.Meta().(kubeClientsets).MainClientset() + conn, err := testAccProvider.Meta().(providerMetadata).MainClientset() if err != nil { return err } @@ -365,7 +365,7 @@ func createEnv(t *testing.T, name, namespace string) error { } func createCronJobEnv(t *testing.T, name, namespace string) error { - conn, err := testAccProvider.Meta().(kubeClientsets).MainClientset() + conn, err := testAccProvider.Meta().(providerMetadata).MainClientset() if err != nil { return err } @@ -424,7 +424,7 @@ func createCronJobEnv(t *testing.T, name, namespace string) error { } func createCronJobInitContainerEnv(t *testing.T, name, namespace string) error { - conn, err := testAccProvider.Meta().(kubeClientsets).MainClientset() + conn, err := testAccProvider.Meta().(providerMetadata).MainClientset() if err != nil { return err } diff --git a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler.go b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler.go index 1894c94c40..ab057880d2 100644 --- a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler.go +++ b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler.go @@ -18,6 +18,7 @@ import ( func resourceKubernetesHorizontalPodAutoscaler() *schema.Resource { return &schema.Resource{ + Description: "Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization.", CreateContext: resourceKubernetesHorizontalPodAutoscalerCreate, ReadContext: resourceKubernetesHorizontalPodAutoscalerRead, UpdateContext: resourceKubernetesHorizontalPodAutoscalerUpdate, diff --git a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v1.go b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v1.go index 175db33345..2875f890a3 100644 --- a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v1.go +++ b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v1.go @@ -18,6 +18,7 @@ import ( func resourceKubernetesHorizontalPodAutoscalerV1() *schema.Resource { return &schema.Resource{ + Description: "Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization.", CreateContext: resourceKubernetesHorizontalPodAutoscalerV1Create, ReadContext: resourceKubernetesHorizontalPodAutoscalerV1Read, UpdateContext: resourceKubernetesHorizontalPodAutoscalerV1Update, diff --git a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2.go b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2.go index c4938418f5..9e96661766 100644 --- a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2.go +++ b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2.go @@ -19,6 +19,7 @@ import ( func resourceKubernetesHorizontalPodAutoscalerV2() *schema.Resource { return &schema.Resource{ + Description: "Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization.", CreateContext: resourceKubernetesHorizontalPodAutoscalerV2Create, ReadContext: resourceKubernetesHorizontalPodAutoscalerV2Read, UpdateContext: resourceKubernetesHorizontalPodAutoscalerV2Update, diff --git a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2beta2.go b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2beta2.go index 02785d741a..a614c36800 100644 --- a/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2beta2.go +++ b/kubernetes/resource_kubernetes_horizontal_pod_autoscaler_v2beta2.go @@ -19,6 +19,7 @@ import ( func resourceKubernetesHorizontalPodAutoscalerV2Beta2() *schema.Resource { return &schema.Resource{ + Description: "Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization.", CreateContext: resourceKubernetesHorizontalPodAutoscalerV2Beta2Create, ReadContext: resourceKubernetesHorizontalPodAutoscalerV2Beta2Read, UpdateContext: resourceKubernetesHorizontalPodAutoscalerV2Beta2Update, diff --git a/kubernetes/resource_kubernetes_ingress_class_v1.go b/kubernetes/resource_kubernetes_ingress_class_v1.go index 30af3a8ac5..b556701af6 100644 --- a/kubernetes/resource_kubernetes_ingress_class_v1.go +++ b/kubernetes/resource_kubernetes_ingress_class_v1.go @@ -20,6 +20,7 @@ import ( func resourceKubernetesIngressClassV1() *schema.Resource { return &schema.Resource{ + Description: "Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class.", CreateContext: resourceKubernetesIngressClassV1Create, ReadContext: resourceKubernetesIngressClassV1Read, UpdateContext: resourceKubernetesIngressClassV1Update, diff --git a/kubernetes/resource_kubernetes_ingress_v1.go b/kubernetes/resource_kubernetes_ingress_v1.go index 87121db4ba..5ff6e1f599 100644 --- a/kubernetes/resource_kubernetes_ingress_v1.go +++ b/kubernetes/resource_kubernetes_ingress_v1.go @@ -21,6 +21,7 @@ import ( func resourceKubernetesIngressV1() *schema.Resource { return &schema.Resource{ + Description: "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", CreateContext: resourceKubernetesIngressV1Create, ReadContext: resourceKubernetesIngressV1Read, UpdateContext: resourceKubernetesIngressV1Update, diff --git a/kubernetes/resource_kubernetes_job_v1.go b/kubernetes/resource_kubernetes_job_v1.go index 16d88bf260..572635b340 100644 --- a/kubernetes/resource_kubernetes_job_v1.go +++ b/kubernetes/resource_kubernetes_job_v1.go @@ -23,6 +23,7 @@ import ( func resourceKubernetesJobV1() *schema.Resource { return &schema.Resource{ + Description: "A Job creates one or more Pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot. You can also use a Job to run multiple Pods in parallel. ", CreateContext: resourceKubernetesJobV1Create, ReadContext: resourceKubernetesJobV1Read, UpdateContext: resourceKubernetesJobV1Update, diff --git a/kubernetes/resource_kubernetes_labels.go b/kubernetes/resource_kubernetes_labels.go index f7c494451b..4933f01411 100644 --- a/kubernetes/resource_kubernetes_labels.go +++ b/kubernetes/resource_kubernetes_labels.go @@ -26,6 +26,7 @@ import ( func resourceKubernetesLabels() *schema.Resource { return &schema.Resource{ + Description: "This resource allows Terraform to manage the labels for a resource that already exists. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the labels that are defined in the Terraform configuration. Existing labels not specified in the configuration will be ignored. If a label specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting `force` to true.", CreateContext: resourceKubernetesLabelsCreate, ReadContext: resourceKubernetesLabelsRead, UpdateContext: resourceKubernetesLabelsUpdate, diff --git a/kubernetes/resource_kubernetes_limit_range_v1.go b/kubernetes/resource_kubernetes_limit_range_v1.go index 0ec335f8da..1362ddcff3 100644 --- a/kubernetes/resource_kubernetes_limit_range_v1.go +++ b/kubernetes/resource_kubernetes_limit_range_v1.go @@ -18,6 +18,7 @@ import ( func resourceKubernetesLimitRangeV1() *schema.Resource { return &schema.Resource{ + Description: "Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. Read more in [the official docs](https://kubernetes.io/docs/concepts/policy/limit-range/).", CreateContext: resourceKubernetesLimitRangeV1Create, ReadContext: resourceKubernetesLimitRangeV1Read, UpdateContext: resourceKubernetesLimitRangeV1Update, diff --git a/kubernetes/resource_kubernetes_mutating_webhook_configuration.go b/kubernetes/resource_kubernetes_mutating_webhook_configuration.go index b02f4bdda1..af4f3f470a 100644 --- a/kubernetes/resource_kubernetes_mutating_webhook_configuration.go +++ b/kubernetes/resource_kubernetes_mutating_webhook_configuration.go @@ -24,6 +24,7 @@ func resourceKubernetesMutatingWebhookConfiguration() *schema.Resource { apiDoc := admissionregistrationv1.MutatingWebhookConfiguration{}.SwaggerDoc() webhookDoc := admissionregistrationv1.MutatingWebhook{}.SwaggerDoc() return &schema.Resource{ + Description: "Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks).", CreateContext: resourceKubernetesMutatingWebhookConfigurationCreate, ReadContext: resourceKubernetesMutatingWebhookConfigurationRead, UpdateContext: resourceKubernetesMutatingWebhookConfigurationUpdate, diff --git a/kubernetes/resource_kubernetes_mutating_webhook_configuration_v1.go b/kubernetes/resource_kubernetes_mutating_webhook_configuration_v1.go index 0cf65c0417..edf29308d5 100644 --- a/kubernetes/resource_kubernetes_mutating_webhook_configuration_v1.go +++ b/kubernetes/resource_kubernetes_mutating_webhook_configuration_v1.go @@ -22,6 +22,7 @@ func resourceKubernetesMutatingWebhookConfigurationV1() *schema.Resource { apiDoc := admissionregistrationv1.MutatingWebhookConfiguration{}.SwaggerDoc() webhookDoc := admissionregistrationv1.MutatingWebhook{}.SwaggerDoc() return &schema.Resource{ + Description: "Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks).", CreateContext: resourceKubernetesMutatingWebhookConfigurationV1Create, ReadContext: resourceKubernetesMutatingWebhookConfigurationV1Read, UpdateContext: resourceKubernetesMutatingWebhookConfigurationV1Update, diff --git a/kubernetes/resource_kubernetes_namespace_v1.go b/kubernetes/resource_kubernetes_namespace_v1.go index 382ac149d6..eec651d196 100644 --- a/kubernetes/resource_kubernetes_namespace_v1.go +++ b/kubernetes/resource_kubernetes_namespace_v1.go @@ -21,6 +21,7 @@ import ( func resourceKubernetesNamespaceV1() *schema.Resource { return &schema.Resource{ + Description: "Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. Read more about namespaces at [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)", CreateContext: resourceKubernetesNamespaceV1Create, ReadContext: resourceKubernetesNamespaceV1Read, UpdateContext: resourceKubernetesNamespaceV1Update, diff --git a/kubernetes/resource_kubernetes_network_policy_v1.go b/kubernetes/resource_kubernetes_network_policy_v1.go index 9596f80200..188fcb1b3d 100644 --- a/kubernetes/resource_kubernetes_network_policy_v1.go +++ b/kubernetes/resource_kubernetes_network_policy_v1.go @@ -25,6 +25,7 @@ var ( networkPolicyV1EgressRulePortsDoc = networking.NetworkPolicyEgressRule{}.SwaggerDoc()["ports"] networkPolicyV1EgressRuleToDoc = networking.NetworkPolicyEgressRule{}.SwaggerDoc()["to"] networkPolicyV1PortPortDoc = networking.NetworkPolicyPort{}.SwaggerDoc()["port"] + networkPolicyV1PortEndPortDoc = networking.NetworkPolicyPort{}.SwaggerDoc()["endPort"] networkPolicyV1PortProtocolDoc = networking.NetworkPolicyPort{}.SwaggerDoc()["protocol"] networkPolicyV1PeerIpBlockDoc = networking.NetworkPolicyPeer{}.SwaggerDoc()["ipBlock"] ipBlockCidrDoc = networking.IPBlock{}.SwaggerDoc()["cidr"] @@ -37,6 +38,7 @@ var ( func resourceKubernetesNetworkPolicyV1() *schema.Resource { return &schema.Resource{ + Description: "Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. Read more about network policies at https://kubernetes.io/docs/concepts/services-networking/network-policies/", CreateContext: resourceKubernetesNetworkPolicyV1Create, ReadContext: resourceKubernetesNetworkPolicyV1Read, UpdateContext: resourceKubernetesNetworkPolicyV1Update, @@ -71,6 +73,11 @@ func resourceKubernetesNetworkPolicyV1() *schema.Resource { Description: networkPolicyV1PortPortDoc, Optional: true, }, + "end_port": { + Type: schema.TypeInt, + Description: networkPolicyV1PortEndPortDoc, + Optional: true, + }, "protocol": { Type: schema.TypeString, Description: networkPolicyV1PortProtocolDoc, @@ -148,6 +155,11 @@ func resourceKubernetesNetworkPolicyV1() *schema.Resource { Description: networkPolicyV1PortPortDoc, Optional: true, }, + "end_port": { + Type: schema.TypeInt, + Description: networkPolicyV1PortEndPortDoc, + Optional: true, + }, "protocol": { Type: schema.TypeString, Description: networkPolicyV1PortProtocolDoc, diff --git a/kubernetes/resource_kubernetes_network_policy_v1_test.go b/kubernetes/resource_kubernetes_network_policy_v1_test.go index ba30ebfc1a..d54fdba1a0 100644 --- a/kubernetes/resource_kubernetes_network_policy_v1_test.go +++ b/kubernetes/resource_kubernetes_network_policy_v1_test.go @@ -108,6 +108,41 @@ func TestAccKubernetesNetworkPolicyV1_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.policy_types.0", "Ingress"), ), }, + { + Config: testAccKubernetesNetworkPolicyV1Config_endPorts(name), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckKubernetesNetworkPolicyV1Exists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "metadata.0.annotations.%", "0"), + resource.TestCheckResourceAttr(resourceName, "metadata.0.labels.%", "0"), + resource.TestCheckResourceAttr(resourceName, "metadata.0.name", name), + resource.TestCheckResourceAttrSet(resourceName, "metadata.0.generation"), + resource.TestCheckResourceAttrSet(resourceName, "metadata.0.resource_version"), + resource.TestCheckResourceAttrSet(resourceName, "metadata.0.uid"), + resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.0.match_expressions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.0.match_expressions.0.key", "name"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.0.match_expressions.0.operator", "In"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.0.match_expressions.0.values.#", "2"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.0.match_expressions.0.values.1", "webfront"), + resource.TestCheckResourceAttr(resourceName, "spec.0.pod_selector.0.match_expressions.0.values.0", "api"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.ports.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.ports.0.port", "8126"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.ports.0.protocol", "TCP"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.ports.0.end_port", "9000"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.from.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.from.0.namespace_selector.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.from.0.namespace_selector.0.match_labels.name", "default"), + resource.TestCheckResourceAttr(resourceName, "spec.0.ingress.0.from.0.pod_selector.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.egress.0.ports.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.egress.0.ports.0.port", "10000"), + resource.TestCheckResourceAttr(resourceName, "spec.0.egress.0.ports.0.protocol", "TCP"), + resource.TestCheckResourceAttr(resourceName, "spec.0.egress.0.ports.0.end_port", "65535"), + resource.TestCheckResourceAttr(resourceName, "spec.0.policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.policy_types.0", "Ingress"), + ), + }, { Config: testAccKubernetesNetworkPolicyV1Config_specModified_allow_all_namespaces(name), Check: resource.ComposeAggregateTestCheckFunc( @@ -482,6 +517,50 @@ func testAccKubernetesNetworkPolicyV1Config_specModified(name string) string { `, name) } +func testAccKubernetesNetworkPolicyV1Config_endPorts(name string) string { + return fmt.Sprintf(`resource "kubernetes_network_policy_v1" "test" { + metadata { + name = "%s" + namespace = "default" + } + + spec { + pod_selector { + match_expressions { + key = "name" + operator = "In" + values = ["webfront", "api"] + } + } + + ingress { + ports { + port = "8126" + protocol = "TCP" + end_port = "9000" + } + + from { + namespace_selector { + match_labels = { + name = "default" + } + } + } + } + egress { + ports { + port = "10000" + protocol = "TCP" + end_port = "65535" + } + } + policy_types = ["Ingress"] + } +} +`, name) +} + func testAccKubernetesNetworkPolicyV1Config_specModified_allow_all_namespaces(name string) string { return fmt.Sprintf(`resource "kubernetes_network_policy_v1" "test" { metadata { diff --git a/kubernetes/resource_kubernetes_node_taint.go b/kubernetes/resource_kubernetes_node_taint.go index 887d80ae08..06bc6d18c6 100644 --- a/kubernetes/resource_kubernetes_node_taint.go +++ b/kubernetes/resource_kubernetes_node_taint.go @@ -19,6 +19,7 @@ import ( func resourceKubernetesNodeTaint() *schema.Resource { return &schema.Resource{ + Description: "[Node affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) is a property of Pods that attracts them to a set of [nodes](https://kubernetes.io/docs/concepts/architecture/nodes/) (either as a preference or a hard requirement). Taints are the opposite -- they allow a node to repel a set of pods.", CreateContext: resourceKubernetesNodeTaintCreate, ReadContext: resourceKubernetesNodeTaintRead, UpdateContext: resourceKubernetesNodeTaintUpdate, @@ -100,6 +101,12 @@ func resourceKubernetesNodeTaintRead(ctx context.Context, d *schema.ResourceData nodeName := meta.Name conn, err := m.(KubeClientsets).MainClientset() + if err != nil { + return diag.FromErr(err) + } + nodeApi := conn.CoreV1().Nodes() + + node, err := nodeApi.Get(ctx, nodeName, metav1.GetOptions{}) if err != nil { if statusErr, ok := err.(*errors.StatusError); ok && errors.IsNotFound(statusErr) { // The node is gone so the resource should be deleted. @@ -111,12 +118,6 @@ func resourceKubernetesNodeTaintRead(ctx context.Context, d *schema.ResourceData } return diag.FromErr(err) } - nodeApi := conn.CoreV1().Nodes() - - node, err := nodeApi.Get(ctx, nodeName, metav1.GetOptions{}) - if err != nil { - return diag.FromErr(err) - } nodeTaints := node.Spec.Taints if len(nodeTaints) == 0 { d.SetId("") diff --git a/kubernetes/resource_kubernetes_persistent_volume_claim_v1.go b/kubernetes/resource_kubernetes_persistent_volume_claim_v1.go index 0f87240604..fa5137e220 100644 --- a/kubernetes/resource_kubernetes_persistent_volume_claim_v1.go +++ b/kubernetes/resource_kubernetes_persistent_volume_claim_v1.go @@ -31,6 +31,7 @@ func resourceKubernetesPersistentVolumeClaimV1() *schema.Resource { Default: true, } return &schema.Resource{ + Description: "This resource allows the user to request for and claim to a persistent volume.", CreateContext: resourceKubernetesPersistentVolumeClaimV1Create, ReadContext: resourceKubernetesPersistentVolumeClaimV1Read, UpdateContext: resourceKubernetesPersistentVolumeClaimV1Update, diff --git a/kubernetes/resource_kubernetes_persistent_volume_v1.go b/kubernetes/resource_kubernetes_persistent_volume_v1.go index 857717ad24..ec7ce7abec 100644 --- a/kubernetes/resource_kubernetes_persistent_volume_v1.go +++ b/kubernetes/resource_kubernetes_persistent_volume_v1.go @@ -29,6 +29,7 @@ const ( func resourceKubernetesPersistentVolumeV1() *schema.Resource { return &schema.Resource{ + Description: "The resource provides a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)", CreateContext: resourceKubernetesPersistentVolumeV1Create, ReadContext: resourceKubernetesPersistentVolumeV1Read, UpdateContext: resourceKubernetesPersistentVolumeV1Update, @@ -94,6 +95,7 @@ func resourceKubernetesPersistentVolumeV1() *schema.Resource { "ReadWriteOnce", "ReadOnlyMany", "ReadWriteMany", + "ReadWriteOncePod", }, false), }, Set: schema.HashString, diff --git a/kubernetes/resource_kubernetes_persistent_volume_v1_test.go b/kubernetes/resource_kubernetes_persistent_volume_v1_test.go index 9b9c353a1d..de24291935 100644 --- a/kubernetes/resource_kubernetes_persistent_volume_v1_test.go +++ b/kubernetes/resource_kubernetes_persistent_volume_v1_test.go @@ -734,6 +734,31 @@ func TestAccKubernetesPersistentVolumeV1_hostPath_mountOptions(t *testing.T) { }) } +func TestAccKubernetesPersistentVolumeV1_accessMode_ReadWriteOncePod(t *testing.T) { + var conf api.PersistentVolume + randString := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + name := fmt.Sprintf("tf-acc-test-%s", randString) + resourceName := "kubernetes_persistent_volume_v1.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: resourceName, + IDRefreshIgnore: []string{"metadata.0.resource_version"}, + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckKubernetesPersistentVolumeV1Destroy, + Steps: []resource.TestStep{ + { + Config: testAccKubernetesPersistentVolumeV1Config_accessMode_ReadWriteOncePod(name), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckKubernetesPersistentVolumeV1Exists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "spec.0.access_modes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.access_modes.0", "ReadWriteOncePod"), + ), + }, + }, + }) +} + func TestAccKubernetesPersistentVolumeV1_csi_basic(t *testing.T) { var conf api.PersistentVolume name := acctest.RandomWithPrefix("tf-acc-test") @@ -1879,6 +1904,26 @@ func testAccKubernetesPersistentVolumeV1Config_hostPath_mountOptions(name string }`, name) } +func testAccKubernetesPersistentVolumeV1Config_accessMode_ReadWriteOncePod(name string) string { + return fmt.Sprintf(`resource "kubernetes_persistent_volume_v1" "test" { + metadata { + name = "%s" + } + spec { + capacity = { + storage = "1Gi" + } + access_modes = ["ReadWriteOncePod"] + mount_options = ["foo"] + persistent_volume_source { + host_path { + path = "/mnt/local-volume" + } + } + } +}`, name) +} + func testAccKubernetesPersistentVolumeV1Config_hostPath_basic(name string) string { return fmt.Sprintf(`resource "kubernetes_persistent_volume_v1" "test" { metadata { diff --git a/kubernetes/resource_kubernetes_pod_disruption_budget.go b/kubernetes/resource_kubernetes_pod_disruption_budget.go index 402ae02284..bc9ae4ce21 100644 --- a/kubernetes/resource_kubernetes_pod_disruption_budget.go +++ b/kubernetes/resource_kubernetes_pod_disruption_budget.go @@ -26,6 +26,7 @@ var ( func resourceKubernetesPodDisruptionBudget() *schema.Resource { return &schema.Resource{ + Description: "A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total.", CreateContext: resourceKubernetesPodDisruptionBudgetCreate, ReadContext: resourceKubernetesPodDisruptionBudgetRead, UpdateContext: resourceKubernetesPodDisruptionBudgetUpdate, diff --git a/kubernetes/resource_kubernetes_pod_disruption_budget_v1.go b/kubernetes/resource_kubernetes_pod_disruption_budget_v1.go index d62c0c2efc..c3e004c2ae 100644 --- a/kubernetes/resource_kubernetes_pod_disruption_budget_v1.go +++ b/kubernetes/resource_kubernetes_pod_disruption_budget_v1.go @@ -26,6 +26,7 @@ var ( func resourceKubernetesPodDisruptionBudgetV1() *schema.Resource { return &schema.Resource{ + Description: "A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total.", CreateContext: resourceKubernetesPodDisruptionBudgetV1Create, ReadContext: resourceKubernetesPodDisruptionBudgetV1Read, UpdateContext: resourceKubernetesPodDisruptionBudgetV1Update, diff --git a/kubernetes/resource_kubernetes_pod_security_policy_v1beta1.go b/kubernetes/resource_kubernetes_pod_security_policy_v1beta1.go index f1552ceb62..da8b3696b7 100644 --- a/kubernetes/resource_kubernetes_pod_security_policy_v1beta1.go +++ b/kubernetes/resource_kubernetes_pod_security_policy_v1beta1.go @@ -67,6 +67,7 @@ var ( func resourceKubernetesPodSecurityPolicyV1Beta1() *schema.Resource { return &schema.Resource{ DeprecationMessage: `"PodSecurityPolicy" was deprecated in Kubernetes v1.21.0; Starting from version 1.21.0 Kubernetes has deprecated PodSecurityPolicy and has been removed entirely in v1.25.0`, + Description: "A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields.", CreateContext: resourceKubernetesPodSecurityPolicyV1Beta1Create, ReadContext: resourceKubernetesPodSecurityPolicyV1Beta1Read, UpdateContext: resourceKubernetesPodSecurityPolicyV1Beta1Update, diff --git a/kubernetes/resource_kubernetes_pod_v1.go b/kubernetes/resource_kubernetes_pod_v1.go index aa91c9af69..bc76604102 100644 --- a/kubernetes/resource_kubernetes_pod_v1.go +++ b/kubernetes/resource_kubernetes_pod_v1.go @@ -22,6 +22,7 @@ import ( func resourceKubernetesPodV1() *schema.Resource { return &schema.Resource{ + Description: "A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/)", CreateContext: resourceKubernetesPodV1Create, ReadContext: resourceKubernetesPodV1Read, UpdateContext: resourceKubernetesPodV1Update, diff --git a/kubernetes/resource_kubernetes_priority_class_v1.go b/kubernetes/resource_kubernetes_priority_class_v1.go index f4c29620b5..0586e10e60 100644 --- a/kubernetes/resource_kubernetes_priority_class_v1.go +++ b/kubernetes/resource_kubernetes_priority_class_v1.go @@ -20,6 +20,7 @@ import ( func resourceKubernetesPriorityClassV1() *schema.Resource { return &schema.Resource{ + Description: "A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority.", CreateContext: resourceKubernetesPriorityClassV1Create, ReadContext: resourceKubernetesPriorityClassV1Read, UpdateContext: resourceKubernetesPriorityClassV1Update, diff --git a/kubernetes/resource_kubernetes_replication_controller_v1.go b/kubernetes/resource_kubernetes_replication_controller_v1.go index 83027fdd35..ce19e10265 100644 --- a/kubernetes/resource_kubernetes_replication_controller_v1.go +++ b/kubernetes/resource_kubernetes_replication_controller_v1.go @@ -22,6 +22,7 @@ import ( func resourceKubernetesReplicationControllerV1() *schema.Resource { return &schema.Resource{ + Description: "A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more.", CreateContext: resourceKubernetesReplicationControllerV1Create, ReadContext: resourceKubernetesReplicationControllerV1Read, UpdateContext: resourceKubernetesReplicationControllerV1Update, diff --git a/kubernetes/resource_kubernetes_resource_quota_v1.go b/kubernetes/resource_kubernetes_resource_quota_v1.go index d19a7b04a3..25e69b0c5d 100644 --- a/kubernetes/resource_kubernetes_resource_quota_v1.go +++ b/kubernetes/resource_kubernetes_resource_quota_v1.go @@ -22,6 +22,7 @@ import ( func resourceKubernetesResourceQuotaV1() *schema.Resource { return &schema.Resource{ + Description: "A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project.", CreateContext: resourceKubernetesResourceQuotaV1Create, ReadContext: resourceKubernetesResourceQuotaV1Read, UpdateContext: resourceKubernetesResourceQuotaV1Update, diff --git a/kubernetes/resource_kubernetes_role_binding_v1.go b/kubernetes/resource_kubernetes_role_binding_v1.go index 2e0770187e..a90f9204a0 100644 --- a/kubernetes/resource_kubernetes_role_binding_v1.go +++ b/kubernetes/resource_kubernetes_role_binding_v1.go @@ -17,6 +17,7 @@ import ( func resourceKubernetesRoleBindingV1() *schema.Resource { return &schema.Resource{ + Description: "A RoleBinding may be used to grant permission at the namespace level", CreateContext: resourceKubernetesRoleBindingV1Create, ReadContext: resourceKubernetesRoleBindingV1Read, UpdateContext: resourceKubernetesRoleBindingV1Update, diff --git a/kubernetes/resource_kubernetes_role_v1.go b/kubernetes/resource_kubernetes_role_v1.go index 4d335281d3..2d67f37878 100644 --- a/kubernetes/resource_kubernetes_role_v1.go +++ b/kubernetes/resource_kubernetes_role_v1.go @@ -18,6 +18,7 @@ import ( func resourceKubernetesRoleV1() *schema.Resource { return &schema.Resource{ + Description: "A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules).", CreateContext: resourceKubernetesRoleV1Create, ReadContext: resourceKubernetesRoleV1Read, UpdateContext: resourceKubernetesRoleV1Update, diff --git a/kubernetes/resource_kubernetes_runtime_class_v1.go b/kubernetes/resource_kubernetes_runtime_class_v1.go index ebd05aa37f..295356f6c6 100644 --- a/kubernetes/resource_kubernetes_runtime_class_v1.go +++ b/kubernetes/resource_kubernetes_runtime_class_v1.go @@ -21,6 +21,7 @@ import ( func resourceKubernetesRuntimeClassV1() *schema.Resource { return &schema.Resource{ + Description: "A runtime class is used to determine which container runtime is used to run all containers in a pod.", CreateContext: resourceKubernetesRuntimeClassV1Create, ReadContext: resourceKubernetesRuntimeClassV1Read, UpdateContext: resourceKubernetesRuntimeClassV1Update, diff --git a/kubernetes/resource_kubernetes_secret_v1.go b/kubernetes/resource_kubernetes_secret_v1.go index b533e81ddf..df9c8a90c9 100644 --- a/kubernetes/resource_kubernetes_secret_v1.go +++ b/kubernetes/resource_kubernetes_secret_v1.go @@ -22,6 +22,7 @@ import ( func resourceKubernetesSecretV1() *schema.Resource { return &schema.Resource{ + Description: "The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace.", CreateContext: resourceKubernetesSecretV1Create, ReadContext: resourceKubernetesSecretV1Read, UpdateContext: resourceKubernetesSecretV1Update, diff --git a/kubernetes/resource_kubernetes_service_account_v1.go b/kubernetes/resource_kubernetes_service_account_v1.go index f4bb756254..e45f1f4548 100644 --- a/kubernetes/resource_kubernetes_service_account_v1.go +++ b/kubernetes/resource_kubernetes_service_account_v1.go @@ -24,6 +24,7 @@ import ( func resourceKubernetesServiceAccountV1() *schema.Resource { return &schema.Resource{ + Description: "A service account provides an identity for processes that run in a Pod. Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/)", CreateContext: resourceKubernetesServiceAccountV1Create, ReadContext: resourceKubernetesServiceAccountV1Read, UpdateContext: resourceKubernetesServiceAccountV1Update, @@ -420,7 +421,7 @@ func resourceKubernetesServiceAccountV1ImportState(ctx context.Context, d *schem sa, err := conn.CoreV1().ServiceAccounts(namespace).Get(ctx, name, metav1.GetOptions{}) if err != nil { - return nil, fmt.Errorf("Unable to fetch service account from Kubernetes: %s", err) + return nil, fmt.Errorf(`Unable to fetch service account "%s/%s" from Kubernetes: %s`, namespace, name, err) } defaultSecret, diagMsg := findDefaultServiceAccountV1(ctx, sa, conn) diff --git a/kubernetes/resource_kubernetes_service_v1.go b/kubernetes/resource_kubernetes_service_v1.go index 6aa84c67af..934f038082 100644 --- a/kubernetes/resource_kubernetes_service_v1.go +++ b/kubernetes/resource_kubernetes_service_v1.go @@ -22,6 +22,7 @@ import ( func resourceKubernetesServiceV1() *schema.Resource { return &schema.Resource{ + Description: "A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service.", CreateContext: resourceKubernetesServiceV1Create, ReadContext: resourceKubernetesServiceV1Read, UpdateContext: resourceKubernetesServiceV1Update, diff --git a/kubernetes/resource_kubernetes_stateful_set_v1.go b/kubernetes/resource_kubernetes_stateful_set_v1.go index 52c10f766d..491dd3ff89 100644 --- a/kubernetes/resource_kubernetes_stateful_set_v1.go +++ b/kubernetes/resource_kubernetes_stateful_set_v1.go @@ -25,6 +25,7 @@ import ( func resourceKubernetesStatefulSetV1() *schema.Resource { return &schema.Resource{ + Description: "Manages the deployment and scaling of a set of Pods , and provides guarantees about the ordering and uniqueness of these Pods. Like a Deployment , a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling. A StatefulSet operates under the same pattern as any other Controller. You define your desired state in a StatefulSet object, and the StatefulSet controller makes any necessary updates to get there from the current state.", CreateContext: resourceKubernetesStatefulSetV1Create, ReadContext: resourceKubernetesStatefulSetV1Read, UpdateContext: resourceKubernetesStatefulSetV1Update, diff --git a/kubernetes/resource_kubernetes_storage_class_v1.go b/kubernetes/resource_kubernetes_storage_class_v1.go index af5c97f634..60ddb55cc2 100644 --- a/kubernetes/resource_kubernetes_storage_class_v1.go +++ b/kubernetes/resource_kubernetes_storage_class_v1.go @@ -22,6 +22,7 @@ import ( func resourceKubernetesStorageClassV1() *schema.Resource { return &schema.Resource{ + Description: "Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. Read more [here] (https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/)", CreateContext: resourceKubernetesStorageClassV1Create, ReadContext: resourceKubernetesStorageClassV1Read, UpdateContext: resourceKubernetesStorageClassV1Update, diff --git a/kubernetes/resource_kubernetes_tokenrequest_v1.go b/kubernetes/resource_kubernetes_tokenrequest_v1.go index 7b1c730e06..fe5dd6b5f4 100644 --- a/kubernetes/resource_kubernetes_tokenrequest_v1.go +++ b/kubernetes/resource_kubernetes_tokenrequest_v1.go @@ -15,6 +15,7 @@ import ( func resourceKubernetesTokenRequestV1() *schema.Resource { return &schema.Resource{ + Description: "TokenRequest requests a token for a given service account.", CreateContext: resourceKubernetesTokenRequestV1Create, ReadContext: resourceKubernetesTokenRequestV1Read, UpdateContext: resourceKubernetesTokenRequestV1Update, diff --git a/kubernetes/resource_kubernetes_validating_webhook_configuration_v1.go b/kubernetes/resource_kubernetes_validating_webhook_configuration_v1.go index e9fd6dcd35..be327a4cba 100644 --- a/kubernetes/resource_kubernetes_validating_webhook_configuration_v1.go +++ b/kubernetes/resource_kubernetes_validating_webhook_configuration_v1.go @@ -24,6 +24,7 @@ func resourceKubernetesValidatingWebhookConfigurationV1() *schema.Resource { apiDoc := admissionregistrationv1.ValidatingWebhookConfiguration{}.SwaggerDoc() webhookDoc := admissionregistrationv1.ValidatingWebhook{}.SwaggerDoc() return &schema.Resource{ + Description: "Validating Webhook Configuration configures a [validating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks).", CreateContext: resourceKubernetesValidatingWebhookConfigurationV1Create, ReadContext: resourceKubernetesValidatingWebhookConfigurationV1Read, UpdateContext: resourceKubernetesValidatingWebhookConfigurationV1Update, diff --git a/kubernetes/schema_persistent_volume_claim.go b/kubernetes/schema_persistent_volume_claim.go index f885a24269..9f07afecfd 100644 --- a/kubernetes/schema_persistent_volume_claim.go +++ b/kubernetes/schema_persistent_volume_claim.go @@ -37,6 +37,7 @@ func persistentVolumeClaimSpecFields() map[string]*schema.Schema { "ReadWriteOnce", "ReadOnlyMany", "ReadWriteMany", + "ReadWriteOncePod", }, false), }, Set: schema.HashString, diff --git a/kubernetes/structure_network_policy.go b/kubernetes/structure_network_policy.go index ee8577f76d..c7e89eb345 100644 --- a/kubernetes/structure_network_policy.go +++ b/kubernetes/structure_network_policy.go @@ -10,6 +10,7 @@ import ( corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/utils/ptr" ) // Flatteners @@ -66,6 +67,9 @@ func flattenNetworkPolicyV1Ports(in []networkingv1.NetworkPolicyPort) []interfac if port.Port != nil { m["port"] = port.Port.String() } + if port.EndPort != nil && *port.EndPort != 0 { + m["end_port"] = int(*port.EndPort) + } if port.Protocol != nil { m["protocol"] = string(*port.Protocol) } @@ -198,6 +202,9 @@ func expandNetworkPolicyV1Ports(l []interface{}) *[]networkingv1.NetworkPolicyPo val := intstr.Parse(v) policyPorts[i].Port = &val } + if v, ok := in["end_port"].(int); ok && v != 0 { + policyPorts[i].EndPort = ptr.To(int32(v)) + } if in["protocol"] != nil && in["protocol"] != "" { v := corev1.Protocol(in["protocol"].(string)) policyPorts[i].Protocol = &v diff --git a/kubernetes/structures.go b/kubernetes/structures.go index 02c9c3983b..d0696740a1 100644 --- a/kubernetes/structures.go +++ b/kubernetes/structures.go @@ -134,15 +134,15 @@ func flattenMetadataFields(meta metav1.ObjectMeta) []interface{} { return []interface{}{m} } -func flattenMetadata(meta metav1.ObjectMeta, d *schema.ResourceData, providerMetadata interface{}) []interface{} { +func flattenMetadata(meta metav1.ObjectMeta, d *schema.ResourceData, providerMeta interface{}) []interface{} { metadataAnnotations := d.Get("metadata.0.annotations").(map[string]interface{}) metadataLabels := d.Get("metadata.0.labels").(map[string]interface{}) - ignoreAnnotations := providerMetadata.(kubeClientsets).IgnoreAnnotations + ignoreAnnotations := providerMeta.(providerMetadata).IgnoreAnnotations removeInternalKeys(meta.Annotations, metadataAnnotations) removeKeys(meta.Annotations, metadataAnnotations, ignoreAnnotations) - ignoreLabels := providerMetadata.(kubeClientsets).IgnoreLabels + ignoreLabels := providerMeta.(providerMetadata).IgnoreLabels removeInternalKeys(meta.Labels, metadataLabels) removeKeys(meta.Labels, metadataLabels, ignoreLabels) diff --git a/kubernetes/structures_pod.go b/kubernetes/structures_pod.go index eeb5b5d3c3..ea5ccfdb86 100644 --- a/kubernetes/structures_pod.go +++ b/kubernetes/structures_pod.go @@ -343,7 +343,7 @@ func flattenTopologySpreadConstraints(tsc []v1.TopologySpreadConstraint) []inter if v.NodeAffinityPolicy != nil && *v.NodeAffinityPolicy != "" { obj["node_affinity_policy"] = string(*v.NodeAffinityPolicy) } - if v.NodeTaintsPolicy != nil && *v.NodeAffinityPolicy != "" { + if v.NodeTaintsPolicy != nil && *v.NodeTaintsPolicy != "" { obj["node_taints_policy"] = string(*v.NodeTaintsPolicy) } if v.WhenUnsatisfiable != "" { diff --git a/kubernetes/structures_test.go b/kubernetes/structures_test.go index d0a97511e1..5e3db73a97 100644 --- a/kubernetes/structures_test.go +++ b/kubernetes/structures_test.go @@ -159,7 +159,7 @@ func TestFlattenMetadata(t *testing.T) { uid := "7e9439cb-2584-4b50-81bc-441127e11b26" cases := map[string]struct { meta metav1.ObjectMeta - providerMeta kubeClientsets + providerMeta providerMetadata expected []interface{} }{ "IgnoreAnnotations": { @@ -180,7 +180,7 @@ func TestFlattenMetadata(t *testing.T) { ResourceVersion: "1", UID: types.UID(uid), }, - kubeClientsets{ + providerMetadata{ IgnoreAnnotations: []string{"foo.example.com"}, IgnoreLabels: []string{}, }, @@ -216,7 +216,7 @@ func TestFlattenMetadata(t *testing.T) { ResourceVersion: "1", UID: types.UID(uid), }, - kubeClientsets{ + providerMetadata{ IgnoreAnnotations: []string{}, IgnoreLabels: []string{"foo"}, }, @@ -252,7 +252,7 @@ func TestFlattenMetadata(t *testing.T) { ResourceVersion: "1", UID: types.UID(uid), }, - kubeClientsets{ + providerMetadata{ IgnoreAnnotations: []string{"foo.example.com"}, IgnoreLabels: []string{"foo"}, }, diff --git a/kubernetes/test-dfa/config-basic/cluster.tf b/kubernetes/test-dfa/config-basic/cluster.tf new file mode 100644 index 0000000000..337e0ba4bb --- /dev/null +++ b/kubernetes/test-dfa/config-basic/cluster.tf @@ -0,0 +1,21 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +terraform { + required_providers { + kind = { + source = "tehcyx/kind" + } + } +} + +resource "kind_cluster" "demo" { + name = "tfacc" +} + +provider "kubernetes" { + host = kind_cluster.demo.endpoint + cluster_ca_certificate = kind_cluster.demo.cluster_ca_certificate + client_certificate = kind_cluster.demo.client_certificate + client_key = kind_cluster.demo.client_key +} diff --git a/kubernetes/test-dfa/config-basic/crd.tf b/kubernetes/test-dfa/config-basic/crd.tf new file mode 100644 index 0000000000..f2756a43bc --- /dev/null +++ b/kubernetes/test-dfa/config-basic/crd.tf @@ -0,0 +1,1032 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "kubernetes_manifest" "crd_workspaces" { + manifest = { + "apiVersion" = "apiextensions.k8s.io/v1" + "kind" = "CustomResourceDefinition" + "metadata" = { + "annotations" = { + "controller-gen.kubebuilder.io/version" = "v0.14.0" + } + "name" = "workspaces.app.terraform.io" + } + "spec" = { + "group" = "app.terraform.io" + "names" = { + "kind" = "Workspace" + "listKind" = "WorkspaceList" + "plural" = "workspaces" + "singular" = "workspace" + } + "scope" = "Namespaced" + "versions" = [ + { + "additionalPrinterColumns" = [ + { + "jsonPath" = ".status.workspaceID" + "name" = "Workspace ID" + "type" = "string" + }, + ] + "name" = "v1alpha2" + "schema" = { + "openAPIV3Schema" = { + "description" = "Workspace is the Schema for the workspaces API" + "properties" = { + "apiVersion" = { + "description" = <<-EOT + 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 + EOT + "type" = "string" + } + "kind" = { + "description" = <<-EOT + 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 + EOT + "type" = "string" + } + "metadata" = { + "type" = "object" + } + "spec" = { + "description" = "WorkspaceSpec defines the desired state of Workspace." + "properties" = { + "agentPool" = { + "description" = <<-EOT + HCP Terraform Agents allow HCP Terraform to communicate with isolated, private, or on-premises infrastructure. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/agents + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Agent Pool ID. + Must match pattern: `^apool-[a-zA-Z0-9]+$` + EOT + "pattern" = "^apool-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Agent Pool name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "allowDestroyPlan" = { + "default" = true + "description" = <<-EOT + Allows a destroy plan to be created and applied. + Default: `true`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#destruction-and-deletion + EOT + "type" = "boolean" + } + "applyMethod" = { + "default" = "manual" + "description" = <<-EOT + Define either change will be applied automatically(auto) or require an operator to confirm(manual). + Must be one of the following values: `auto`, `manual`. + Default: `manual`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#auto-apply-and-manual-apply + EOT + "pattern" = "^(auto|manual)$" + "type" = "string" + } + "description" = { + "description" = "Workspace description." + "minLength" = 1 + "type" = "string" + } + "environmentVariables" = { + "description" = <<-EOT + Terraform Environment variables for all plans and applies in this workspace. + Variables defined within a workspace always overwrite variables from variable sets that have the same type and the same key. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#environment-variables + EOT + "items" = { + "description" = <<-EOT + Variables let you customize configurations, modify Terraform's behavior, and store information like provider credentials. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + EOT + "properties" = { + "description" = { + "description" = "Description of the variable." + "minLength" = 1 + "type" = "string" + } + "hcl" = { + "default" = false + "description" = <<-EOT + Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime. + Default: `false`. + EOT + "type" = "boolean" + } + "name" = { + "description" = "Name of the variable." + "minLength" = 1 + "type" = "string" + } + "sensitive" = { + "default" = false + "description" = <<-EOT + Sensitive variables are never shown in the UI or API. + They may appear in Terraform logs if your configuration is designed to output them. + Default: `false`. + EOT + "type" = "boolean" + } + "value" = { + "description" = "Value of the variable." + "minLength" = 1 + "type" = "string" + } + "valueFrom" = { + "description" = "Source for the 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" = <<-EOT + 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? + EOT + "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" + } + "secretKeyRef" = { + "description" = "Selects a key of a Secret." + "properties" = { + "key" = { + "description" = "The key of the secret to select from. Must be a valid secret key." + "type" = "string" + } + "name" = { + "description" = <<-EOT + 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? + EOT + "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" + } + "minItems" = 1 + "type" = "array" + } + "executionMode" = { + "default" = "remote" + "description" = <<-EOT + Define where the Terraform code will be executed. + Must be one of the following values: `agent`, `local`, `remote`. + Default: `remote`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode + EOT + "pattern" = "^(agent|local|remote)$" + "type" = "string" + } + "name" = { + "description" = "Workspace name." + "minLength" = 1 + "type" = "string" + } + "notifications" = { + "description" = <<-EOT + Notifications allow you to send messages to other applications based on run and workspace events. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/notifications + EOT + "items" = { + "description" = <<-EOT + Notifications allow you to send messages to other applications based on run and workspace events. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/notifications + EOT + "properties" = { + "emailAddresses" = { + "description" = <<-EOT + The list of email addresses that will receive notification emails. + It is only available for Terraform Enterprise users. It is not available in HCP Terraform. + EOT + "items" = { + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "emailUsers" = { + "description" = "The list of users belonging to the organization that will receive notification emails." + "items" = { + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "enabled" = { + "default" = true + "description" = <<-EOT + Whether the notification configuration should be enabled or not. + Default: `true`. + EOT + "type" = "boolean" + } + "name" = { + "description" = "Notification name." + "minLength" = 1 + "type" = "string" + } + "token" = { + "description" = "The token of the notification." + "minLength" = 1 + "type" = "string" + } + "triggers" = { + "description" = <<-EOT + The list of run events that will trigger notifications. + Trigger represents the different TFC notifications that can be sent as a run's progress transitions between different states. + There are two categories of triggers: + - Health Events: `assessment:check_failure`, `assessment:drifted`, `assessment:failed`. + - Run Events: `run:applying`, `run:completed`, `run:created`, `run:errored`, `run:needs_attention`, `run:planning`. + EOT + "items" = { + "description" = <<-EOT + NotificationTrigger represents the different TFC notifications that can be sent as a run's progress transitions between different states. + This must be aligned with go-tfe type `NotificationTriggerType`. + Must be one of the following values: `run:applying`, `assessment:check_failure`, `run:completed`, `run:created`, `assessment:drifted`, `run:errored`, `assessment:failed`, `run:needs_attention`, `run:planning`. + EOT + "enum" = [ + "run:applying", + "assessment:check_failure", + "run:completed", + "run:created", + "assessment:drifted", + "run:errored", + "assessment:failed", + "run:needs_attention", + "run:planning", + ] + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "type" = { + "description" = <<-EOT + The type of the notification. + Must be one of the following values: `email`, `generic`, `microsoft-teams`, `slack`. + EOT + "enum" = [ + "email", + "generic", + "microsoft-teams", + "slack", + ] + "type" = "string" + } + "url" = { + "description" = <<-EOT + The URL of the notification. + Must match pattern: `^https?://.*` + EOT + "pattern" = "^https?://.*" + "type" = "string" + } + } + "required" = [ + "name", + "type", + ] + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "organization" = { + "description" = <<-EOT + Organization name where the Workspace will be created. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations + EOT + "minLength" = 1 + "type" = "string" + } + "project" = { + "description" = <<-EOT + Projects let you organize your workspaces into groups. + Default: default organization project. + More information: + - https://developer.hashicorp.com/terraform/tutorials/cloud/projects + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Project ID. + Must match pattern: `^prj-[a-zA-Z0-9]+$` + EOT + "pattern" = "^prj-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Project name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "remoteStateSharing" = { + "description" = <<-EOT + Remote state access between workspaces. + By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces + EOT + "properties" = { + "allWorkspaces" = { + "default" = false + "description" = <<-EOT + Allow access to the state for all workspaces within the same organization. + Default: `false`. + EOT + "type" = "boolean" + } + "workspaces" = { + "description" = "Allow access to the state for specific workspaces within the same organization." + "items" = { + "description" = <<-EOT + ConsumerWorkspace allows access to the state for specific workspaces within the same organization. + Only one of the fields `ID` or `Name` is allowed. + At least one of the fields `ID` or `Name` is mandatory. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#remote-state-access-controls + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Consumer Workspace ID. + Must match pattern: `^ws-[a-zA-Z0-9]+$` + EOT + "pattern" = "^ws-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Consumer Workspace name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + } + "type" = "object" + } + "runTasks" = { + "description" = <<-EOT + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks + EOT + "items" = { + "description" = <<-EOT + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. + Only one of the fields `ID` or `Name` is allowed. + At least one of the fields `ID` or `Name` is mandatory. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks + EOT + "properties" = { + "enforcementLevel" = { + "default" = "advisory" + "description" = <<-EOT + Run Task Enforcement Level. Can be one of `advisory` or `mandatory`. Default: `advisory`. + Must be one of the following values: `advisory`, `mandatory` + Default: `advisory`. + EOT + "pattern" = "^(advisory|mandatory)$" + "type" = "string" + } + "id" = { + "description" = <<-EOT + Run Task ID. + Must match pattern: `^task-[a-zA-Z0-9]+$` + EOT + "pattern" = "^task-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Run Task Name." + "minLength" = 1 + "type" = "string" + } + "stage" = { + "default" = "post_plan" + "description" = <<-EOT + Run Task Stage. + Must be one of the following values: `pre_apply`, `pre_plan`, `post_plan`. + Default: `post_plan`. + EOT + "pattern" = "^(pre_apply|pre_plan|post_plan)$" + "type" = "string" + } + } + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "runTriggers" = { + "description" = <<-EOT + Run triggers allow you to connect this workspace to one or more source workspaces. + These connections allow runs to queue automatically in this workspace on successful apply of runs in any of the source workspaces. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers + EOT + "items" = { + "description" = <<-EOT + RunTrigger allows you to connect this workspace to one or more source workspaces. + These connections allow runs to queue automatically in this workspace on successful apply of runs in any of the source workspaces. + Only one of the fields `ID` or `Name` is allowed. + At least one of the fields `ID` or `Name` is mandatory. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Source Workspace ID. + Must match pattern: `^ws-[a-zA-Z0-9]+$` + EOT + "pattern" = "^ws-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Source Workspace Name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "sshKey" = { + "description" = <<-EOT + SSH key used to clone Terraform modules. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/ssh-keys + EOT + "properties" = { + "id" = { + "description" = <<-EOT + SSH key ID. + Must match pattern: `^sshkey-[a-zA-Z0-9]+$` + EOT + "pattern" = "^sshkey-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "SSH key name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + "tags" = { + "description" = <<-EOT + Workspace tags are used to help identify and group together workspaces. + Tags must be one or more characters; can include letters, numbers, colons, hyphens, and underscores; and must begin and end with a letter or number. + EOT + "items" = { + "description" = <<-EOT + Tags allows you to correlate, organize, and even filter workspaces based on the assigned tags. + Tags must be one or more characters; can include letters, numbers, colons, hyphens, and underscores; and must begin and end with a letter or number. + Must match pattern: `^[A-Za-z0-9][A-Za-z0-9:_-]*$` + EOT + "pattern" = "^[A-Za-z0-9][A-Za-z0-9:_-]*$" + "type" = "string" + } + "minItems" = 1 + "type" = "array" + } + "teamAccess" = { + "description" = <<-EOT + HCP Terraform workspaces can only be accessed by users with the correct permissions. + You can manage permissions for a workspace on a per-team basis. + When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, + with full admin permissions. These teams' access can't be removed from a workspace. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access + EOT + "items" = { + "description" = <<-EOT + HCP Terraform workspaces can only be accessed by users with the correct permissions. + You can manage permissions for a workspace on a per-team basis. + When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, + with full admin permissions. These teams' access can't be removed from a workspace. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access + EOT + "properties" = { + "access" = { + "description" = <<-EOT + There are two ways to choose which permissions a given team has on a workspace: fixed permission sets, and custom permissions. + Must be one of the following values: `admin`, `custom`, `plan`, `read`, `write`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#workspace-permissions + EOT + "pattern" = "^(admin|custom|plan|read|write)$" + "type" = "string" + } + "custom" = { + "description" = <<-EOT + Custom permissions let you assign specific, finer-grained permissions to a team than the broader fixed permission sets provide. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#custom-workspace-permissions + EOT + "properties" = { + "runTasks" = { + "description" = <<-EOT + Manage Workspace Run Tasks. + Default: `false`. + EOT + "type" = "boolean" + } + "runs" = { + "default" = "read" + "description" = <<-EOT + Run access. + Must be one of the following values: `apply`, `plan`, `read`. + Default: `read`. + EOT + "pattern" = "^(apply|plan|read)$" + "type" = "string" + } + "sentinel" = { + "default" = "none" + "description" = <<-EOT + Download Sentinel mocks. + Must be one of the following values: `none`, `read`. + Default: `none`. + EOT + "pattern" = "^(none|read)$" + "type" = "string" + } + "stateVersions" = { + "default" = "none" + "description" = <<-EOT + State access. + Must be one of the following values: `none`, `read`, `read-outputs`, `write`. + Default: `none`. + EOT + "pattern" = "^(none|read|read-outputs|write)$" + "type" = "string" + } + "variables" = { + "default" = "none" + "description" = <<-EOT + Variable access. + Must be one of the following values: `none`, `read`, `write`. + Default: `none`. + EOT + "pattern" = "^(none|read|write)$" + "type" = "string" + } + "workspaceLocking" = { + "default" = false + "description" = <<-EOT + Lock/unlock workspace. + Default: `false`. + EOT + "type" = "boolean" + } + } + "type" = "object" + } + "team" = { + "description" = <<-EOT + Team to grant access. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/teams + EOT + "properties" = { + "id" = { + "description" = <<-EOT + Team ID. + Must match pattern: `^team-[a-zA-Z0-9]+$` + EOT + "pattern" = "^team-[a-zA-Z0-9]+$" + "type" = "string" + } + "name" = { + "description" = "Team name." + "minLength" = 1 + "type" = "string" + } + } + "type" = "object" + } + } + "required" = [ + "access", + "team", + ] + "type" = "object" + } + "minItems" = 1 + "type" = "array" + } + "terraformVariables" = { + "description" = <<-EOT + Terraform variables for all plans and applies in this workspace. + Variables defined within a workspace always overwrite variables from variable sets that have the same type and the same key. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#terraform-variables + EOT + "items" = { + "description" = <<-EOT + Variables let you customize configurations, modify Terraform's behavior, and store information like provider credentials. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + EOT + "properties" = { + "description" = { + "description" = "Description of the variable." + "minLength" = 1 + "type" = "string" + } + "hcl" = { + "default" = false + "description" = <<-EOT + Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime. + Default: `false`. + EOT + "type" = "boolean" + } + "name" = { + "description" = "Name of the variable." + "minLength" = 1 + "type" = "string" + } + "sensitive" = { + "default" = false + "description" = <<-EOT + Sensitive variables are never shown in the UI or API. + They may appear in Terraform logs if your configuration is designed to output them. + Default: `false`. + EOT + "type" = "boolean" + } + "value" = { + "description" = "Value of the variable." + "minLength" = 1 + "type" = "string" + } + "valueFrom" = { + "description" = "Source for the 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" = <<-EOT + 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? + EOT + "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" + } + "secretKeyRef" = { + "description" = "Selects a key of a Secret." + "properties" = { + "key" = { + "description" = "The key of the secret to select from. Must be a valid secret key." + "type" = "string" + } + "name" = { + "description" = <<-EOT + 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? + EOT + "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" + } + "minItems" = 1 + "type" = "array" + } + "terraformVersion" = { + "description" = <<-EOT + The version of Terraform to use for this workspace. + If not specified, the latest available version will be used. + Must match pattern: `^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$` + More information: + - https://www.terraform.io/cloud-docs/workspaces/settings#terraform-version + EOT + "pattern" = "^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$" + "type" = "string" + } + "token" = { + "description" = "API Token to be used for API calls." + "properties" = { + "secretKeyRef" = { + "description" = "Selects a key of a secret in the workspace's namespace" + "properties" = { + "key" = { + "description" = "The key of the secret to select from. Must be a valid secret key." + "type" = "string" + } + "name" = { + "description" = <<-EOT + 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? + EOT + "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" + } + } + "required" = [ + "secretKeyRef", + ] + "type" = "object" + } + "versionControl" = { + "description" = <<-EOT + Settings for the workspace's VCS repository, enabling the UI/VCS-driven run workflow. + Omit this argument to utilize the CLI-driven and API-driven workflows, where runs are not driven by webhooks on your VCS provider. + More information: + - https://www.terraform.io/cloud-docs/run/ui + - https://www.terraform.io/cloud-docs/vcs + EOT + "properties" = { + "branch" = { + "description" = "The repository branch that Run will execute from. This defaults to the repository's default branch (e.g. main)." + "minLength" = 1 + "type" = "string" + } + "oAuthTokenID" = { + "description" = <<-EOT + The VCS Connection (OAuth Connection + Token) to use. + Must match pattern: `^ot-[a-zA-Z0-9]+$` + EOT + "pattern" = "^ot-[a-zA-Z0-9]+$" + "type" = "string" + } + "repository" = { + "description" = "A reference to your VCS repository in the format `/` where `` and `` refer to the organization and repository in your VCS provider." + "minLength" = 1 + "type" = "string" + } + "speculativePlans" = { + "default" = true + "description" = <<-EOT + Whether this workspace allows automatic speculative plans on PR. + Default: `true`. + More information: + - https://developer.hashicorp.com/terraform/cloud-docs/run/ui#speculative-plans-on-pull-requests + - https://developer.hashicorp.com/terraform/cloud-docs/run/remote-operations#speculative-plans + EOT + "type" = "boolean" + } + } + "type" = "object" + } + "workingDirectory" = { + "description" = <<-EOT + The directory where Terraform will execute, specified as a relative path from the root of the configuration directory. + More information: + - https://www.terraform.io/cloud-docs/workspaces/settings#terraform-working-directory + EOT + "minLength" = 1 + "type" = "string" + } + } + "required" = [ + "name", + "organization", + "token", + ] + "type" = "object" + } + "status" = { + "description" = "WorkspaceStatus defines the observed state of Workspace." + "properties" = { + "observedGeneration" = { + "description" = "Real world state generation." + "format" = "int64" + "type" = "integer" + } + "plan" = { + "description" = "Run status of plan-only/speculative plan that was triggered manually." + "properties" = { + "id" = { + "description" = "Latest plan-only/speculative plan HCP Terraform run ID." + "type" = "string" + } + "status" = { + "description" = "Latest plan-only/speculative plan HCP Terraform run status." + "type" = "string" + } + "terraformVersion" = { + "description" = "The version of Terraform to use for this run." + "pattern" = "^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$" + "type" = "string" + } + } + "type" = "object" + } + "runStatus" = { + "description" = "Workspace Runs status." + "properties" = { + "configurationVersion" = { + "description" = "The configuration version of this run." + "type" = "string" + } + "id" = { + "description" = "Current(both active and finished) HCP Terraform run ID." + "type" = "string" + } + "outputRunID" = { + "description" = "Run ID of the latest run that could update the outputs." + "type" = "string" + } + "status" = { + "description" = "Current(both active and finished) HCP Terraform run status." + "type" = "string" + } + } + "type" = "object" + } + "terraformVersion" = { + "description" = "Workspace Terraform version." + "pattern" = "^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$" + "type" = "string" + } + "updateAt" = { + "description" = "Workspace last update timestamp." + "format" = "int64" + "type" = "integer" + } + "variables" = { + "description" = "Workspace variables." + "items" = { + "properties" = { + "category" = { + "description" = "Category of the variable." + "type" = "string" + } + "id" = { + "description" = "ID of the variable." + "type" = "string" + } + "name" = { + "description" = "Name of the variable." + "type" = "string" + } + "valueID" = { + "description" = "ValueID is a hash of the variable on the CRD end." + "type" = "string" + } + "versionID" = { + "description" = "VersionID is a hash of the variable on the TFC end." + "type" = "string" + } + } + "required" = [ + "category", + "id", + "name", + "valueID", + "versionID", + ] + "type" = "object" + } + "type" = "array" + } + "workspaceID" = { + "description" = "Workspace ID that is managed by the controller." + "type" = "string" + } + } + "required" = [ + "workspaceID", + ] + "type" = "object" + } + } + "required" = [ + "spec", + ] + "type" = "object" + } + } + "served" = true + "storage" = true + "subresources" = { + "status" = {} + } + }, + ] + } + } +} diff --git a/kubernetes/test-dfa/config-basic/workspace.tf b/kubernetes/test-dfa/config-basic/workspace.tf new file mode 100644 index 0000000000..c6f2d6b356 --- /dev/null +++ b/kubernetes/test-dfa/config-basic/workspace.tf @@ -0,0 +1,29 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "kubernetes_namespace_v1" "demo_ns" { + metadata { + name = "demo-ns" + } +} + +resource "kubernetes_manifest" "demo_workspace" { + manifest = { + apiVersion = "app.terraform.io/v1alpha2" + kind = kubernetes_manifest.crd_workspaces.object.spec.names.kind + metadata = { + name = "deferred-demo" + namespace = kubernetes_namespace_v1.demo_ns.id + } + spec = { + name = "demo-ws" + organization = "demo-org" + token = { + secretKeyRef = { + name = "demo-token" + key = "token" + } + } + } + } +} \ No newline at end of file diff --git a/kubernetes/test-dfa/deferred_actions_test.go b/kubernetes/test-dfa/deferred_actions_test.go new file mode 100644 index 0000000000..4d038bd078 --- /dev/null +++ b/kubernetes/test-dfa/deferred_actions_test.go @@ -0,0 +1,116 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package testdfa + +import ( + "context" + "testing" + + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + "github.com/hashicorp/terraform-provider-kubernetes/internal/mux" +) + +var muxFactory = map[string]func() (tfprotov5.ProviderServer, error){ + "kubernetes": func() (tfprotov5.ProviderServer, error) { + return mux.MuxServer(context.Background(), "Test") + }, +} + +func TestAccKubernetesDeferredActions_2_step(t *testing.T) { + resource.Test(t, resource.TestCase{ + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + tfversion.SkipBelow(tfversion.Version1_9_0), + }, + AdditionalCLIOptions: &resource.AdditionalCLIOptions{ + Plan: resource.PlanOptions{AllowDeferral: true}, + Apply: resource.ApplyOptions{AllowDeferral: true}, + }, + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: muxFactory, + ConfigDirectory: func(tscr config.TestStepConfigRequest) string { + return "./config-basic" + }, + ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction("kind_cluster.demo", plancheck.ResourceActionCreate), + plancheck.ExpectDeferredChange("kubernetes_namespace_v1.demo_ns", plancheck.DeferredReasonProviderConfigUnknown), + plancheck.ExpectDeferredChange("kubernetes_manifest.crd_workspaces", plancheck.DeferredReasonProviderConfigUnknown), + plancheck.ExpectDeferredChange("kubernetes_manifest.demo_workspace", plancheck.DeferredReasonProviderConfigUnknown), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction("kubernetes_namespace_v1.demo_ns", plancheck.ResourceActionCreate), + plancheck.ExpectResourceAction("kubernetes_manifest.crd_workspaces", plancheck.ResourceActionCreate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("endpoint"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("cluster_ca_certificate"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("client_certificate"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("client_key"), knownvalue.NotNull()), + }, + }, + { + ProtoV5ProviderFactories: muxFactory, + ConfigDirectory: func(tscr config.TestStepConfigRequest) string { + return "./config-basic" + }, + ExpectNonEmptyPlan: true, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction("kubernetes_namespace_v1.demo_ns", plancheck.ResourceActionCreate), + plancheck.ExpectDeferredChange("kubernetes_manifest.demo_workspace", plancheck.DeferredReasonResourceConfigUnknown), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction("kubernetes_manifest.demo_workspace", plancheck.ResourceActionCreate), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("endpoint"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("cluster_ca_certificate"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("client_certificate"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("client_key"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kubernetes_namespace_v1.demo_ns", tfjsonpath.New("metadata").AtSliceIndex(0).AtMapKey("name"), knownvalue.StringExact("demo-ns")), + statecheck.ExpectKnownValue("kubernetes_manifest.crd_workspaces", tfjsonpath.New("manifest"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kubernetes_manifest.crd_workspaces", tfjsonpath.New("object"), knownvalue.NotNull()), + }, + }, + { + ProtoV5ProviderFactories: muxFactory, + ConfigDirectory: func(tscr config.TestStepConfigRequest) string { + return "./config-basic" + }, + ExpectNonEmptyPlan: false, + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectNoDeferredChanges(), + plancheck.ExpectResourceAction("kubernetes_manifest.demo_workspace", plancheck.ResourceActionCreate), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectEmptyPlan(), + }, + }, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("endpoint"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("cluster_ca_certificate"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("client_certificate"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kind_cluster.demo", tfjsonpath.New("client_key"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kubernetes_namespace_v1.demo_ns", tfjsonpath.New("metadata").AtSliceIndex(0).AtMapKey("name"), knownvalue.StringExact("demo-ns")), + statecheck.ExpectKnownValue("kubernetes_manifest.crd_workspaces", tfjsonpath.New("manifest"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kubernetes_manifest.crd_workspaces", tfjsonpath.New("object"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kubernetes_manifest.demo_workspace", tfjsonpath.New("manifest"), knownvalue.NotNull()), + statecheck.ExpectKnownValue("kubernetes_manifest.demo_workspace", tfjsonpath.New("object"), knownvalue.NotNull()), + }, + }, + }, + }) +} diff --git a/main.go b/main.go index 4de13c683e..9dbb3cfea8 100644 --- a/main.go +++ b/main.go @@ -14,14 +14,9 @@ import ( "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform-exec/tfexec" - "github.com/hashicorp/terraform-plugin-framework/providerserver" "github.com/hashicorp/terraform-plugin-go/tfprotov5" tf5server "github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server" - tf5muxserver "github.com/hashicorp/terraform-plugin-mux/tf5muxserver" - - framework "github.com/hashicorp/terraform-provider-kubernetes/internal/framework/provider" - "github.com/hashicorp/terraform-provider-kubernetes/kubernetes" - manifest "github.com/hashicorp/terraform-provider-kubernetes/manifest/provider" + "github.com/hashicorp/terraform-provider-kubernetes/internal/mux" ) const ( @@ -37,14 +32,9 @@ func main() { debugFlag := flag.Bool("debug", false, "Start provider in stand-alone debug mode.") flag.Parse() - providers := []func() tfprotov5.ProviderServer{ - kubernetes.Provider().GRPCProvider, - manifest.Provider(), - providerserver.NewProtocol5(framework.New(Version)), - } - ctx := context.Background() - muxer, err := tf5muxserver.NewMuxServer(ctx, providers...) + + muxer, err := mux.MuxServer(ctx, Version) if err != nil { log.Println(err.Error()) os.Exit(1) @@ -64,15 +54,16 @@ func main() { opts = append(opts, tf5server.WithDebug(ctx, reattachConfigCh, nil)) } - tf5server.Serve(providerName, muxer.ProviderServer, opts...) + tf5server.Serve(providerName, func() tfprotov5.ProviderServer { return muxer }, opts...) } // convertReattachConfig converts plugin.ReattachConfig to tfexec.ReattachConfig func convertReattachConfig(reattachConfig *plugin.ReattachConfig) tfexec.ReattachConfig { return tfexec.ReattachConfig{ - Protocol: string(reattachConfig.Protocol), - Pid: reattachConfig.Pid, - Test: true, + Protocol: string(reattachConfig.Protocol), + ProtocolVersion: reattachConfig.ProtocolVersion, + Pid: reattachConfig.Pid, + Test: true, Addr: tfexec.ReattachConfigAddr{ Network: reattachConfig.Addr.Network(), String: reattachConfig.Addr.String(), diff --git a/manifest/morph/scaffold.go b/manifest/morph/scaffold.go index 657a987a89..853a3bc4c8 100644 --- a/manifest/morph/scaffold.go +++ b/manifest/morph/scaffold.go @@ -23,6 +23,7 @@ func DeepUnknown(t tftypes.Type, v tftypes.Value, p *tftypes.AttributePath) (tft atts := t.(tftypes.Object).AttributeTypes var vals map[string]tftypes.Value ovals := make(map[string]tftypes.Value, len(atts)) + otypes := make(map[string]tftypes.Type, len(atts)) err := v.As(&vals) if err != nil { return tftypes.Value{}, p.NewError(err) @@ -34,11 +35,9 @@ func DeepUnknown(t tftypes.Type, v tftypes.Value, p *tftypes.AttributePath) (tft return tftypes.Value{}, np.NewError(err) } ovals[name] = nv - if nv.Type().Is(tftypes.Tuple{}) { - atts[name] = nv.Type() - } + otypes[name] = nv.Type() } - return tftypes.NewValue(tftypes.Object{AttributeTypes: atts}, ovals), nil + return tftypes.NewValue(tftypes.Object{AttributeTypes: otypes}, ovals), nil case t.Is(tftypes.Map{}): if v.IsNull() { return tftypes.NewValue(t, tftypes.UnknownValue), nil diff --git a/manifest/provider/configure.go b/manifest/provider/configure.go index db166fcb2c..cd57f8a209 100644 --- a/manifest/provider/configure.go +++ b/manifest/provider/configure.go @@ -49,6 +49,13 @@ func (s *RawProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov }) return response, nil } + + clcp := req.ClientCapabilities + if !cfgVal.IsFullyKnown() && clcp != nil && clcp.DeferralAllowed { + // need to deferr actions + s.clientConfigUnknown = true + } + err = cfgVal.As(&providerConfig) if err != nil { // invalid configuration schema - this shouldn't happen, bail out now @@ -60,66 +67,6 @@ func (s *RawProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov return response, nil } - providerEnabled := true - if !providerConfig["experiments"].IsNull() && providerConfig["experiments"].IsKnown() { - var experimentsBlock []tftypes.Value - err = providerConfig["experiments"].As(&experimentsBlock) - if err != nil { - // invalid configuration schema - this shouldn't happen, bail out now - response.Diagnostics = append(response.Diagnostics, &tfprotov5.Diagnostic{ - Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Provider configuration: failed to extract 'experiments' value", - Detail: err.Error(), - }) - return response, nil - } - if len(experimentsBlock) > 0 { - var experimentsObj map[string]tftypes.Value - err := experimentsBlock[0].As(&experimentsObj) - if err != nil { - // invalid configuration schema - this shouldn't happen, bail out now - response.Diagnostics = append(response.Diagnostics, &tfprotov5.Diagnostic{ - Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Provider configuration: failed to extract 'experiments' value", - Detail: err.Error(), - }) - return response, nil - } - if !experimentsObj["manifest_resource"].IsNull() && experimentsObj["manifest_resource"].IsKnown() { - err = experimentsObj["manifest_resource"].As(&providerEnabled) - if err != nil { - // invalid attribute type - this shouldn't happen, bail out for now - response.Diagnostics = append(response.Diagnostics, &tfprotov5.Diagnostic{ - Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Provider configuration: failed to extract 'manifest_resource' value", - Detail: err.Error(), - }) - return response, nil - } - } - } - } - if v := os.Getenv("TF_X_KUBERNETES_MANIFEST_RESOURCE"); v != "" { - providerEnabled, err = strconv.ParseBool(v) - if err != nil { - if err != nil { - // invalid attribute type - this shouldn't happen, bail out for now - response.Diagnostics = append(response.Diagnostics, &tfprotov5.Diagnostic{ - Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Provider configuration: failed to parse boolean from `TF_X_KUBERNETES_MANIFEST_RESOURCE` env var", - Detail: err.Error(), - }) - return response, nil - } - } - } - s.providerEnabled = providerEnabled - - if !providerEnabled { - // Configure should be a noop when not enabled in the provider block - return response, nil - } - overrides := &clientcmd.ConfigOverrides{} loader := &clientcmd.ClientConfigLoadingRules{} @@ -523,7 +470,7 @@ func (s *RawProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov } overrides.ClusterDefaults.ProxyURL = proxyURL } - if proxyUrl, ok := os.LookupEnv("KUBE_PROXY_URL"); ok && proxyUrl != "" { + if proxyURL, ok := os.LookupEnv("KUBE_PROXY_URL"); ok && proxyURL != "" { overrides.ClusterDefaults.ProxyURL = proxyURL } @@ -673,13 +620,6 @@ func (s *RawProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov } func (s *RawProviderServer) canExecute() (resp []*tfprotov5.Diagnostic) { - if !s.providerEnabled { - resp = append(resp, &tfprotov5.Diagnostic{ - Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Experimental feature not enabled.", - Detail: "The `kubernetes_manifest` resource is an experimental feature and must be explicitly enabled in the provider configuration block.", - }) - } if semver.IsValid(s.hostTFVersion) && semver.Compare(s.hostTFVersion, minTFVersion) < 0 { resp = append(resp, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, diff --git a/manifest/provider/datasource.go b/manifest/provider/datasource.go index 5362c1b95e..a4331018da 100644 --- a/manifest/provider/datasource.go +++ b/manifest/provider/datasource.go @@ -130,7 +130,7 @@ func (s *RawProviderServer) ReadPluralDataSource(ctx context.Context, req *tfpro if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Failed to save resource state", + Summary: "Failed to save resource state", // FIX ME Detail: err.Error(), }) return resp, nil @@ -188,7 +188,7 @@ func (s *RawProviderServer) ReadPluralDataSource(ctx context.Context, req *tfpro if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Failed to save resource state", + Summary: "Failed to save resource state", // FIX ME Detail: err.Error(), }) return resp, nil @@ -325,7 +325,7 @@ func (s *RawProviderServer) ReadSingularDataSource(ctx context.Context, req *tfp if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Failed to save resource state", + Summary: "Failed to save resource state", // FIX ME Detail: err.Error(), }) return resp, nil @@ -378,7 +378,7 @@ func (s *RawProviderServer) ReadSingularDataSource(ctx context.Context, req *tfp if err != nil { resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Failed to save resource state", + Summary: "Failed to save resource state", // FIX ME Detail: err.Error(), }) return resp, nil diff --git a/manifest/provider/import.go b/manifest/provider/import.go index c9397faede..cf6417c01f 100644 --- a/manifest/provider/import.go +++ b/manifest/provider/import.go @@ -25,6 +25,15 @@ func (s *RawProviderServer) ImportResourceState(ctx context.Context, req *tfprot // Presumably the Kubernetes API machinery already has a standard for expressing such a group. We should look there first. resp := &tfprotov5.ImportResourceStateResponse{} + cp := req.ClientCapabilities + if cp != nil && cp.DeferralAllowed && s.clientConfigUnknown { + // if client support it, request deferral when client configuration not fully known + resp.Deferred = &tfprotov5.Deferred{ + Reason: tfprotov5.DeferredReasonProviderConfigUnknown, + } + return resp, nil + } + execDiag := s.canExecute() if len(execDiag) > 0 { resp.Diagnostics = append(resp.Diagnostics, execDiag...) diff --git a/manifest/provider/plan.go b/manifest/provider/plan.go index 8bd0a25cf9..0d8cb82fe7 100644 --- a/manifest/provider/plan.go +++ b/manifest/provider/plan.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-provider-kubernetes/manifest" "github.com/hashicorp/terraform-provider-kubernetes/manifest/morph" "github.com/hashicorp/terraform-provider-kubernetes/manifest/payload" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" @@ -129,6 +130,16 @@ func isImportedFlagFromPrivate(p []byte) (f bool, d []*tfprotov5.Diagnostic) { func (s *RawProviderServer) PlanResourceChange(ctx context.Context, req *tfprotov5.PlanResourceChangeRequest) (*tfprotov5.PlanResourceChangeResponse, error) { resp := &tfprotov5.PlanResourceChangeResponse{} + canDeferr := req.ClientCapabilities != nil && req.ClientCapabilities.DeferralAllowed + + if canDeferr && s.clientConfigUnknown { + // if client supports it, request deferral when client configuration not fully known + resp.Deferred = &tfprotov5.Deferred{ + Reason: tfprotov5.DeferredReasonProviderConfigUnknown, + } + return resp, nil + } + isImported, d := isImportedFlagFromPrivate(req.PriorPrivate) resp.Diagnostics = append(resp.Diagnostics, d...) if !isImported { @@ -278,11 +289,19 @@ func (s *RawProviderServer) PlanResourceChange(ctx context.Context, req *tfproto } gvk, err := GVKFromTftypesObject(&ppMan, rm) if err != nil { - resp.Diagnostics = append(resp.Diagnostics, &tfprotov5.Diagnostic{ + rd := &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, - Summary: "Failed to determine GroupVersionResource for manifest", + Summary: "API did not recognize GroupVersionKind from manifest (CRD may not be installed)", Detail: err.Error(), - }) + } + resp.Diagnostics = append(resp.Diagnostics, rd) + if canDeferr && meta.IsNoMatchError(err) { + // request deferral when client configuration not fully known + resp.Deferred = &tfprotov5.Deferred{ + Reason: tfprotov5.DeferredReasonResourceConfigUnknown, + } + rd.Severity = tfprotov5.DiagnosticSeverityWarning + } return resp, nil } diff --git a/manifest/provider/plugin.go b/manifest/provider/plugin.go index afeedd4f49..5d0b54afd3 100644 --- a/manifest/provider/plugin.go +++ b/manifest/provider/plugin.go @@ -71,9 +71,10 @@ func ServeTest(ctx context.Context, logger hclog.Logger, t *testing.T) (tfexec.R // convertReattachConfig converts plugin.ReattachConfig to tfexec.ReattachConfig func convertReattachConfig(reattachConfig *plugin.ReattachConfig) tfexec.ReattachConfig { return tfexec.ReattachConfig{ - Protocol: string(reattachConfig.Protocol), - Pid: reattachConfig.Pid, - Test: true, + Protocol: string(reattachConfig.Protocol), + ProtocolVersion: reattachConfig.ProtocolVersion, + Pid: reattachConfig.Pid, + Test: true, Addr: tfexec.ReattachConfigAddr{ Network: reattachConfig.Addr.Network(), String: reattachConfig.Addr.String(), diff --git a/manifest/provider/provider_config.go b/manifest/provider/provider_config.go index 44a7072c8f..2adfb1cc63 100644 --- a/manifest/provider/provider_config.go +++ b/manifest/provider/provider_config.go @@ -269,7 +269,7 @@ func GetProviderConfigSchema() *tfprotov5.Schema { Sensitive: false, Description: "Enable the `kubernetes_manifest` resource.", DescriptionKind: 0, - Deprecated: false, + Deprecated: true, }, }, }, diff --git a/manifest/provider/read.go b/manifest/provider/read.go index 7778e69cb9..41143726fc 100644 --- a/manifest/provider/read.go +++ b/manifest/provider/read.go @@ -20,6 +20,15 @@ import ( func (s *RawProviderServer) ReadResource(ctx context.Context, req *tfprotov5.ReadResourceRequest) (*tfprotov5.ReadResourceResponse, error) { resp := &tfprotov5.ReadResourceResponse{} + cp := req.ClientCapabilities + if cp != nil && cp.DeferralAllowed && s.clientConfigUnknown { + // if client support it, request deferral when client configuration not fully known + resp.Deferred = &tfprotov5.Deferred{ + Reason: tfprotov5.DeferredReasonProviderConfigUnknown, + } + return resp, nil + } + // loop private state back in - ATM it's not needed here resp.Private = req.Private diff --git a/manifest/provider/server.go b/manifest/provider/server.go index cc7e8e9cb9..fb678a6f2f 100644 --- a/manifest/provider/server.go +++ b/manifest/provider/server.go @@ -28,16 +28,16 @@ type RawProviderServer struct { // Since the provider is essentially a gRPC server, the execution flow is dictated by the order of the client (Terraform) request calls. // Thus it needs a way to persist state between the gRPC calls. These attributes store values that need to be persisted between gRPC calls, // such as instances of the Kubernetes clients, configuration options needed at runtime. - logger hclog.Logger - clientConfig *rest.Config - dynamicClient dynamic.Interface - discoveryClient discovery.DiscoveryInterface - restMapper meta.RESTMapper - restClient rest.Interface - OAPIFoundry openapi.Foundry - - providerEnabled bool - hostTFVersion string + logger hclog.Logger + clientConfig *rest.Config + clientConfigUnknown bool + dynamicClient dynamic.Interface + discoveryClient discovery.DiscoveryInterface + restMapper meta.RESTMapper + restClient rest.Interface + OAPIFoundry openapi.Foundry + + hostTFVersion string } func dump(v interface{}) hclog.Format { @@ -87,3 +87,24 @@ func (s *RawProviderServer) StopProvider(ctx context.Context, req *tfprotov5.Sto return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } + +// CallFunction function +func (s *RawProviderServer) CallFunction(ctx context.Context, req *tfprotov5.CallFunctionRequest) (*tfprotov5.CallFunctionResponse, error) { + s.logger.Trace("[CallFunction][Request]\n%s\n", dump(*req)) + resp := &tfprotov5.CallFunctionResponse{} + return resp, nil +} + +// GetFunctions function +func (s *RawProviderServer) GetFunctions(ctx context.Context, req *tfprotov5.GetFunctionsRequest) (*tfprotov5.GetFunctionsResponse, error) { + s.logger.Trace("[GetFunctions][Request]\n%s\n", dump(*req)) + resp := &tfprotov5.GetFunctionsResponse{} + return resp, nil +} + +// MoveResourceState function +func (s *RawProviderServer) MoveResourceState(ctx context.Context, req *tfprotov5.MoveResourceStateRequest) (*tfprotov5.MoveResourceStateResponse, error) { + s.logger.Trace("[MoveResourceState][Request]\n%s\n", dump(*req)) + resp := &tfprotov5.MoveResourceStateResponse{} + return resp, nil +} diff --git a/manifest/test/acceptance/datasource_resources_test.go b/manifest/test/acceptance/datasource_resources_test.go new file mode 100644 index 0000000000..76761d8921 --- /dev/null +++ b/manifest/test/acceptance/datasource_resources_test.go @@ -0,0 +1,132 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +//go:build acceptance +// +build acceptance + +package acceptance + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-provider-kubernetes/manifest/provider" + "github.com/hashicorp/terraform-provider-kubernetes/manifest/test/helper/kubernetes" + tfstatehelper "github.com/hashicorp/terraform-provider-kubernetes/manifest/test/helper/state" + corev1 "k8s.io/api/core/v1" + "k8s.io/utils/ptr" +) + +func TestDataSourceKubernetesResources_DiffTuples(t *testing.T) { + ctx := context.Background() + + reattachInfo, err := provider.ServeTest(ctx, hclog.Default(), t) + if err != nil { + t.Errorf("Failed to create provider instance: %q", err) + } + + name := randName() + namespace := randName() + + tf := tfhelper.RequireNewWorkingDir(ctx, t) + tf.SetReattachInfo(ctx, reattachInfo) + defer func() { + tf.Destroy(ctx) + tf.Close() + k8shelper.AssertResourceDoesNotExist(t, "v1", "namespaces", name) + }() + + // Create a Namespace to provision the rest of the resources in it. + k8shelper.CreateNamespace(t, namespace) + defer k8shelper.DeleteResource(t, namespace, kubernetes.NewGroupVersionResource("v1", "namespaces")) + + // Create Pods to use a data source. + // The only difference between the two pods is the number of VolumeMounts(tuples) that will be created. + // This is necessary to ensure that DeepUnknown doesn't mutate object type when iterates over items. + // kubernetes_manifest failed to create pods with volumes, thus create them manually. + k8shelper.AssertNamespacedResourceDoesNotExist(t, "v1", "pods", namespace, name) + + volumes := []corev1.Volume{ + { + Name: "config", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + } + podSpecs := []corev1.PodSpec{ + { + TerminationGracePeriodSeconds: ptr.To(int64(1)), + Containers: []corev1.Container{ + { + Name: "this", + Image: "busybox", + Command: []string{"sleep", "infinity"}, + VolumeMounts: []corev1.VolumeMount{ + { + Name: "config", + MountPath: "/config-a", + }, + { + Name: "config", + MountPath: "/config-b", + }, + }, + }, + }, + Volumes: volumes, + }, + { + TerminationGracePeriodSeconds: ptr.To(int64(1)), + Containers: []corev1.Container{ + { + Name: "this", + Image: "busybox", + Command: []string{"sleep", "infinity"}, + VolumeMounts: []corev1.VolumeMount{ + { + Name: "config", + MountPath: "/config-a", + }, + { + Name: "config", + MountPath: "/config-b", + }, + { + Name: "config", + MountPath: "/config-c", + }, + }, + }, + }, + Volumes: volumes, + }, + } + + for i, ps := range podSpecs { + k8shelper.CreatePod(t, fmt.Sprintf("%s-%d", name, i), namespace, ps) + } + + // Get pods + tfvars := TFVARS{ + "namespace": namespace, + } + tfconfig := loadTerraformConfig(t, "DataSourceResources/pods_data_source.tf", tfvars) + tf.SetConfig(ctx, tfconfig) + tf.Init(ctx) + err = tf.Apply(ctx) + if err != nil { + t.Fatal(err.Error()) + } + + st, err := tf.State(ctx) + if err != nil { + t.Fatalf("Failed to retrieve terraform state: %q", err) + } + tfstate := tfstatehelper.NewHelper(st) + + // check the data source + tfstate.AssertAttributeLen(t, "data.kubernetes_resources.pods.objects", len(podSpecs)) +} diff --git a/manifest/test/acceptance/testdata/DataSourceResources/pods_data_source.tf b/manifest/test/acceptance/testdata/DataSourceResources/pods_data_source.tf new file mode 100644 index 0000000000..c420c2f4bf --- /dev/null +++ b/manifest/test/acceptance/testdata/DataSourceResources/pods_data_source.tf @@ -0,0 +1,8 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +data "kubernetes_resources" "pods" { + kind = "Pod" + api_version = "v1" + namespace = var.namespace +} diff --git a/manifest/test/helper/kubernetes/kubernetes_helper.go b/manifest/test/helper/kubernetes/kubernetes_helper.go index 8ddcb76871..021bd0d892 100644 --- a/manifest/test/helper/kubernetes/kubernetes_helper.go +++ b/manifest/test/helper/kubernetes/kubernetes_helper.go @@ -12,7 +12,9 @@ import ( "log" "testing" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -23,8 +25,6 @@ import ( "k8s.io/client-go/tools/clientcmd" k8sretry "k8s.io/client-go/util/retry" "k8s.io/kubectl/pkg/scheme" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Helper is a Kubernetes dynamic client wrapped with a set of helper functions @@ -119,6 +119,28 @@ func (k *Helper) CreateConfigMap(t *testing.T, name string, namespace string, da } } +// CreatePod creates a new Pod +func (k *Helper) CreatePod(t *testing.T, name, namespace string, podSpec corev1.PodSpec) { + t.Helper() + + pod := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Pod", + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + }, + "spec": podSpec, + }, + } + gvr := NewGroupVersionResource("v1", "pods") + _, err := k.dynClient.Resource(gvr).Namespace(namespace).Create(context.TODO(), pod, metav1.CreateOptions{}) + if err != nil { + t.Fatalf("Failed to create pod %q/%q: %v", namespace, name, err) + } +} + // DeleteResource deletes a resource referred to by the name and GVK func (k *Helper) DeleteResource(t *testing.T, name string, gvr schema.GroupVersionResource) { t.Helper() diff --git a/scripts/markdown-link-check.sh b/scripts/markdown-link-check.sh index b30f0c0050..ee607a3ee0 100755 --- a/scripts/markdown-link-check.sh +++ b/scripts/markdown-link-check.sh @@ -41,7 +41,7 @@ ${DOCKER} run ${DOCKER_RUN_OPTS} --rm -i -t \ -w /github/workspace \ --entrypoint /usr/bin/find \ docker.io/robertbeal/markdown-link-checker \ - website \( -type f -name "*.md" -or -name "*.markdown" \) -exec markdown-link-check --config .markdownlinkcheck.json --quiet --verbose {} \; \ + docs \( -type f -name "*.md" -or -name "*.markdown" \) -exec markdown-link-check --config .markdownlinkcheck.json --quiet --verbose {} \; \ | tee -a "${output_file}" touch "${error_file}" diff --git a/templates/data-sources/all_namespaces.md.tmpl b/templates/data-sources/all_namespaces.md.tmpl new file mode 100644 index 0000000000..5e9cccabbf --- /dev/null +++ b/templates/data-sources/all_namespaces.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_all_namespaces" +description: |- + Lists all namespaces within a cluster. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/all_namespaces/example_1.tf"}} diff --git a/website/docs/d/config_map.html.markdown b/templates/data-sources/config_map.md.tmpl similarity index 86% rename from website/docs/d/config_map.html.markdown rename to templates/data-sources/config_map.md.tmpl index a11f34daf2..ea07614c7f 100644 --- a/website/docs/d/config_map.html.markdown +++ b/templates/data-sources/config_map.md.tmpl @@ -1,26 +1,21 @@ --- subcategory: "core/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_config_map" description: |- This data source reads configuration data from a config map. --- -# kubernetes_config map +# {{ .Name }} -Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs. +{{ .Description }} + +{{ .SchemaMarkdown }} ~> **Note:** All arguments including the config map data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). ## Example Usage -```hcl -data "kubernetes_config_map" "example" { - metadata { - name = "my-config" - } -} -``` +{{tffile "examples/data-sources/config_map/example_1.tf"}} ## Argument Reference diff --git a/templates/data-sources/config_map_v1.md.tmpl b/templates/data-sources/config_map_v1.md.tmpl new file mode 100644 index 0000000000..b62fea49f2 --- /dev/null +++ b/templates/data-sources/config_map_v1.md.tmpl @@ -0,0 +1,19 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map_v1" +description: |- + This data source reads configuration data from a config map. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + + +~> **Note:** All arguments including the config map data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +## Example Usage + +{{tffile "examples/data-sources/config_map_v1/example_1.tf"}} diff --git a/templates/data-sources/endpoints_v1.md.tmpl b/templates/data-sources/endpoints_v1.md.tmpl new file mode 100644 index 0000000000..9d3b1867d3 --- /dev/null +++ b/templates/data-sources/endpoints_v1.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_endpoints_v1" +description: |- + An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/endpoints_v1/example_1.tf"}} + diff --git a/templates/data-sources/ingress.md.tmpl b/templates/data-sources/ingress.md.tmpl new file mode 100644 index 0000000000..8190432c6e --- /dev/null +++ b/templates/data-sources/ingress.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "extensions/v1beta1" +page_title: "Kubernetes: kubernetes_ingress" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/ingress/example_1.tf"}} + diff --git a/templates/data-sources/ingress_v1.md.tmpl b/templates/data-sources/ingress_v1.md.tmpl new file mode 100644 index 0000000000..29198a6052 --- /dev/null +++ b/templates/data-sources/ingress_v1.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_v1" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/ingress_v1/example_1.tf"}} diff --git a/templates/data-sources/mutating_webhook_configuration_v1.md.tmpl b/templates/data-sources/mutating_webhook_configuration_v1.md.tmpl new file mode 100644 index 0000000000..a4227ebc84 --- /dev/null +++ b/templates/data-sources/mutating_webhook_configuration_v1.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "admissionregistration/v1" +page_title: "Kubernetes: kubernetes_mutating_webhook_configuration_v1" +description: |- + Mutating Webhook Configuration configures a mutating admission webhook +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/mutating_webhook_configuration_v1/example_1.tf"}} diff --git a/templates/data-sources/namespace.md.tmpl b/templates/data-sources/namespace.md.tmpl new file mode 100644 index 0000000000..225ba46382 --- /dev/null +++ b/templates/data-sources/namespace.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_namespace" +description: |- + Queries attributes of a Namespace within the cluster. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/namespace/example_1.tf"}} diff --git a/website/docs/d/namespace_v1.html.markdown b/templates/data-sources/namespace_v1.md.tmpl similarity index 88% rename from website/docs/d/namespace_v1.html.markdown rename to templates/data-sources/namespace_v1.md.tmpl index f8c475b898..16dc6b07b8 100644 --- a/website/docs/d/namespace_v1.html.markdown +++ b/templates/data-sources/namespace_v1.md.tmpl @@ -1,25 +1,19 @@ --- subcategory: "core/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_namespace_v1" description: |- Queries attributes of a Namespace within the cluster. --- -# kubernetes_namespace_v1 +# {{ .Name }} -This data source provides a mechanism to query attributes of any specific namespace within a Kubernetes cluster. -In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users. +{{ .Description }} + +{{ .SchemaMarkdown }} ## Example Usage -```hcl -data "kubernetes_namespace_v1" "example" { - metadata { - name = "kube-system" - } -} -``` +{{tffile "examples/data-sources/namespace_v1/example_1.tf"}} ## Argument Reference diff --git a/templates/data-sources/nodes.md.tmpl b/templates/data-sources/nodes.md.tmpl new file mode 100644 index 0000000000..7bf7d9d3c9 --- /dev/null +++ b/templates/data-sources/nodes.md.tmpl @@ -0,0 +1,22 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_nodes" +description: |- + Gets nodes within a cluster. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example usage + +### All nodes + +{{tffile "examples/data-sources/nodes/example_1.tf"}} + +### By label + +{{tffile "examples/data-sources/nodes/example_2.tf"}} diff --git a/templates/data-sources/persistent_volume_claim.md.tmpl b/templates/data-sources/persistent_volume_claim.md.tmpl new file mode 100644 index 0000000000..6ca134e37c --- /dev/null +++ b/templates/data-sources/persistent_volume_claim.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim" +description: |- + A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/persistent_volume_claim/example_1.tf"}} + +## Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim.example default/example-name +``` diff --git a/templates/data-sources/persistent_volume_claim_v1.md.tmpl b/templates/data-sources/persistent_volume_claim_v1.md.tmpl new file mode 100644 index 0000000000..d29b268b75 --- /dev/null +++ b/templates/data-sources/persistent_volume_claim_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim_v1" +description: |- + A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/persistent_volume_claim_v1/example_1.tf"}} + +## Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim_v1.example default/example-name +``` diff --git a/templates/data-sources/persistent_volume_v1.md.tmpl b/templates/data-sources/persistent_volume_v1.md.tmpl new file mode 100644 index 0000000000..3481e66c6d --- /dev/null +++ b/templates/data-sources/persistent_volume_v1.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_v1" +description: |- + A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/persistent_volume_v1/example_1.tf"}} + diff --git a/templates/data-sources/pod.md.tmpl b/templates/data-sources/pod.md.tmpl new file mode 100644 index 0000000000..b1669fe3ec --- /dev/null +++ b/templates/data-sources/pod.md.tmpl @@ -0,0 +1,30 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +``` +data "kubernetes_pod" "test" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod.example default/terraform-example +``` diff --git a/templates/data-sources/pod_v1.md.tmpl b/templates/data-sources/pod_v1.md.tmpl new file mode 100644 index 0000000000..41b30184aa --- /dev/null +++ b/templates/data-sources/pod_v1.md.tmpl @@ -0,0 +1,30 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod_v1" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +``` +data "kubernetes_pod_v1" "test" { + metadata { + name = "terraform-example" + } +} +``` + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod_v1.example default/terraform-example +``` diff --git a/templates/data-sources/resource.md.tmpl b/templates/data-sources/resource.md.tmpl new file mode 100644 index 0000000000..c242b7d69f --- /dev/null +++ b/templates/data-sources/resource.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "manifest" +page_title: "Kubernetes: kubernetes_resource" +description: |- + This is a generic data source for Kubernetes API resources +--- + +# {{ .Name }} + +This data source is a generic way to retrieve resources from the Kubernetes API. + +{{ .SchemaMarkdown }} + +### Example: Get data from a ConfigMap + +{{tffile "examples/data-sources/resource/example_1.tf"}} + diff --git a/templates/data-sources/resources.md.tmpl b/templates/data-sources/resources.md.tmpl new file mode 100644 index 0000000000..8c95acadbb --- /dev/null +++ b/templates/data-sources/resources.md.tmpl @@ -0,0 +1,21 @@ +--- +subcategory: "manifest" +page_title: "Kubernetes: kubernetes_resources" +description: |- + This data source is a generic way to query for a list of resources from the Kubernetes API and filter them. +--- + +# {{ .Name }} + +This data source is a generic way to query for a list of Kubernetes resources and filter them using a label or field selector. + +{{ .SchemaMarkdown }} + +### Example: Get a list of namespaces excluding "kube-system" using `field_selector` + +{{tffile "examples/data-sources/resources/example_1.tf"}} + +### Example: Get a list of namespaces excluding "kube-system" using `label_selector` + +{{tffile "examples/data-sources/resources/example_2.tf"}} + diff --git a/website/docs/d/secret.html.markdown b/templates/data-sources/secret.md.tmpl similarity index 77% rename from website/docs/d/secret.html.markdown rename to templates/data-sources/secret.md.tmpl index 2b4b54c791..50921d3c55 100644 --- a/website/docs/d/secret.html.markdown +++ b/templates/data-sources/secret.md.tmpl @@ -1,16 +1,15 @@ --- subcategory: "core/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_secret" description: |- The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. --- -# kubernetes_secret +# {{ .Name }} -The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. -Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. -The resource will by default create a secret which is available to any pod in the specified (or default) namespace. +{{ .Description }} + +{{ .SchemaMarkdown }} ~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) @@ -18,13 +17,7 @@ The resource will by default create a secret which is available to any pod in th ## Example Usage -```hcl -data "kubernetes_secret" "example" { - metadata { - name = "basic-auth" - } -} -``` +{{tffile "examples/data-sources/secret/example_1.tf"}} ## Argument Reference @@ -54,18 +47,7 @@ The following arguments are supported: ~> In case the secret has been created outside terraform in order to retrieve binary data from the secret in base64 format you need to define a `binary_data` map with data to retrieve as key and an empty string as a value -```hcl -data "kubernetes_secret" "example" { - metadata { - name = "example-secret" - namespace = "kube-system" - } - binary_data = { - "keystore.p12" = "" - another_field = "" - } -} -``` +{{tffile "examples/data-sources/secret/example_2.tf"}} * `type` - The secret type. Defaults to `Opaque`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/c7151dd8dd7e487e96e5ce34c6a416bb3b037609/contributors/design-proposals/auth/secrets.md#proposed-design) * `immutable` - Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). diff --git a/website/docs/d/secret_v1.html.markdown b/templates/data-sources/secret_v1.md.tmpl similarity index 77% rename from website/docs/d/secret_v1.html.markdown rename to templates/data-sources/secret_v1.md.tmpl index b466d5521a..2f3df339f3 100644 --- a/website/docs/d/secret_v1.html.markdown +++ b/templates/data-sources/secret_v1.md.tmpl @@ -1,16 +1,15 @@ --- subcategory: "core/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_secret_v1" description: |- The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. --- -# kubernetes_secret_v1 +# {{ .Name }} -The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. -Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. -The resource will by default create a secret which is available to any pod in the specified (or default) namespace. +{{ .Description }} + +{{ .SchemaMarkdown }} ~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) @@ -18,13 +17,7 @@ The resource will by default create a secret which is available to any pod in th ## Example Usage -```hcl -data "kubernetes_secret_v1" "example" { - metadata { - name = "basic-auth" - } -} -``` +{{tffile "examples/data-sources/secret_v1/example_1.tf"}} ## Argument Reference @@ -54,18 +47,7 @@ The following arguments are supported: ~> In case the secret has been created outside terraform in order to retrieve binary data from the secret in base64 format you need to define a `binary_data` map with data to retrieve as key and an empty string as a value -```hcl -data "kubernetes_secret_v1" "example" { - metadata { - name = "example-secret" - namespace = "kube-system" - } - binary_data = { - "keystore.p12" = "" - another_field = "" - } -} -``` +{{tffile "examples/data-sources/secret_v1/example_2.tf"}} * `type` - The secret type. Defaults to `Opaque`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/c7151dd8dd7e487e96e5ce34c6a416bb3b037609/contributors/design-proposals/auth/secrets.md#proposed-design) * `immutable` - Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). diff --git a/templates/data-sources/service.md.tmpl b/templates/data-sources/service.md.tmpl new file mode 100644 index 0000000000..bc5f83b164 --- /dev/null +++ b/templates/data-sources/service.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/service/example_1.tf"}} + diff --git a/templates/data-sources/service_account.md.tmpl b/templates/data-sources/service_account.md.tmpl new file mode 100644 index 0000000000..1cf9a31c32 --- /dev/null +++ b/templates/data-sources/service_account.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/service_account/example_1.tf"}} diff --git a/templates/data-sources/service_account_v1.md.tmpl b/templates/data-sources/service_account_v1.md.tmpl new file mode 100644 index 0000000000..02d9946060 --- /dev/null +++ b/templates/data-sources/service_account_v1.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account_v1" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/data-sources/service_account_v1/example_1.tf"}} + diff --git a/templates/data-sources/service_v1.md.tmpl b/templates/data-sources/service_v1.md.tmpl new file mode 100644 index 0000000000..2db37486e5 --- /dev/null +++ b/templates/data-sources/service_v1.md.tmpl @@ -0,0 +1,18 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_v1" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. This data source allows you to pull data about such service. + +## Example Usage + +{{tffile "examples/data-sources/service_v1/example_1.tf"}} diff --git a/website/docs/d/storage_class.html.markdown b/templates/data-sources/storage_class.md.tmpl similarity index 85% rename from website/docs/d/storage_class.html.markdown rename to templates/data-sources/storage_class.md.tmpl index 2277992ab9..0396d642b1 100644 --- a/website/docs/d/storage_class.html.markdown +++ b/templates/data-sources/storage_class.md.tmpl @@ -1,16 +1,15 @@ --- subcategory: "storage/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_storage_class" description: |- Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. --- -# kubernetes_storage_class +# {{ .Name }} -Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +{{ .Description }} -Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ +{{ .SchemaMarkdown }} ## Example Usage @@ -28,7 +27,6 @@ The following arguments are supported: * `metadata` - (Required) Standard storage class's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - ## Nested Blocks ### `metadata` @@ -38,8 +36,11 @@ The following arguments are supported: * `name` - (Required) Name of the storage class, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) ### `allowed_topologies` + īŋŧ + #### Arguments + īŋŧ * `match_label_expressions` - (Optional) A list of topology selector requirements by labels. See [match_label_expressions](#match_label_expressions) @@ -53,18 +54,15 @@ The following arguments are supported: #### Attributes - * `generation` - A sequence number representing a specific generation of the desired state. * `resource_version` - An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) * `uid` - The unique in time and space value for this storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - ## Argument Reference The following attributes are exported: -* `parameters` - The parameters for the provisioner that creates volume of this storage class. - Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#parameters). +* `parameters` - The parameters for the provisioner that creates volume of this storage class. Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#parameters). * `storage_provisioner` - Indicates the type of the provisioner this storage class represents * `reclaim_policy` - Indicates the reclaim policy used. * `volume_binding_mode` - Indicates when volume binding and dynamic provisioning should occur. diff --git a/website/docs/d/storage_class_v1.html.markdown b/templates/data-sources/storage_class_v1.md.tmpl similarity index 85% rename from website/docs/d/storage_class_v1.html.markdown rename to templates/data-sources/storage_class_v1.md.tmpl index 7d877f8ace..0b5bec15c6 100644 --- a/website/docs/d/storage_class_v1.html.markdown +++ b/templates/data-sources/storage_class_v1.md.tmpl @@ -1,16 +1,15 @@ --- subcategory: "storage/v1" -layout: "kubernetes" page_title: "Kubernetes: kubernetes_storage_class_v1" description: |- Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. --- -# kubernetes_storage_class_v1 +# {{ .Name }} -Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +{{ .Description }} -Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ +{{ .SchemaMarkdown }} ## Example Usage @@ -28,7 +27,6 @@ The following arguments are supported: * `metadata` - (Required) Standard storage class's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - ## Nested Blocks ### `metadata` @@ -38,8 +36,11 @@ The following arguments are supported: * `name` - (Required) Name of the storage class, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) ### `allowed_topologies` + īŋŧ + #### Arguments + īŋŧ * `match_label_expressions` - (Optional) A list of topology selector requirements by labels. See [match_label_expressions](#match_label_expressions) @@ -53,18 +54,15 @@ The following arguments are supported: #### Attributes - * `generation` - A sequence number representing a specific generation of the desired state. * `resource_version` - An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) * `uid` - The unique in time and space value for this storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - ## Argument Reference The following attributes are exported: -* `parameters` - The parameters for the provisioner that creates volume of this storage class. - Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#parameters). +* `parameters` - The parameters for the provisioner that creates volume of this storage class. Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#parameters). * `storage_provisioner` - Indicates the type of the provisioner this storage class represents * `reclaim_policy` - Indicates the reclaim policy used. * `volume_binding_mode` - Indicates when volume binding and dynamic provisioning should occur. diff --git a/templates/functions/manifest_decode.md.tmpl b/templates/functions/manifest_decode.md.tmpl new file mode 100644 index 0000000000..c463c64252 --- /dev/null +++ b/templates/functions/manifest_decode.md.tmpl @@ -0,0 +1,32 @@ +--- +subcategory: "" +page_title: "manifest_decode function" +description: |- + Decode a Kubernetes YAML manifest +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .FunctionArgumentsMarkdown }} template can be used to replace manual argument documentation if descriptions of function arguments are added in the provider source code. */ -}} + +# function: manifest_decode + +Given a YAML text containing a Kubernetes manifest, will decode and return an object representation of that resource. + +## Example Usage + +{{tffile "examples/functions/manifest_decode/example_1.tf"}} + +## Signature + +```text +manifest_decode(manifest string) object +``` + +## Arguments + +1. `manifest` (String) The YAML text for a Kubernetes manifest + +## Return Type + +The `object` returned from `manifest_decode` is dynamic and will mirror the structure of the YAML manifest supplied. diff --git a/templates/functions/manifest_decode_multi.md.tmpl b/templates/functions/manifest_decode_multi.md.tmpl new file mode 100644 index 0000000000..03bf6d4d14 --- /dev/null +++ b/templates/functions/manifest_decode_multi.md.tmpl @@ -0,0 +1,32 @@ +--- +subcategory: "" +page_title: "manifest_decode_multi function" +description: |- + Decode a Kubernetes YAML manifest containing multiple resources +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .FunctionArgumentsMarkdown }} template can be used to replace manual argument documentation if descriptions of function arguments are added in the provider source code. */ -}} + +# function: manifest_decode_multi + +Given a YAML text containing a Kubernetes manifest with multiple resources, will decode the manifest and return a tuple of object representations for each resource. + +## Example Usage + +{{tffile "examples/functions/manifest_decode_multi/example_1.tf"}} + +## Signature + +```text +manifest_decode_multi(manifest string) tuple +``` + +## Arguments + +1. `manifest` (String) The YAML text for a Kubernetes manifest containing multiple resources + +## Return Type + +The `tuple` returned from `manifest_decode_multi` will contain dynamic objects that mirror the structure of the resources in YAML manifest supplied. diff --git a/templates/functions/manifest_encode.md.tmpl b/templates/functions/manifest_encode.md.tmpl new file mode 100644 index 0000000000..41a06f515c --- /dev/null +++ b/templates/functions/manifest_encode.md.tmpl @@ -0,0 +1,32 @@ +--- +subcategory: "" +page_title: "manifest_encode function" +description: |- + Decode a Kubernetes YAML manifest containing multiple resources +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .FunctionArgumentsMarkdown }} template can be used to replace manual argument documentation if descriptions of function arguments are added in the provider source code. */ -}} + +# function: manifest_encode + +Given an object representation of a Kubernetes manifest, will encode and return a YAML string for that resource. + +## Example Usage + +{{tffile "examples/functions/manifest_encode/example_1.tf"}} + +## Signature + +```text +manifest_encode(manifest object) string +``` + +## Arguments + +1. `manifest` (String) The object representation of a Kubernetes manifest + +## Return Type + +The `string` returned from `manifest_encode` will contain the YAML encoded Kubernetes manifest. diff --git a/website/docs/guides/alpha-manifest-migration-guide.markdown b/templates/guides/alpha-manifest-migration-guide.markdown similarity index 100% rename from website/docs/guides/alpha-manifest-migration-guide.markdown rename to templates/guides/alpha-manifest-migration-guide.markdown diff --git a/website/docs/guides/getting-started.html.markdown b/templates/guides/getting-started.html.markdown similarity index 100% rename from website/docs/guides/getting-started.html.markdown rename to templates/guides/getting-started.html.markdown diff --git a/website/docs/guides/v2-upgrade-guide.markdown b/templates/guides/v2-upgrade-guide.markdown similarity index 100% rename from website/docs/guides/v2-upgrade-guide.markdown rename to templates/guides/v2-upgrade-guide.markdown diff --git a/website/docs/guides/versioned-resources.markdown b/templates/guides/versioned-resources.markdown similarity index 100% rename from website/docs/guides/versioned-resources.markdown rename to templates/guides/versioned-resources.markdown diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl new file mode 100644 index 0000000000..3740e48b09 --- /dev/null +++ b/templates/index.md.tmpl @@ -0,0 +1,145 @@ +--- +page_title: "Provider: Kubernetes" +description: |- + The Kubernetes (K8s) provider is used to interact with the resources supported by Kubernetes. The provider needs to be configured with the proper credentials before it can be used. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# Kubernetes Provider + +The Kubernetes (K8S) provider is used to interact with the resources supported by Kubernetes. The provider needs to be configured with the proper credentials before it can be used. + +Use the navigation to the left to read about the available resources. + +## Example Usage + +{{tffile "examples/example_1.tf"}} + +## Kubernetes versions + +Both backward and forward compatibility with Kubernetes API is mostly defined by the [official K8S Go library](https://github.com/kubernetes/kubernetes) (prior to `1.1` release) and [client Go library](https://github.com/kubernetes/client-go) which we ship with Terraform. Below are versions of the library bundled with given versions of Terraform. + +* Terraform `<= 0.9.6` (prior to provider split) - Kubernetes `1.5.4` +* Terraform `0.9.7` (prior to provider split) `< 1.1` (provider version) - Kubernetes `1.6.1` +* `1.1+` - Kubernetes `1.7` + +## Stacking with managed Kubernetes cluster resources + +Terraform providers for various cloud providers feature resources to spin up managed Kubernetes clusters on services such as EKS, AKS and GKE. Such resources (or data-sources) will have attributes that expose the credentials needed for the Kubernetes provider to connect to these clusters. + +To use these credentials with the Kubernetes provider, they can be interpolated into the respective attributes of the Kubernetes provider configuration block. + +~> **WARNING** When using interpolation to pass credentials to the Kubernetes provider from other resources, these resources SHOULD NOT be created in the same Terraform module where Kubernetes provider resources are also used. This will lead to intermittent and unpredictable errors which are hard to debug and diagnose. The root issue lies with the order in which Terraform itself evaluates the provider blocks vs. actual resources. Please refer to [this section of Terraform docs](https://www.terraform.io/docs/configuration/providers.html#provider-configuration) for further explanation. + +The most reliable way to configure the Kubernetes provider is to ensure that the cluster itself and the Kubernetes provider resources can be managed with separate `apply` operations. Data-sources can be used to convey values between the two stages as needed. + +For specific usage examples, see the guides for [AKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/aks/README.md), [EKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/eks/README.md), and [GKE](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/gke/README.md). + +## Authentication + +~> NOTE: The provider does not use the `KUBECONFIG` environment variable by default. See the attribute reference below for the environment variables that map to provider block attributes. + +The Kubernetes provider can get its configuration in two ways: + +1. *Explicitly* by supplying attributes to the provider block. This includes: + * [Using a kubeconfig file](#file-config) + * [Supplying credentials](#credentials-config) + * [Exec plugins](#exec-plugins) +2. *Implicitly* through environment variables. This includes: + * [Using the in-cluster config](#in-cluster-config) + +The provider always first tries to load **a config file** from a given location when `config_path` or `config_paths` (or their equivalent environment variables) are set. Depending on whether you have a current context set this *may* require `config_context_auth_info` and/or `config_context_cluster` and/or `config_context`. + +For a full list of supported provider authentication arguments and their corresponding environment variables, see the [argument reference](#argument-reference) below. + +### File config + +The easiest way is to supply a path to your kubeconfig file using the `config_path` attribute or using the `KUBE_CONFIG_PATH` environment variable. A kubeconfig file may have multiple contexts. If `config_context` is not specified, the provider will use the `default` context. + +{{tffile "examples/example_2.tf"}} + +The provider also supports multiple paths in the same way that kubectl does using the `config_paths` attribute or `KUBE_CONFIG_PATHS` environment variable. + +{{tffile "examples/example_3.tf"}} + +### Credentials config + +You can also configure the host, basic auth credentials, and client certificate authentication explicitly or through environment variables. + +{{tffile "examples/example_4.tf"}} + +### In-cluster Config + +The provider uses the `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT` environment variables to detect when it is running inside a cluster, so in this case you do not need to specify any attributes in the provider block if you want to connect to the local kubernetes cluster. + +If you want to connect to a different cluster than the one terraform is running inside, configure the provider as [above](#credentials-config). + +Find more comprehensive `in-cluster` config example [here](https://github.com/hashicorp/terraform-provider-kubernetes/tree/main/_examples/in-cluster). + +## Exec plugins + +Some cloud providers have short-lived authentication tokens that can expire relatively quickly. To ensure the Kubernetes provider is receiving valid credentials, an exec-based plugin can be used to fetch a new token before each Terraform operation. For example, on EKS, the command `eks get-token` can be used: + +~> IMPORTANT: DO NOT mix `exec` blocks with other credential attributes such as `token` or `client_certificate` in the provider configuration. This leads to undefined behaviour and there is no guarantee about which credential will actually be used. + +{{tffile "examples/example_5.tf"}} + +## Examples + +For further reading, see these examples which demonstrate different approaches to keeping the cluster credentials up to date: [AKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/aks/README.md), [EKS](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/eks/README.md), and [GKE](https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/_examples/gke/README.md). + +## Ignore Kubernetes annotations and labels + +In certain cases, external systems can add and modify resources annotations and labels for their own purposes. However, Terraform will remove them since they are not presented in the code. It also might be hard to update code accordingly to stay tuned with the changes that come outside. In order to address this `ignore_annotations` and `ignore_labels` attributes were introduced on the provider level. They allow Terraform to ignore certain annotations and labels across all resources. + +Both attributes support RegExp to match metadata objects more effectively. + +~> **Note:** RegExp will only work on root metadata objects. It's currently not possible to use RegExp for ignoring annotations/labels in metadata objects that are nested such as `spec.template.metadata[0].annotations["..."]`. + +Please keep in mind that all data sources remain unaffected, and the provider always returns all labels and annotations, despite the `ignore_annotations` and `ignore_labels` settings. The same applies to the pod and job definitions that fall under templates. To ignore certain annotations and/or labels on the template level, please use the `ignore_changes` feature of the [lifecycle](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle) meta-argument. + +### Examples + +The following example demonstrates how to ignore changes related to the `kubectl.kubernetes.io/restartedAt` annotation that were made in the upstream Kubernetes object: + +{{tffile "examples/example_6.tf"}} + +The following example demonstrates how to ignore particular annotation keys: + +{{tffile "examples/example_7.tf"}} + +Next example demonstrates how to ignore AWS load balancer annotations: + +{{tffile "examples/example_8.tf"}} + +Since dot `.`, forward slash `/`, and some other symbols have special meaning in RegExp, they should be escaped by adding a double backslash in front of them if you want to use them as they are. + +## Argument Reference + +The following arguments are supported: + +* `host` - (Optional) The hostname (in form of URI) of the Kubernetes API. Can be sourced from `KUBE_HOST`. +* `username` - (Optional) The username to use for HTTP basic authentication when accessing the Kubernetes API. Can be sourced from `KUBE_USER`. +* `password` - (Optional) The password to use for HTTP basic authentication when accessing the Kubernetes API. Can be sourced from `KUBE_PASSWORD`. +* `insecure` - (Optional) Whether the server should be accessed without verifying the TLS certificate. Can be sourced from `KUBE_INSECURE`. Defaults to `false`. +* `tls_server_name` - (Optional) Server name passed to the server for SNI and is used in the client to check server certificates against. Can be sourced from `KUBE_TLS_SERVER_NAME`. +* `client_certificate` - (Optional) PEM-encoded client certificate for TLS authentication. Can be sourced from `KUBE_CLIENT_CERT_DATA`. +* `client_key` - (Optional) PEM-encoded client certificate key for TLS authentication. Can be sourced from `KUBE_CLIENT_KEY_DATA`. +* `cluster_ca_certificate` - (Optional) PEM-encoded root certificates bundle for TLS authentication. Can be sourced from `KUBE_CLUSTER_CA_CERT_DATA`. +* `config_path` - (Optional) A path to a kube config file. Can be sourced from `KUBE_CONFIG_PATH`. +* `config_paths` - (Optional) A list of paths to the kube config files. Can be sourced from `KUBE_CONFIG_PATHS`. +* `config_context` - (Optional) Context to choose from the config file. Can be sourced from `KUBE_CTX`. +* `config_context_auth_info` - (Optional) Authentication info context of the kube config (name of the kubeconfig user, `--user` flag in `kubectl`). Can be sourced from `KUBE_CTX_AUTH_INFO`. +* `config_context_cluster` - (Optional) Cluster context of the kube config (name of the kubeconfig cluster, `--cluster` flag in `kubectl`). Can be sourced from `KUBE_CTX_CLUSTER`. +* `token` - (Optional) Token of your service account. Can be sourced from `KUBE_TOKEN`. +* `proxy_url` - (Optional) URL to the proxy to be used for all API requests. URLs with "http", "https", and "socks5" schemes are supported. Can be sourced from `KUBE_PROXY_URL`. +* `exec` - (Optional) Configuration block to use an [exec-based credential plugin] (https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), e.g. call an external command to receive user credentials. + * `api_version` - (Required) API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`. + * `command` - (Required) Command to execute. + * `args` - (Optional) List of arguments to pass when executing the plugin. + * `env` - (Optional) Map of environment variables to set when executing the plugin. +* `ignore_annotations` - (Optional) List of Kubernetes metadata annotations to ignore across all resources handled by this provider for situations where external systems are managing certain resource annotations. This option does not affect annotations within a template block. Each item is a regular expression. +* `ignore_labels` - (Optional) List of Kubernetes metadata labels to ignore across all resources handled by this provider for situations where external systems are managing certain resource labels. This option does not affect annotations within a template block. Each item is a regular expression. diff --git a/templates/resources/annotations.md.tmpl b/templates/resources/annotations.md.tmpl new file mode 100644 index 0000000000..3564c36830 --- /dev/null +++ b/templates/resources/annotations.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "manifest" +page_title: "Kubernetes: kubernetes_annotations" +description: |- + This resource allows Terraform to manage the annotations for a resource that already exists +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/annotations/example_1.tf"}} + +## Example Usage: Patching resources which contain a pod template, e.g Deployment, Job + +{{tffile "examples/resources/annotations/example_2.tf"}} + +## Import + +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/templates/resources/api_service.md.tmpl b/templates/resources/api_service.md.tmpl new file mode 100644 index 0000000000..a626522385 --- /dev/null +++ b/templates/resources/api_service.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apiregistration/v1" +page_title: "Kubernetes: kubernetes_api_service" +description: |- + An API Service is an abstraction which defines for locating and communicating with servers. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/api_service/example_1.tf"}} + +## Import + +API service can be imported using its name, e.g. + +``` +$ terraform import kubernetes_api_service.example v1.terraform-name.k8s.io +``` diff --git a/templates/resources/api_service_v1.md.tmpl b/templates/resources/api_service_v1.md.tmpl new file mode 100644 index 0000000000..e1455cf52c --- /dev/null +++ b/templates/resources/api_service_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apiregistration/v1" +page_title: "Kubernetes: kubernetes_api_service_v1" +description: |- + An API Service is an abstraction which defines for locating and communicating with servers. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/api_service_v1/example_1.tf"}} + +## Import + +API service can be imported using its name, e.g. + +``` +$ terraform import kubernetes_api_service_v1.example v1.terraform-name.k8s.io +``` diff --git a/templates/resources/certificate_signing_request.md.tmpl b/templates/resources/certificate_signing_request.md.tmpl new file mode 100644 index 0000000000..502577ce02 --- /dev/null +++ b/templates/resources/certificate_signing_request.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "certificates/v1beta1" +page_title: "Kubernetes: kubernetes_certificate_signing_request" +description: |- + Use this resource to generate TLS certificates using Kubernetes. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/certificate_signing_request/example_1.tf"}} + +## Generating a New Certificate + +Since the certificate is a logical resource that lives only in the Terraform state, it will persist until it is explicitly destroyed by the user. + +In order to force the generation of a new certificate within an existing state, the certificate instance can be "tainted": + +``` +terraform taint kubernetes_certificate_signing_request.example +``` + +A new certificate will then be generated on the next `terraform apply`. diff --git a/templates/resources/certificate_signing_request_v1.md.tmpl b/templates/resources/certificate_signing_request_v1.md.tmpl new file mode 100644 index 0000000000..e5f3f6dba9 --- /dev/null +++ b/templates/resources/certificate_signing_request_v1.md.tmpl @@ -0,0 +1,32 @@ +--- +subcategory: "certificates/v1" +page_title: "Kubernetes: kubernetes_certificate_signing_request_v1" +description: |- + Use this resource to generate TLS certificates using Kubernetes. +--- + +{{/* This template serves as a starting point for documentation generation, and can be customized with hardcoded values and/or doc gen templates. + +For example, the {{ .SchemaMarkdown }} template can be used to replace manual schema documentation if descriptions of schema attributes are added in the provider source code. */ -}} + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/certificate_signing_request_v1/example_1.tf"}} + +## Generating a New Certificate + +Since the certificate is a logical resource that lives only in the Terraform state, it will persist until it is explicitly destroyed by the user. + +In order to force the generation of a new certificate within an existing state, the certificate instance can be "tainted": + +``` +terraform taint kubernetes_certificate_signing_request_v1.example +``` + +A new certificate will then be generated on the next `terraform apply`. diff --git a/templates/resources/cluster_role.md.tmpl b/templates/resources/cluster_role.md.tmpl new file mode 100644 index 0000000000..21eec6653e --- /dev/null +++ b/templates/resources/cluster_role.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role" +description: |- + A ClusterRole creates a role at the cluster level and in all namespaces. +--- + +# {{ .Name }} + +A ClusterRole creates a role at the cluster level and in all namespaces. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/cluster_role/example_1.tf"}} + +## Aggregation Rule Example Usage + +{{tffile "examples/resources/cluster_role/example_2.tf"}} + +## Import + +ClusterRole can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role.example terraform-name +``` diff --git a/templates/resources/cluster_role_binding.md.tmpl b/templates/resources/cluster_role_binding.md.tmpl new file mode 100644 index 0000000000..853dd048bb --- /dev/null +++ b/templates/resources/cluster_role_binding.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role_binding" +description: |- + A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. +--- + +# {{ .Name }} + +A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/cluster_role_binding/example_1.tf"}} + +## Import + +ClusterRoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role_binding.example terraform-name +``` diff --git a/templates/resources/cluster_role_binding_v1.md.tmpl b/templates/resources/cluster_role_binding_v1.md.tmpl new file mode 100644 index 0000000000..d0f0282ce3 --- /dev/null +++ b/templates/resources/cluster_role_binding_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role_binding_v1" +description: |- + A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/cluster_role_binding_v1/example_1.tf"}} + +## Import + +ClusterRoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role_binding_v1.example terraform-name +``` diff --git a/templates/resources/cluster_role_v1.md.tmpl b/templates/resources/cluster_role_v1.md.tmpl new file mode 100644 index 0000000000..25796544ae --- /dev/null +++ b/templates/resources/cluster_role_v1.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_cluster_role_v1" +description: |- + A ClusterRole creates a role at the cluster level and in all namespaces. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/cluster_role_v1/example_1.tf"}} + +## Aggregation Rule Example Usage + +{{tffile "examples/resources/cluster_role_v1/example_2.tf"}} + +## Import + +ClusterRole can be imported using the name, e.g. + +``` +$ terraform import kubernetes_cluster_role_v1.example terraform-name +``` diff --git a/templates/resources/config_map.md.tmpl b/templates/resources/config_map.md.tmpl new file mode 100644 index 0000000000..71bcb9199f --- /dev/null +++ b/templates/resources/config_map.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map" +description: |- + The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. +--- + +# {{ .Name }} + +The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/config_map/example_1.tf"}} + +## Import + +Config Map can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_config_map.example default/my-config +``` diff --git a/templates/resources/config_map_v1.md.tmpl b/templates/resources/config_map_v1.md.tmpl new file mode 100644 index 0000000000..e1811cfd07 --- /dev/null +++ b/templates/resources/config_map_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map_v1" +description: |- + The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/config_map_v1/example_1.tf"}} + +## Import + +Config Map can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_config_map_v1.example default/my-config +``` diff --git a/templates/resources/config_map_v1_data.md.tmpl b/templates/resources/config_map_v1_data.md.tmpl new file mode 100644 index 0000000000..4197f6713c --- /dev/null +++ b/templates/resources/config_map_v1_data.md.tmpl @@ -0,0 +1,20 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_config_map_v1_data" +description: |- + This resource allows Terraform to manage the data for a ConfigMap that already exists +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/config_map_v1_data/example_1.tf"}} + +## Import + +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/templates/resources/cron_job.md.tmpl b/templates/resources/cron_job.md.tmpl new file mode 100644 index 0000000000..50fb324408 --- /dev/null +++ b/templates/resources/cron_job.md.tmpl @@ -0,0 +1,29 @@ +--- +subcategory: "batch/v1beta1" +page_title: "Kubernetes: kubernetes_cron_job" +description: |- + A Cron Job creates Jobs on a time-based schedule. One CronJob object is like one line of a crontab (cron table) file. +--- + +# {{ .Name }} + +A Cron Job creates Jobs on a time-based schedule. + +One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format. + +Note: All CronJob `schedule` times are based on the timezone of the master where the job is initiated. For instructions on creating and working with cron jobs, and for an example of a spec file for a cron job, see [Kubernetes reference](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/). + +~> NOTE: With the release of Kubernetes v1.25, CronJob batch/v1beta1 has been removed. You can read more information about migrating to batch/v1 in the [Kubernetes 1.25 migration guide](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#cronjob-v125). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/cron_job/example_1.tf"}} + + +## Import + +``` +$ terraform import kubernetes_corn_job_v1/example default/example +``` \ No newline at end of file diff --git a/templates/resources/cron_job_v1.md.tmpl b/templates/resources/cron_job_v1.md.tmpl new file mode 100644 index 0000000000..b4ecc2b162 --- /dev/null +++ b/templates/resources/cron_job_v1.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "batch/v1" +page_title: "Kubernetes: kubernetes_cron_job_v1" +description: |- + A Cron Job creates Jobs on a time-based schedule. One CronJob object is like one line of a crontab (cron table) file. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/cron_job_v1/example_1.tf"}} diff --git a/templates/resources/csi_driver.md.tmpl b/templates/resources/csi_driver.md.tmpl new file mode 100644 index 0000000000..0a0bc3652f --- /dev/null +++ b/templates/resources/csi_driver.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "storage/v1beta1" +page_title: "Kubernetes: kubernetes_csi_driver" +description: |- + The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. +--- + +# {{ .Name }} + +The [Container Storage Interface](https://kubernetes-csi.github.io/docs/introduction.html) (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/csi_driver/example_1.tf"}} + +## Import + +kubernetes_csi_driver can be imported using its name, e.g. + +``` +$ terraform import kubernetes_csi_driver.example terraform-example +``` diff --git a/templates/resources/csi_driver_v1.md.tmpl b/templates/resources/csi_driver_v1.md.tmpl new file mode 100644 index 0000000000..1728d5289a --- /dev/null +++ b/templates/resources/csi_driver_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_csi_driver_v1" +description: |- + The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/csi_driver_v1/example_1.tf"}} + +## Import + +kubernetes_csi_driver_v1 can be imported using its name, e.g. + +``` +$ terraform import kubernetes_csi_driver_v1.example terraform-example +``` diff --git a/templates/resources/daemon_set_v1.md.tmpl b/templates/resources/daemon_set_v1.md.tmpl new file mode 100644 index 0000000000..9adb56a5d3 --- /dev/null +++ b/templates/resources/daemon_set_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_daemon_set_v1" +description: |- + A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/daemon_set_v1/example_1.tf"}} + +## Import + +DaemonSet can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_daemon_set_v1.example default/terraform-example +``` diff --git a/templates/resources/daemonset.md.tmpl b/templates/resources/daemonset.md.tmpl new file mode 100644 index 0000000000..102b5020a9 --- /dev/null +++ b/templates/resources/daemonset.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_daemonset" +description: |- + A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. +--- + +# {{ .Name }} + +A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/daemonset/example_1.tf"}} + +## Import + +DaemonSet can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_daemonset.example default/terraform-example +``` diff --git a/templates/resources/default_service_account.md.tmpl b/templates/resources/default_service_account.md.tmpl new file mode 100644 index 0000000000..7e0ea4de38 --- /dev/null +++ b/templates/resources/default_service_account.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_default_service_account" +description: |- + The default service account resource configures the default service account created by Kubernetes in each namespace. +--- + +# {{ .Name }} + +Kubernetes creates a "default" service account in each namespace. This is the service account that will be assigned by default to pods in the namespace. + +The `kubernetes_default_service_account` resource behaves differently from normal resources. The service account is created by a Kubernetes controller and Terraform "adopts" it into management. This resource should only be used once per namespace. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/default_service_account/example_1.tf"}} + +## Import + +The default service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_default_service_account.example terraform-example/default +``` diff --git a/templates/resources/default_service_account_v1.md.tmpl b/templates/resources/default_service_account_v1.md.tmpl new file mode 100644 index 0000000000..f302535ac4 --- /dev/null +++ b/templates/resources/default_service_account_v1.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_default_service_account_v1" +description: |- + The default service account resource configures the default service account created by Kubernetes in each namespace. +--- + +# {{ .Name }} + +Kubernetes creates a "default" service account in each namespace. This is the service account that will be assigned by default to pods in the namespace. + +The `kubernetes_default_service_account_v1` resource behaves differently from normal resources. The service account is created by a Kubernetes controller and Terraform "adopts" it into management. This resource should only be used once per namespace. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/default_service_account_v1/example_1.tf"}} + +## Import + +The default service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_default_service_account_v1.example terraform-example/default +``` diff --git a/templates/resources/deployment.md.tmpl b/templates/resources/deployment.md.tmpl new file mode 100644 index 0000000000..330074f8b3 --- /dev/null +++ b/templates/resources/deployment.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_deployment" +description: |- + A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. +--- + +# {{ .Name }} + +A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/deployment/example_1.tf"}} + +## Import + +Deployment can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_deployment.example default/terraform-example +``` diff --git a/templates/resources/deployment_v1.md.tmpl b/templates/resources/deployment_v1.md.tmpl new file mode 100644 index 0000000000..9418f19e5d --- /dev/null +++ b/templates/resources/deployment_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_deployment_v1" +description: |- + A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/deployment_v1/example_1.tf"}} + +## Import + +Deployment can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_deployment_v1.example default/terraform-example +``` diff --git a/templates/resources/endpoint_slice_v1.md.tmpl b/templates/resources/endpoint_slice_v1.md.tmpl new file mode 100644 index 0000000000..6fc46df99b --- /dev/null +++ b/templates/resources/endpoint_slice_v1.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "discovery/v1" +page_title: "Kubernetes: kubernetes_endpoint_slice_v1" +description: |- + An EndpointSlice contains references to a set of network endpoints. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/endpoint_slice_v1/example_1.tf"}} + diff --git a/templates/resources/endpoints.md.tmpl b/templates/resources/endpoints.md.tmpl new file mode 100644 index 0000000000..c922147ee7 --- /dev/null +++ b/templates/resources/endpoints.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_endpoints" +description: |- + An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. +--- + +# {{ .Name }} + +An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/endpoints/example_1.tf"}} + +## Import + +An Endpoints resource can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_endpoints.example default/terraform-name +``` diff --git a/templates/resources/endpoints_v1.md.tmpl b/templates/resources/endpoints_v1.md.tmpl new file mode 100644 index 0000000000..6c9b71b0b8 --- /dev/null +++ b/templates/resources/endpoints_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_endpoints_v1" +description: |- + An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/endpoints_v1/example_1.tf"}} + +## Import + +An Endpoints resource can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_endpoints_v1.example default/terraform-name +``` diff --git a/templates/resources/env.md.tmpl b/templates/resources/env.md.tmpl new file mode 100644 index 0000000000..f214a05d1a --- /dev/null +++ b/templates/resources/env.md.tmpl @@ -0,0 +1,20 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_env" +description: |- + This resource provides a way to manage environment variables in resources that were created outside of Terraform. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/env/example_1.tf"}} + +## Import + +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/templates/resources/horizontal_pod_autoscaler.md.tmpl b/templates/resources/horizontal_pod_autoscaler.md.tmpl new file mode 100644 index 0000000000..66f677b99d --- /dev/null +++ b/templates/resources/horizontal_pod_autoscaler.md.tmpl @@ -0,0 +1,40 @@ +--- +subcategory: "autoscaling/v1" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/horizontal_pod_autoscaler/example_1.tf"}} + +## Example Usage, with `metric` + +{{tffile "examples/resources/horizontal_pod_autoscaler/example_2.tf"}} + +## Example Usage, with `behavior` + +{{tffile "examples/resources/horizontal_pod_autoscaler/example_3.tf"}} + +## Support for multiple and custom metrics + +The provider currently supports two version of the HorizontalPodAutoscaler API resource. + +If you wish to use `autoscaling/v1` use the `target_cpu_utilization_percentage` field. + +If you wish to use `autoscaling/v2beta2` then set one or more `metric` fields. + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler.example default/terraform-example +``` diff --git a/templates/resources/horizontal_pod_autoscaler_v1.md.tmpl b/templates/resources/horizontal_pod_autoscaler_v1.md.tmpl new file mode 100644 index 0000000000..a1acace1d1 --- /dev/null +++ b/templates/resources/horizontal_pod_autoscaler_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "autoscaling/v1" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v1" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/horizontal_pod_autoscaler_v1/example_1.tf"}} + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler_v1.example default/terraform-example +``` diff --git a/templates/resources/horizontal_pod_autoscaler_v2.md.tmpl b/templates/resources/horizontal_pod_autoscaler_v2.md.tmpl new file mode 100644 index 0000000000..9b0e99a0aa --- /dev/null +++ b/templates/resources/horizontal_pod_autoscaler_v2.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "autoscaling/v2" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v2" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage, with `metric` + +{{tffile "examples/resources/horizontal_pod_autoscaler_v2/example_1.tf"}} + +## Example Usage, with `behavior` + +{{tffile "examples/resources/horizontal_pod_autoscaler_v2/example_2.tf"}} + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler_v2.example default/terraform-example +``` diff --git a/templates/resources/horizontal_pod_autoscaler_v2beta2.md.tmpl b/templates/resources/horizontal_pod_autoscaler_v2beta2.md.tmpl new file mode 100644 index 0000000000..e96ee0abeb --- /dev/null +++ b/templates/resources/horizontal_pod_autoscaler_v2beta2.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "autoscaling/v2beta2" +page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v2beta2" +description: |- + Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage, with `metric` + +{{tffile "examples/resources/horizontal_pod_autoscaler_v2beta2/example_1.tf"}} + +## Example Usage, with `behavior` + +{{tffile "examples/resources/horizontal_pod_autoscaler_v2beta2/example_2.tf"}} + +## Import + +Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_horizontal_pod_autoscaler_v2beta2.example default/terraform-example +``` diff --git a/templates/resources/ingress.md.tmpl b/templates/resources/ingress.md.tmpl new file mode 100644 index 0000000000..527a58dcd3 --- /dev/null +++ b/templates/resources/ingress.md.tmpl @@ -0,0 +1,34 @@ +--- +subcategory: "extensions/v1beta1" +page_title: "Kubernetes: kubernetes_ingress" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# {{ .Name }} + +Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/ingress/example_1.tf"}} + +## Example using Nginx ingress controller + +{{tffile "examples/resources/ingress/example_2.tf"}} + +## Import + +Ingress can be imported using its namespace and name: + +``` +terraform import kubernetes_ingress. / +``` + +e.g. + +``` +$ terraform import kubernetes_ingress.example default/terraform-name +``` diff --git a/templates/resources/ingress_class.md.tmpl b/templates/resources/ingress_class.md.tmpl new file mode 100644 index 0000000000..dd4cbac2d8 --- /dev/null +++ b/templates/resources/ingress_class.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_class" +description: |- + Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. +--- + +# {{ .Name }} + +Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/ingress_class/example_1.tf"}} + +## Import + +Ingress Classes can be imported using its name, e.g: + +``` +$ terraform import kubernetes_ingress_class.example example +``` diff --git a/templates/resources/ingress_class_v1.md.tmpl b/templates/resources/ingress_class_v1.md.tmpl new file mode 100644 index 0000000000..c6369e5eff --- /dev/null +++ b/templates/resources/ingress_class_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_class_v1" +description: |- + Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/ingress_class_v1/example_1.tf"}} + +## Import + +Ingress Classes can be imported using its name, e.g: + +``` +$ terraform import kubernetes_ingress_class_v1.example example +``` diff --git a/templates/resources/ingress_v1.md.tmpl b/templates/resources/ingress_v1.md.tmpl new file mode 100644 index 0000000000..bfe669210c --- /dev/null +++ b/templates/resources/ingress_v1.md.tmpl @@ -0,0 +1,34 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_ingress_v1" +description: |- + Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/ingress_v1/example_1.tf"}} + +## Example using Nginx ingress controller + +{{tffile "examples/resources/ingress_v1/example_2.tf"}} + +## Import + +Ingress can be imported using its namespace and name: + +``` +terraform import kubernetes_ingress_v1. / +``` + +e.g. + +``` +$ terraform import kubernetes_ingress_v1.example default/terraform-name +``` diff --git a/templates/resources/job.md.tmpl b/templates/resources/job.md.tmpl new file mode 100644 index 0000000000..895dd1d9de --- /dev/null +++ b/templates/resources/job.md.tmpl @@ -0,0 +1,29 @@ +--- +subcategory: "batch/v1" +page_title: "Kubernetes: kubernetes_job" +description: |- + A Job creates one or more Pods and ensures that a specified number of them successfully terminate. You can also use a Job to run multiple Pods in parallel. +--- + +# {{ .Name }} + +A Job creates one or more Pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. + +A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot. + +You can also use a Job to run multiple Pods in parallel. + +{{ .SchemaMarkdown }} + +## Example Usage - No waiting + +{{tffile "examples/resources/job/example_1.tf"}} + +## Example Usage - waiting for job successful completion + +{{tffile "examples/resources/job/example_2.tf"}} + +Note: + +- Kubernetes provider will treat update operations that change the Job spec resulting in the job re-run as "# forces replacement". In such cases, the `create` timeout value is used for both Create and Update operations. +- `wait_for_completion` is not applicable during Delete operations; thus, there is no "delete" timeout value for Delete operation. diff --git a/templates/resources/job_v1.md.tmpl b/templates/resources/job_v1.md.tmpl new file mode 100644 index 0000000000..64cda1386b --- /dev/null +++ b/templates/resources/job_v1.md.tmpl @@ -0,0 +1,25 @@ +--- +subcategory: "batch/v1" +page_title: "Kubernetes: kubernetes_job_v1" +description: |- + A Job creates one or more Pods and ensures that a specified number of them successfully terminate. You can also use a Job to run multiple Pods in parallel. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage - No waiting + +{{tffile "examples/resources/job_v1/example_1.tf"}} + +## Example Usage - waiting for job successful completion + +{{tffile "examples/resources/job_v1/example_2.tf"}} + +Note: + +- Kubernetes provider will treat update operations that change the Job spec resulting in the job re-run as "# forces replacement". In such cases, the `create` timeout value is used for both Create and Update operations. +- `wait_for_completion` is not applicable during Delete operations; thus, there is no "delete" timeout value for Delete operation. diff --git a/templates/resources/labels.md.tmpl b/templates/resources/labels.md.tmpl new file mode 100644 index 0000000000..75b240f08e --- /dev/null +++ b/templates/resources/labels.md.tmpl @@ -0,0 +1,20 @@ +--- +subcategory: "manifest" +page_title: "Kubernetes: kubernetes_labels" +description: |- + This resource allows Terraform to manage the labels for a resource that already exists +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/labels/example_1.tf"}} + +## Import + +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/templates/resources/limit_range.md.tmpl b/templates/resources/limit_range.md.tmpl new file mode 100644 index 0000000000..a5c5e27bbc --- /dev/null +++ b/templates/resources/limit_range.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_limit_range" +description: |- + Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. +--- + +# {{ .Name }} + +Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. + +Read more in [the official docs](https://kubernetes.io/docs/concepts/policy/limit-range/). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/limit_range/example_1.tf"}} + +## Import + +Limit Range can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_limit_range.example default/terraform-example +``` diff --git a/templates/resources/limit_range_v1.md.tmpl b/templates/resources/limit_range_v1.md.tmpl new file mode 100644 index 0000000000..2665b6a67a --- /dev/null +++ b/templates/resources/limit_range_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_limit_range_v1" +description: |- + Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/limit_range_v1/example_1.tf"}} + +## Import + +Limit Range can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_limit_range_v1.example default/terraform-example +``` diff --git a/templates/resources/manifest.md.tmpl b/templates/resources/manifest.md.tmpl new file mode 100644 index 0000000000..be81f49967 --- /dev/null +++ b/templates/resources/manifest.md.tmpl @@ -0,0 +1,117 @@ +--- +subcategory: "manifest" +page_title: "Kubernetes: kubernetes_manifest" +description: |- + The resource provides a way to create and manage custom resources +--- + +# {{ .Name }} + +Represents one Kubernetes resource by supplying a `manifest` attribute. The manifest value is the HCL representation of a Kubernetes YAML manifest. To convert an existing manifest from YAML to HCL, you can use the Terraform built-in function [`yamldecode()`](https://www.terraform.io/docs/configuration/functions/yamldecode.html) or [tfk8s](https://github.com/jrhouston/tfk8s). + +Once applied, the `object` attribute contains the state of the resource as returned by the Kubernetes API, including all default values. + +~> A minimum Terraform version of 0.14.8 is required to use this resource. + +{{ .SchemaMarkdown }} + +### Before you use this resource + +- This resource requires API access during planning time. This means the cluster has to be accessible at plan time and thus cannot be created in the same apply operation. We recommend only using this resource for custom resources or resources not yet fully supported by the provider. + +- This resource uses [Server-side Apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to carry out apply operations. A minimum Kubernetes version of 1.16.x is required, but versions 1.17+ are strongly recommended as the SSA implementation in Kubernetes 1.16.x is incomplete and unstable. + +### Example: Create a Kubernetes ConfigMap + +{{tffile "examples/resources/manifest/example_1.tf"}} + +### Example: Create a Kubernetes Custom Resource Definition + +{{tffile "examples/resources/manifest/example_2.tf"}} + +## Importing existing Kubernetes resources as `kubernetes_manifest` + +Objects already present in a Kubernetes cluster can be imported into Terraform to be managed as `kubernetes_manifest` resources. Follow these steps to import a resource: + +### Extract the resource from Kubernetes and transform it into Terraform configuration + +``` +kubectl get secrets sample -o yaml | tfk8s --strip -o sample.tf +``` + +### Import the resource state from the cluster + +``` +terraform import kubernetes_manifest.secret_sample "apiVersion=v1,kind=Secret,namespace=default,name=sample" +``` + +Note the import ID as the last argument to the import command. This ID points Terraform at which Kubernetes object to read when importing. It should be constructed with the following syntax: `"apiVersion=,kind=,[namespace=,]name="`. The `namespace=` in the ID string is required only for Kubernetes namespaced objects and should be omitted for cluster-wide objects. + +## Using `wait` to block create and update calls + +The `kubernetes_manifest` resource supports the ability to block create and update calls until a field is set or has a particular value by specifying the `wait` block. This is useful for when you create resources like Jobs and Services when you want to wait for something to happen after the resource is created by the API server before Terraform should consider the resource created. + +`wait` supports supports a `fields` attribute which allows you specify a map of fields paths to regular expressions. You can also specify `*` if you just want to wait for a field to have any value. + +{{tffile "examples/resources/manifest/example_3.tf"}} + +The `wait` block also supports a `rollout` attribute which will wait for rollout to complete on Deployment, StatefulSet, and DaemonSet resources. + +{{tffile "examples/resources/manifest/example_4.tf"}} + +You can also wait for specified conditions to be met by specifying a `condition` block. + +{{tffile "examples/resources/manifest/example_5.tf"}} + +## Configuring `field_manager` + +The `kubernetes_manifest` exposes configuration of the field manager through the optional `field_manager` block. + +{{tffile "examples/resources/manifest/example_6.tf"}} + +## Computed fields + +When setting the value of an field in configuration, Terraform will check that the same value is returned after the apply operation. This ensures that the actual configuration requested by the user is successfully applied. In some cases, with the Kubernetes API this is not the desired behavior. Particularly when using mutating admission controllers, there is a chance that the values configured by the user will be modified by the API. This usually manifest as `Error: Provider produced inconsistent result after apply` and `produced an unexpected new value:` messages when applying. + +To accommodate this, the `kubernetes_manifest` resources allows defining so-called "computed" fields. When an field is defined as "computed" Terraform will allow the final value stored in state after `apply` as returned by the API to be different than what the user requested. + +The most common example of this is `metadata.annotations`. In some cases, the API will add extra annotations on top of the ones configured by the user. Unless the field is declared as "computed" Terraform will throw an error signaling that the state returned by the 'apply' operation is inconsistent with the value defined in the 'plan'. + +To declare an field as "computed" add its full field path to the `computed_fields` field under the respective `kubernetes_manifest` resource. For example, to declare the "metadata.labels" field as "computed", add the following: + +``` +resource "kubernetes_manifest" "test-ns" { + manifest = { + ... + } + + computed_fields = ["metadata.labels"] + } +``` + +**IMPORTANT**: By default, `metadata.labels` and `metadata.annotations` are already included in the list. You don't have to set them explicitly in the `computed_fields` list. To turn off these defaults, set the value of `computed_fields` to an empty list or a concrete list of other fields. For example `computed_fields = []`. + +The syntax for the field paths is the same as the one used in the `wait` block. + +A field path is a string that describes the fully qualified address of a field within the resource, including its parent fields all the way up to "object". The syntax of a path string follows the rules below: + +- Fields of objects are addressed with `.` +- Keys of a map field are addressed with `[""]` +- Elements of a list or tuple field are addressed with `[]` + + The following example waits for Kubernetes to create a ServiceAccount token in a Secret, where the `data` field of the Secret is a map. + + ```hcl + wait { + fields = { + "data[\"token\"]" = ".+" + } + } + ``` + + You can use the [`type()`](https://developer.hashicorp.com/terraform/language/functions/type) Terraform function to determine the type of a field. With the resource created and present in state, run `terraform console` and then the following command: + + ```hcl + > type(kubernetes_manifest.my-secret.object.data) + map(string) + ``` diff --git a/templates/resources/mutating_webhook_configuration.md.tmpl b/templates/resources/mutating_webhook_configuration.md.tmpl new file mode 100644 index 0000000000..eed3aa2e14 --- /dev/null +++ b/templates/resources/mutating_webhook_configuration.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "admissionregistration/v1beta1" +page_title: "Kubernetes: kubernetes_mutating_webhook_configuration" +description: |- + Mutating Webhook Configuration configures a mutating admission webhook +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/mutating_webhook_configuration/example_1.tf"}} + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +## Import + +Mutating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_mutating_webhook_configuration.example terraform-example +``` diff --git a/templates/resources/mutating_webhook_configuration_v1.md.tmpl b/templates/resources/mutating_webhook_configuration_v1.md.tmpl new file mode 100644 index 0000000000..002085f6cb --- /dev/null +++ b/templates/resources/mutating_webhook_configuration_v1.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "admissionregistration/v1" +page_title: "Kubernetes: kubernetes_mutating_webhook_configuration_v1" +description: |- + Mutating Webhook Configuration configures a mutating admission webhook +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/mutating_webhook_configuration_v1/example_1.tf"}} + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +## Import + +Mutating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_mutating_webhook_configuration_v1.example terraform-example +``` diff --git a/templates/resources/namespace.md.tmpl b/templates/resources/namespace.md.tmpl new file mode 100644 index 0000000000..4b545b941c --- /dev/null +++ b/templates/resources/namespace.md.tmpl @@ -0,0 +1,30 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_namespace" +description: |- + Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. +--- + +# {{ .Name }} + +Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. Read more about namespaces at [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/namespace/example_1.tf"}} + +### Timeouts + +`kubernetes_namespace` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `delete` - Default `5 minutes` + +## Import + +Namespaces can be imported using their name, e.g. + +``` +$ terraform import kubernetes_namespace.n terraform-example-namespace +``` diff --git a/templates/resources/namespace_v1.md.tmpl b/templates/resources/namespace_v1.md.tmpl new file mode 100644 index 0000000000..b5650ab4b6 --- /dev/null +++ b/templates/resources/namespace_v1.md.tmpl @@ -0,0 +1,30 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_namespace_v1" +description: |- + Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/namespace_v1/example_1.tf"}} + +### Timeouts + +`kubernetes_namespace_v1` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `delete` - Default `5 minutes` + +## Import + +Namespaces can be imported using their name, e.g. + +``` +$ terraform import kubernetes_namespace_v1.n terraform-example-namespace +``` diff --git a/templates/resources/network_policy.md.tmpl b/templates/resources/network_policy.md.tmpl new file mode 100644 index 0000000000..e440cb7eaf --- /dev/null +++ b/templates/resources/network_policy.md.tmpl @@ -0,0 +1,25 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_network_policy" +description: |- + Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. + NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. +--- + +# {{ .Name }} + +Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. Read more about network policies at https://kubernetes.io/docs/concepts/services-networking/network-policies/ + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/network_policy/example_1.tf"}} + +## Import + +Network policies can be imported using their identifier consisting of `/`, e.g.: + +``` +$ terraform import kubernetes_network_policy.example default/terraform-example-network-policy +``` diff --git a/templates/resources/network_policy_v1.md.tmpl b/templates/resources/network_policy_v1.md.tmpl new file mode 100644 index 0000000000..5174d1635b --- /dev/null +++ b/templates/resources/network_policy_v1.md.tmpl @@ -0,0 +1,25 @@ +--- +subcategory: "networking/v1" +page_title: "Kubernetes: kubernetes_network_policy_v1" +description: |- + Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. + NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/network_policy_v1/example_1.tf"}} + +## Import + +Network policies can be imported using their identifier consisting of `/`, e.g.: + +``` +$ terraform import kubernetes_network_policy_v1.example default/terraform-example-network-policy +``` diff --git a/templates/resources/node_taint.md.tmpl b/templates/resources/node_taint.md.tmpl new file mode 100644 index 0000000000..e800ea7b5c --- /dev/null +++ b/templates/resources/node_taint.md.tmpl @@ -0,0 +1,20 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_node_taint" +description: |- + A Node Taint is an anti-affinity rule allowing a Kubernetes node to repel a set of pods. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/node_taint/example_1.tf"}} + +## Import + +This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/templates/resources/persistent_volume.md.tmpl b/templates/resources/persistent_volume.md.tmpl new file mode 100644 index 0000000000..b7562a8103 --- /dev/null +++ b/templates/resources/persistent_volume.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume" +description: |- + A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. +--- + +# {{ .Name }} + +The resource provides a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/persistent_volume/example_1.tf"}} + +## Example: Persistent Volume using Azure Managed Disk + +{{tffile "examples/resources/persistent_volume/example_2.tf"}} + +## Import + +Persistent Volume can be imported using its name, e.g. + +``` +$ terraform import kubernetes_persistent_volume.example terraform-example +``` diff --git a/templates/resources/persistent_volume_claim.md.tmpl b/templates/resources/persistent_volume_claim.md.tmpl new file mode 100644 index 0000000000..ab46dfb9fd --- /dev/null +++ b/templates/resources/persistent_volume_claim.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim" +description: |- + This resource allows the user to request for and claim to a persistent volume. +--- + +# {{ .Name }} + +This resource allows the user to request for and claim to a persistent volume. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/persistent_volume_claim/example_1.tf"}} + +##Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim.example default/example-name +``` diff --git a/templates/resources/persistent_volume_claim_v1.md.tmpl b/templates/resources/persistent_volume_claim_v1.md.tmpl new file mode 100644 index 0000000000..531fa32609 --- /dev/null +++ b/templates/resources/persistent_volume_claim_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_claim_v1" +description: |- + This resource allows the user to request for and claim to a persistent volume. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/persistent_volume_claim_v1/example_1.tf"}} + +## Import + +Persistent Volume Claim can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_claim_v1.example default/example-name +``` diff --git a/templates/resources/persistent_volume_v1.md.tmpl b/templates/resources/persistent_volume_v1.md.tmpl new file mode 100644 index 0000000000..4bd19acdcd --- /dev/null +++ b/templates/resources/persistent_volume_v1.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_persistent_volume_v1" +description: |- + A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/persistent_volume_v1/example_1.tf"}} + +## Example: Persistent Volume using Azure Managed Disk + +{{tffile "examples/resources/persistent_volume_v1/example_2.tf"}} + +## Import + +Persistent Volume can be imported using its name, e.g. + +``` +$ terraform import kubernetes_persistent_volume_v1.example terraform-example +``` diff --git a/templates/resources/pod.md.tmpl b/templates/resources/pod.md.tmpl new file mode 100644 index 0000000000..8283c9d040 --- /dev/null +++ b/templates/resources/pod.md.tmpl @@ -0,0 +1,34 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# {{ .Name }} + +A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. + +Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/pod/example_1.tf"}} + +terraform version of the [pods/pod-with-node-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml) example. + +{{tffile "examples/resources/pod/example_2.tf"}} + +terraform version of the [pods/pod-with-pod-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-pod-affinity.yaml) example. + +{{tffile "examples/resources/pod/example_3.tf"}} + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod.example default/terraform-example +``` diff --git a/templates/resources/pod_disruption_budget.md.tmpl b/templates/resources/pod_disruption_budget.md.tmpl new file mode 100644 index 0000000000..b2396123cd --- /dev/null +++ b/templates/resources/pod_disruption_budget.md.tmpl @@ -0,0 +1,16 @@ +--- +subcategory: "policy/v1beta1" +page_title: "Kubernetes: kubernetes_pod_disruption_budget" +description: |- + A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/pod_disruption_budget/example_1.tf"}} diff --git a/templates/resources/pod_disruption_budget_v1.md.tmpl b/templates/resources/pod_disruption_budget_v1.md.tmpl new file mode 100644 index 0000000000..5f27f6637d --- /dev/null +++ b/templates/resources/pod_disruption_budget_v1.md.tmpl @@ -0,0 +1,18 @@ +--- +subcategory: "policy/v1" +page_title: "Kubernetes: kubernetes_pod_disruption_budget_v1" +description: |- + A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/pod_disruption_budget_v1/example_1.tf"}} + + diff --git a/templates/resources/pod_security_policy.md.tmpl b/templates/resources/pod_security_policy.md.tmpl new file mode 100644 index 0000000000..aeb59bd85f --- /dev/null +++ b/templates/resources/pod_security_policy.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "policy/v1beta1" +page_title: "Kubernetes: kubernetes_pod_security_policy" +description: |- + A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. +--- + +# {{ .Name }} + +A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields. + +{{ .SchemaMarkdown }} + +~> NOTE: With the release of Kubernetes v1.25, PodSecurityPolicy has been removed. You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes). + +## Example Usage + +{{tffile "examples/resources/pod_security_policy/example_1.tf"}} + +## Import + +Pod Security Policy can be imported using its name, e.g. + +``` +$ terraform import kubernetes_pod_security_policy.example terraform-example +``` diff --git a/templates/resources/pod_security_policy_v1beta1.md.tmpl b/templates/resources/pod_security_policy_v1beta1.md.tmpl new file mode 100644 index 0000000000..c6ad622307 --- /dev/null +++ b/templates/resources/pod_security_policy_v1beta1.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "policy/v1beta1" +page_title: "Kubernetes: kubernetes_pod_security_policy_v1beta1" +description: |- + A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +~> NOTE: With the release of Kubernetes v1.25, PodSecurityPolicy has been removed. You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes). + +## Example Usage + +{{tffile "examples/resources/pod_security_policy_v1beta1/example_1.tf"}} + +## Import + +Pod Security Policy can be imported using its name, e.g. + +``` +$ terraform import kubernetes_pod_security_policy_v1beta1.example terraform-example +``` diff --git a/templates/resources/pod_v1.md.tmpl b/templates/resources/pod_v1.md.tmpl new file mode 100644 index 0000000000..173d02c2a4 --- /dev/null +++ b/templates/resources/pod_v1.md.tmpl @@ -0,0 +1,32 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_pod_v1" +description: |- + A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/pod_v1/example_1.tf"}} + +terraform version of the [pods/pod-with-node-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml) example. + +{{tffile "examples/resources/pod_v1/example_2.tf"}} + +terraform version of the [pods/pod-with-pod-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-pod-affinity.yaml) example. + +{{tffile "examples/resources/pod_v1/example_3.tf"}} + +## Import + +Pod can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_pod_v1.example default/terraform-example +``` diff --git a/templates/resources/priority_class.md.tmpl b/templates/resources/priority_class.md.tmpl new file mode 100644 index 0000000000..cac93c9730 --- /dev/null +++ b/templates/resources/priority_class.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "scheduling/v1" +page_title: "Kubernetes: kubernetes_priority_class" +description: |- + A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. +--- + +# {{ .Name }} + +A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/priority_class/example_1.tf"}} + +## Import + +Priority Class can be imported using its name, e.g. + +``` +$ terraform import kubernetes_priority_class.example terraform-example +``` diff --git a/templates/resources/priority_class_v1.md.tmpl b/templates/resources/priority_class_v1.md.tmpl new file mode 100644 index 0000000000..9989f7a9c5 --- /dev/null +++ b/templates/resources/priority_class_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "scheduling/v1" +page_title: "Kubernetes: kubernetes_priority_class_v1" +description: |- + A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/priority_class_v1/example_1.tf"}} + +## Import + +Priority Class can be imported using its name, e.g. + +``` +$ terraform import kubernetes_priority_class_v1.example terraform-example +``` diff --git a/templates/resources/replication_controller.md.tmpl b/templates/resources/replication_controller.md.tmpl new file mode 100644 index 0000000000..34ca296e7b --- /dev/null +++ b/templates/resources/replication_controller.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_replication_controller" +description: |- + A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. +--- + +# {{ .Name }} + +A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. + +~> **WARNING:** In many cases it is recommended to create a Deployment instead of a Replication Controller. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/replication_controller/example_1.tf"}} + +## Import + +Replication Controller can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_replication_controller.example default/terraform-example +``` + +~> **NOTE:** Imported `kubernetes_replication_controller` resource will only have their fields from the `spec.template.spec` block in the state. Deprecated fields at the `spec.template` level are not updated during import. Configurations using the deprecated fields should be updated to only use the new fields under `spec.template.spec`. diff --git a/templates/resources/replication_controller_v1.md.tmpl b/templates/resources/replication_controller_v1.md.tmpl new file mode 100644 index 0000000000..3406346260 --- /dev/null +++ b/templates/resources/replication_controller_v1.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_replication_controller_v1" +description: |- + A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +~> **WARNING:** In many cases it is recommended to create a Deployment instead of a Replication Controller. + +## Example Usage + +{{tffile "examples/resources/replication_controller_v1/example_1.tf"}} + +## Import + +Replication Controller can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_replication_controller_v1.example default/terraform-example +``` + +~> **NOTE:** Imported `kubernetes_replication_controller_v1` resource will only have their fields from the `spec.template.spec` block in the state. Deprecated fields at the `spec.template` level are not updated during import. Configurations using the deprecated fields should be updated to only use the new fields under `spec.template.spec`. diff --git a/templates/resources/resource_quota.md.tmpl b/templates/resources/resource_quota.md.tmpl new file mode 100644 index 0000000000..76c17c03e4 --- /dev/null +++ b/templates/resources/resource_quota.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_resource_quota" +description: |- + A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. +--- + +# {{ .Name }} + +A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/resource_quota/example_1.tf"}} + +## Import + +Resource Quota can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_resource_quota.example default/terraform-example +``` diff --git a/templates/resources/resource_quota_v1.md.tmpl b/templates/resources/resource_quota_v1.md.tmpl new file mode 100644 index 0000000000..adc18044af --- /dev/null +++ b/templates/resources/resource_quota_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_resource_quota_v1" +description: |- + A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/resource_quota_v1/example_1.tf"}} + +## Import + +Resource Quota can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_resource_quota_v1.example default/terraform-example +``` diff --git a/templates/resources/role.md.tmpl b/templates/resources/role.md.tmpl new file mode 100644 index 0000000000..78cd7b87bb --- /dev/null +++ b/templates/resources/role.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role" +description: |- + A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). +--- + +# {{ .Name }} + +A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/role/example_1.tf"}} + +## Import + +Role can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_role.example default/terraform-example +``` diff --git a/templates/resources/role_binding.md.tmpl b/templates/resources/role_binding.md.tmpl new file mode 100644 index 0000000000..9b064dfb28 --- /dev/null +++ b/templates/resources/role_binding.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role_binding" +description: |- + A RoleBinding may be used to grant permission at the namespace level. +--- + +# {{ .Name }} + +{{ .SchemaMarkdown }} + +A RoleBinding may be used to grant permission at the namespace level + +## Example Usage + +{{tffile "examples/resources/role_binding/example_1.tf"}} + +## Import + +RoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_role_binding.example default/terraform-name +``` diff --git a/templates/resources/role_binding_v1.md.tmpl b/templates/resources/role_binding_v1.md.tmpl new file mode 100644 index 0000000000..2830a35e14 --- /dev/null +++ b/templates/resources/role_binding_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role_binding_v1" +description: |- + A RoleBinding may be used to grant permission at the namespace level. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/role_binding_v1/example_1.tf"}} + +## Import + +RoleBinding can be imported using the name, e.g. + +``` +$ terraform import kubernetes_role_binding_v1.example default/terraform-name +``` diff --git a/templates/resources/role_v1.md.tmpl b/templates/resources/role_v1.md.tmpl new file mode 100644 index 0000000000..6561c44ad9 --- /dev/null +++ b/templates/resources/role_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "rbac/v1" +page_title: "Kubernetes: kubernetes_role_v1" +description: |- + A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/role_v1/example_1.tf"}} + +## Import + +Role can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_role_v1.example default/terraform-example +``` diff --git a/templates/resources/runtime_class_v1.md.tmpl b/templates/resources/runtime_class_v1.md.tmpl new file mode 100644 index 0000000000..24ebce9ae6 --- /dev/null +++ b/templates/resources/runtime_class_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "node/v1" +page_title: "Kubernetes: kubernetes_runtime_class_v1" +description: |- + A runtime class is used to determine which container runtime is used to run all containers in a pod. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example usage + +{{tffile "examples/resources/runtime_class_v1/example_1.tf"}} + +## Import + +Runtime class can be imported using the name only, e.g. + +``` +$ terraform import kubernetes_runtime_class_v1.example myclass +``` diff --git a/templates/resources/secret.md.tmpl b/templates/resources/secret.md.tmpl new file mode 100644 index 0000000000..7209254287 --- /dev/null +++ b/templates/resources/secret.md.tmpl @@ -0,0 +1,48 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_secret" +description: |- + The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. +--- + +# {{ .Name }} + +The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. The resource will by default create a secret which is available to any pod in the specified (or default) namespace. + +~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) + +~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/secret/example_1.tf"}} + +## Example Usage (Docker config) + +### Docker config file + +{{tffile "examples/resources/secret/example_2.tf"}} + +### Username and password + +{{tffile "examples/resources/secret/example_3.tf"}} + +This is equivalent to the following kubectl command: + +```sh +$ kubectl create secret docker-registry docker-cfg --docker-server=${registry_server} --docker-username=${registry_username} --docker-password=${registry_password} --docker-email=${registry_email} +``` + +## Example Usage (Service account token) + +{{tffile "examples/resources/secret/example_4.tf"}} + +## Import + +Secret can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_secret.example default/my-secret +``` diff --git a/templates/resources/secret_v1.md.tmpl b/templates/resources/secret_v1.md.tmpl new file mode 100644 index 0000000000..12645cdfc9 --- /dev/null +++ b/templates/resources/secret_v1.md.tmpl @@ -0,0 +1,48 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_secret_v1" +description: |- + The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. +--- + +# {{ .Name }} + +{{ .Description }} + +~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) + +~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/secret_v1/example_1.tf"}} + +## Example Usage (Docker config) + +### Docker config file + +{{tffile "examples/resources/secret_v1/example_2.tf"}} + +### Username and password + +{{tffile "examples/resources/secret_v1/example_3.tf"}} + +This is equivalent to the following kubectl command: + +```sh +$ kubectl create secret docker-registry docker-cfg --docker-server=${registry_server} --docker-username=${registry_username} --docker-password=${registry_password} --docker-email=${registry_email} +``` + +## Example Usage (Service account token) + +{{tffile "examples/resources/secret_v1/example_4.tf"}} + +## Import + +Secret can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_secret_v1.example default/my-secret +``` diff --git a/templates/resources/service.md.tmpl b/templates/resources/service.md.tmpl new file mode 100644 index 0000000000..656d47caac --- /dev/null +++ b/templates/resources/service.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# {{ .Name }} + +A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/service/example_1.tf"}} + +## Example using AWS load balancer + +{{tffile "examples/resources/service/example_2.tf"}} + +## Import + +Service can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_service.example default/terraform-name +``` diff --git a/templates/resources/service_account.md.tmpl b/templates/resources/service_account.md.tmpl new file mode 100644 index 0000000000..6e8696d122 --- /dev/null +++ b/templates/resources/service_account.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# {{ .Name }} + +A service account provides an identity for processes that run in a Pod. + +Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/service_account/example_1.tf"}} + +## Import + +Service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_service_account.example default/terraform-example +``` diff --git a/templates/resources/service_account_v1.md.tmpl b/templates/resources/service_account_v1.md.tmpl new file mode 100644 index 0000000000..f42ccafb83 --- /dev/null +++ b/templates/resources/service_account_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_account_v1" +description: |- + A service account provides an identity for processes that run in a Pod. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/service_account_v1/example_1.tf"}} + +## Import + +Service account can be imported using the namespace and name, e.g. + +``` +$ terraform import kubernetes_service_account_v1.example default/terraform-example +``` diff --git a/templates/resources/service_v1.md.tmpl b/templates/resources/service_v1.md.tmpl new file mode 100644 index 0000000000..b9444682cc --- /dev/null +++ b/templates/resources/service_v1.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "core/v1" +page_title: "Kubernetes: kubernetes_service_v1" +description: |- + A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/service_v1/example_1.tf"}} + +## Example using AWS load balancer + +{{tffile "examples/resources/service_v1/example_2.tf"}} + +## Import + +Service can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_service_v1.example default/terraform-name +``` diff --git a/templates/resources/stateful_set.md.tmpl b/templates/resources/stateful_set.md.tmpl new file mode 100644 index 0000000000..5c5d90b637 --- /dev/null +++ b/templates/resources/stateful_set.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_stateful_set" +description: |- + StatefulSet is a Kubernetes resource used to manage stateful applications. +--- + +# {{ .Name }} + +Manages the deployment and scaling of a set of Pods , and provides guarantees about the ordering and uniqueness of these Pods. + +Like a Deployment , a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling. + +A StatefulSet operates under the same pattern as any other Controller. You define your desired state in a StatefulSet object, and the StatefulSet controller makes any necessary updates to get there from the current state. + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/stateful_set/example_1.tf"}} + +## Import + +kubernetes_stateful_set can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_stateful_set.example default/terraform-example +``` diff --git a/templates/resources/stateful_set_v1.md.tmpl b/templates/resources/stateful_set_v1.md.tmpl new file mode 100644 index 0000000000..386d134472 --- /dev/null +++ b/templates/resources/stateful_set_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "apps/v1" +page_title: "Kubernetes: kubernetes_stateful_set_v1" +description: |- + StatefulSet is a Kubernetes resource used to manage stateful applications. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/stateful_set_v1/example_1.tf"}} + +## Import + +kubernetes_stateful_set_v1 can be imported using its namespace and name, e.g. + +``` +$ terraform import kubernetes_stateful_set_v1.example default/terraform-example +``` diff --git a/templates/resources/storage_class.md.tmpl b/templates/resources/storage_class.md.tmpl new file mode 100644 index 0000000000..427c23626b --- /dev/null +++ b/templates/resources/storage_class.md.tmpl @@ -0,0 +1,26 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_storage_class" +description: |- + Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +--- + +# {{ .Name }} + +Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. + +Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/storage_class/example_1.tf"}} + +## Import + +kubernetes_storage_class can be imported using its name, e.g. + +``` +$ terraform import kubernetes_storage_class.example terraform-example +``` diff --git a/templates/resources/storage_class_v1.md.tmpl b/templates/resources/storage_class_v1.md.tmpl new file mode 100644 index 0000000000..63b5a231b0 --- /dev/null +++ b/templates/resources/storage_class_v1.md.tmpl @@ -0,0 +1,24 @@ +--- +subcategory: "storage/v1" +page_title: "Kubernetes: kubernetes_storage_class_v1" +description: |- + Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/storage_class_v1/example_1.tf"}} + +## Import + +kubernetes_storage_class_v1 can be imported using its name, e.g. + +``` +$ terraform import kubernetes_storage_class_v1.example terraform-example +``` diff --git a/templates/resources/token_request_v1.md.tmpl b/templates/resources/token_request_v1.md.tmpl new file mode 100644 index 0000000000..8d7275c0d5 --- /dev/null +++ b/templates/resources/token_request_v1.md.tmpl @@ -0,0 +1,17 @@ +--- +subcategory: "authentication/v1" +page_title: "Kubernetes: kubernetes_token_request_v1" +description: |- + TokenRequest requests a token for a given service account. +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/token_request_v1/example_1.tf"}} + diff --git a/templates/resources/validating_webhook_configuration.md.tmpl b/templates/resources/validating_webhook_configuration.md.tmpl new file mode 100644 index 0000000000..40b4535a9a --- /dev/null +++ b/templates/resources/validating_webhook_configuration.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "admissionregistration/v1beta1" +page_title: "Kubernetes: kubernetes_validating_webhook_configuration" +description: |- + Validating Webhook Configuration configures a validating admission webhook +--- + +# {{ .Name }} + +Validating Webhook Configuration configures a [validating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/validating_webhook_configuration/example_1.tf"}} + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +##Import + +Validating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_validating_webhook_configuration.example terraform-example +``` diff --git a/templates/resources/validating_webhook_configuration_v1.md.tmpl b/templates/resources/validating_webhook_configuration_v1.md.tmpl new file mode 100644 index 0000000000..62cc8ba554 --- /dev/null +++ b/templates/resources/validating_webhook_configuration_v1.md.tmpl @@ -0,0 +1,28 @@ +--- +subcategory: "admissionregistration/v1" +page_title: "Kubernetes: kubernetes_validating_webhook_configuration_v1" +description: |- + Validating Webhook Configuration configures a validating admission webhook +--- + +# {{ .Name }} + +{{ .Description }} + +{{ .SchemaMarkdown }} + +## Example Usage + +{{tffile "examples/resources/validating_webhook_configuration_v1/example_1.tf"}} + +## API version support + +The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. + +## Import + +Validating Webhook Configuration can be imported using the name, e.g. + +``` +$ terraform import kubernetes_validating_webhook_configuration_v1.example terraform-example +``` diff --git a/website/docs/d/all_namespaces.html.markdown b/website/docs/d/all_namespaces.html.markdown deleted file mode 100644 index 9af3a9d5f3..0000000000 --- a/website/docs/d/all_namespaces.html.markdown +++ /dev/null @@ -1,29 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_all_namespaces" -description: |- - Lists all namespaces within a cluster. ---- - -# kubernetes_all_namespaces - -This data source provides a mechanism for listing the names of all available namespaces in a Kubernetes cluster. -It can be used to check for existence of a specific namespaces or to apply another resource to all or a subset of existing namespaces in a cluster. - -In Kubernetes, namespaces provide a scope for names and are intended as a way to divide cluster resources between multiple users. - -## Example Usage - -```hcl -data "kubernetes_all_namespaces" "allns" {} - -output "all-ns" { - value = data.kubernetes_all_namespaces.allns.namespaces -} - -output "ns-present" { - value = contains(data.kubernetes_all_namespaces.allns.namespaces, "kube-system") -} - -``` diff --git a/website/docs/d/config_map_v1.html.markdown b/website/docs/d/config_map_v1.html.markdown deleted file mode 100644 index 19cbc1d525..0000000000 --- a/website/docs/d/config_map_v1.html.markdown +++ /dev/null @@ -1,49 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_config_map_v1" -description: |- - This data source reads configuration data from a config map. ---- - -# kubernetes_config map - -Config Maps are key-value pairs containing configuration data. The Config Map data source provides a mechanism for extracting these key-value pairs. - -~> **Note:** All arguments including the config map data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). - -## Example Usage - -```hcl -data "kubernetes_config_map_v1" "example" { - metadata { - name = "my-config" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard config map's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the config map, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the config map must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this config map. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -* `data` - A map of the config map data. -* `binary_data` - A map of preserved non-UTF8 data. For more info see [Kubernetes API reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#configmap-v1-core). diff --git a/website/docs/d/endpoints_v1.html.markdown b/website/docs/d/endpoints_v1.html.markdown deleted file mode 100644 index 5191364402..0000000000 --- a/website/docs/d/endpoints_v1.html.markdown +++ /dev/null @@ -1,80 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_endpoints_v1" -description: |- - An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. ---- - -# kubernetes_endpoints_v1 - -An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. - - -## Example Usage - -```hcl -data "kubernetes_endpoints_v1" "api_endpoints" { - metadata { - name = "kubernetes" - namespace = "default" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard endpoints' metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the endpoints resource. -* `namespace` - (Optional) Namespace defines the space within which name of the endpoints resource must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this endpoints resource that can be used by clients to determine when endpoints resource has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this endpoints resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -### `subset` - -#### Attributes - -* `address` - (Optional) An IP address block which offers the related ports and is ready to accept traffic. These endpoints should be considered safe for load balancers and clients to utilize. Can be repeated multiple times. -* `not_ready_address` - (Optional) A IP address block which offers the related ports but is not currently marked as ready because it have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check. Can be repeated multiple times. -* `port` - (Optional) A port number block available on the related IP addresses. Can be repeated multiple times. - -### `address` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. - -### `not_ready_address` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. - -### `port` - -#### Attributes - -* `name` - (Optional) The name of this port within the endpoint. All ports within the endpoint must have unique names. Optional if only one port is defined on this endpoint. -* `port` - (Required) The port that will be utilized by this endpoint. -* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. - diff --git a/website/docs/d/ingress.html.markdown b/website/docs/d/ingress.html.markdown deleted file mode 100644 index b8a044a39f..0000000000 --- a/website/docs/d/ingress.html.markdown +++ /dev/null @@ -1,114 +0,0 @@ ---- -subcategory: "extensions/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_ingress" -description: |- - Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. ---- - -# kubernetes_ingress - -Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. -This data source allows you to pull data about such ingress. - -## Example Usage - -```hcl -data "kubernetes_ingress" "example" { - metadata { - name = "terraform-example" - } -} - -resource "aws_route53_record" "example" { - zone_id = data.aws_route53_zone.k8.zone_id - name = "example" - type = "CNAME" - ttl = "300" - records = [data.kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.hostname] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Required) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `annotations` - (Optional) An unstructured key value map stored with the service that may be used to store arbitrary metadata. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -### `spec` - -#### Attributes - -* `backend` - Backend defines the referenced service endpoint to which the traffic will be forwarded. See `backend` block attributes below. -* `rule` - A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. See `rule` block attributes below. -* `tls` - TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. See `tls` block attributes below. -* `ingress_class_name` - The name of the IngressClass cluster resource. The associated IngressClass defines which controller will implement the resource. This replaces the deprecated `kubernetes.io/ingress.class` annotation. For backwards compatibility, when that annotation is set, it must be given precedence over this field. - -### `backend` - -#### Attributes - -* `service_name` - Specifies the name of the referenced service. -* `service_port` - Specifies the port of the referenced service. - -### `rule` - -#### Attributes - -* `host` - Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the IP in the Spec of the parent Ingress. 2. The : delimiter is not respected because ports are not allowed. Currently the port of an Ingress is implicitly :80 for http and :443 for https. Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue. -* `http` - http is a list of http selectors pointing to backends. In the example: http:///? -> backend where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'. See `http` block attributes below. - - -#### `http` - -* `path` - Path array of path regex associated with a backend. Incoming urls matching the path are forwarded to the backend, see below for `path` block structure. - -#### `path` - -* `path` - A string or an extended POSIX regular expression as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend. -* `backend` - Backend defines the referenced service endpoint to which the traffic will be forwarded to. - -### `tls` - -#### Attributes - -* `hosts` - Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified. -* `secret_name` - SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing. - -## Attributes - -### `status` - -* `status` - Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -#### `load_balancer` - -* LoadBalancer contains the current status of the load-balancer, if one is present. - -##### `ingress` - -* `ingress` - Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -###### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). diff --git a/website/docs/d/ingress_v1.html.markdown b/website/docs/d/ingress_v1.html.markdown deleted file mode 100644 index a987345549..0000000000 --- a/website/docs/d/ingress_v1.html.markdown +++ /dev/null @@ -1,127 +0,0 @@ ---- -subcategory: "networking/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_ingress_v1" -description: |- - Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. ---- - -# kubernetes_ingress_v1 - -Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. -This data source allows you to pull data about such ingress. - -## Example Usage - -```hcl -data "kubernetes_ingress_v1" "example" { - metadata { - name = "terraform-example" - } -} - -resource "aws_route53_record" "example" { - zone_id = data.aws_route53_zone.k8.zone_id - name = "example" - type = "CNAME" - ttl = "300" - records = [data.kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.hostname] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Required) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `annotations` - (Optional) An unstructured key value map stored with the service that may be used to store arbitrary metadata. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -### `spec` - -#### Attributes - -* `default_backend` - Backend defines the referenced service endpoint to which the traffic will be forwarded. See `backend` block attributes below. -* `rule` - A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. See `rule` block attributes below. -* `tls` - TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. See `tls` block attributes below. -* `ingress_class_name` - The name of the IngressClass cluster resource. The associated IngressClass defines which controller will implement the resource. This replaces the deprecated `kubernetes.io/ingress.class` annotation. For backwards compatibility, when that annotation is set, it must be given precedence over this field. - -### `backend` - -#### Arguments - -* `resource` - Resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a `service.name` and `service.port` must not be specified. -* `service` - Service references a Service as a Backend. - -### `service` - -#### Arguments - -* `name` - Specifies the name of the referenced service. -* `port` - Specifies the port of the referenced service. - -### `port` - -* `name` - Name is the name of the port on the Service. -* `number` - Number is the numerical port number (e.g. 80) on the Service. - -### `rule` - -#### Attributes - -* `host` - Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the IP in the Spec of the parent Ingress. 2. The : delimiter is not respected because ports are not allowed. Currently the port of an Ingress is implicitly :80 for http and :443 for https. Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue. -* `http` - http is a list of http selectors pointing to backends. In the example: http:///? -> backend where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'. See `http` block attributes below. - - -#### `http` - -* `path` - Path array of path regex associated with a backend. Incoming urls matching the path are forwarded to the backend, see below for `path` block structure. - -#### `path` - -* `path` - (Required) A string or an extended POSIX regular expression as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend. -* `path_type` - PathType determines the interpretation of the Path matching. PathType can be one of the following values: `ImplementationSpecific`, `Exact`, or `Prefix`. See the [Kubernetes Ingress documentation](https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types) for details. -* `backend` - Backend defines the referenced service endpoint to which the traffic will be forwarded to. - -### `tls` - -#### Attributes - -* `hosts` - Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified. -* `secret_name` - SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing. - -## Attributes - -### `status` - -* `status` - Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -#### `load_balancer` - -* LoadBalancer contains the current status of the load-balancer, if one is present. - -##### `ingress` - -* `ingress` - Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -###### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). diff --git a/website/docs/d/mutating_webhook_configuration_v1.html.markdown b/website/docs/d/mutating_webhook_configuration_v1.html.markdown deleted file mode 100644 index fdbca66da5..0000000000 --- a/website/docs/d/mutating_webhook_configuration_v1.html.markdown +++ /dev/null @@ -1,94 +0,0 @@ ---- -subcategory: "admissionregistration/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_mutating_webhook_configuration_v1" -description: |- - Mutating Webhook Configuration configures a mutating admission webhook ---- - -# kubernetes_mutating_webhook_configuration_v1 - -A Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). -This data source allows you to pull data about a given mutating webhook configuration based on its name. - -## Example Usage - -```hcl -data "kubernetes_mutating_webhook_configuration_v1" "example" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Mutating Webhook Configuration metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Attributes - -`webhook` - A list of webhooks and the affected resources and operations. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - Name of the Mutating Webhook Configuration, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `annotations` - An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. -* `generation` - A sequence number representing a specific generation of the desired state. -* `labels` - Map of string keys and values that can be used to organize and categorize (scope and select) namespaces. May match selectors of replication controllers and services. -* `resource_version` - An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this secret. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `webhook` - -#### Arguments - -* `admission_review_versions` - AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list are supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. -* `client_config` - ClientConfig defines how to communicate with the hook. -* `failure_policy` - FailurePolicy defines how unrecognized errors from the admission endpoint are handled - Allowed values are "Ignore" or "Fail". Defaults to "Fail". -* `match_policy` - matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. Defaults to "Equivalent" -* `name` - The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. -* `namespace_selector` - NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "runlevel", "operator": "NotIn", "values": [ "0", "1" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "environment", "operator": "In", "values": [ "prod", "staging" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. Default to the empty LabelSelector, which matches everything. -* `object_selector` - ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. -* `reinvocation_policy` - reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded". Never: the webhook will not be called more than once in a single admission evaluation. IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: *the number of additional invocations is not guaranteed to be exactly one.* if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. *webhooks that use this option may be reordered to minimize the number of additional invocations.* to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. Defaults to "Never". -* `rule` - Describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. -* `side_effects` - SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. -* `timeout_seconds` - TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. - - -### `client_config` - -#### Arguments - -* `ca_bundle` - A PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. -* `service` - A reference to the service for this webhook. Either `service` or `url` must be specified. If the webhook is running within the cluster, then you should use `service`. -* `url` - Gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. - -~> Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be "https"; the URL must begin with "https://". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. - -### `service` - -#### Arguments - -* `name` - The name of the service. -* `namespace` - The namespace of the service. -* `path` - The URL path which will be sent in any request to this service. -* `port` - If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). - -### `rule` - -#### Arguments - -* `api_groups` - The API groups the resources belong to. '\*' is all groups. If '\*' is present, the length of the list must be one. -* `api_versions` - The API versions the resources belong to. '\*' is all versions. If '\*' is present, the length of the list must be one. -* `operations` - The operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '\*' is present, the length of the list must be one. -* `resources` - A list of resources this rule applies to. For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '\*' means all resources, but not subresources. 'pods/\*' means all subresources of pods. '\*/scale' means all scale subresources. '\*/\*' means all resources and their subresources. If wildcard is present, the validation rule will ensure resources do not overlap with each other. Depending on the enclosing object, subresources might not be allowed. -* `scope` - Specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". diff --git a/website/docs/d/nodes.html.markdown b/website/docs/d/nodes.html.markdown deleted file mode 100644 index e4a8a279ef..0000000000 --- a/website/docs/d/nodes.html.markdown +++ /dev/null @@ -1,126 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_nodes" -description: |- - Gets nodes within a cluster. ---- - -# kubernetes_nodes - -This data source provides a mechanism for listing the names of nodes in a kubernetes cluster. - -By default, all nodes in the cluster are returned, but queries by node label are also supported. - -It can be used to check for the existence of a specific node or to lookup a node to apply a taint with the `kubernetes_node_taint` resource. - -## Example usage - -### All nodes - -```hcl -data "kubernetes_nodes" "example" {} - -output "node-ids" { - value = [for node in data.kubernetes_nodes.example.nodes : node.spec.0.provider_id] -} -``` - -### By label - -```hcl -data "kubernetes_nodes" "example" { - metadata { - labels = { - "kubernetes.io/os" = "linux" - } - } -} - -output "linux-node-names" { - value = [for node in data.kubernetes_nodes.example.nodes : node.metadata.0.name] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - Metadata describing which nodes to return. - -### Attributes - -* `metadata` - Metadata describing the node. See [metadata](#metadata) for more - info. -* `spec` - Defines the behavior of the node. See [spec](#spec) for more info. -* `status` - Status information for the node. See [status](#status) for more - info. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `labels` - (Required) Map of string keys and values that can be used to narrow the selection of nodes returned. - -#### Attributes - -* `name` - Name of the node, must be unique. -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the node. -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this node that can be used by clients to determine when the node has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this node . For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Attributes - -* `pod_cidr` - (Optional) The pod IP range assigned to the node -* `pod_cidrs` - (Optional) A list of IP address ranges assigned to the node for - usage by pods on that node. -* `provider_id` - (Optional) ID of the node assigned by the cloud provider. -* `unschedulable` - Controls the schedulability of new pods on the node. By default, node is schedulable. -* `taints` - (Optional) Taints applied to the node. See [taints](#taints) for - more info. - -### `status` - -### Attributes - -* `addresses` - (Optional) A set of IP address(es) and/or Hostname assigned to the node. See [addresses](#addresses) and [Kubernetes reference](https://kubernetes.io/docs/concepts/architecture/nodes/#addresses/node/#info) for more info. -* `allocatable` - (Optional) The total resources of a node. -* `capacity` - (Optional) The resources of a node that are available for scheduling. -* `node_info` - (Optional) A set of ids/uuids to uniquely identify the node. See [node_info](#node_info) for more info. [Kubernetes reference](https://kubernetes.io/docs/concepts/nodes/node/#info) - -### `addresses` - -#### Attributes - -* `type` - Type of the address: HostName, ExternalIP or InternalIP. -* `address` - The IP (if type is ExternalIP or InternalIP) or the hostname (if type is HostName). - -### `node_info` - -#### Attributes - -* `machine_id` - Machine ID reported by the node see [main(5) - machine-id](http://man7.org/linux/man-pages/man5/machine-id.5.html) for more info. -* `system_uuid` - System UUID reported by the node. This field is - specific to [Red Hat hosts](https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid) -* `boot_id` - Boot ID reported by the node. -* `kernel_version` - Kernel Version reported by the node from `uname -r` -* `os_image` - OS Image reported by the node from `/etc/os-release` -* `container_runtime_version` ContainerRuntime Version reported by the node through runtime remote API -* `kubelet_version` - Kubelet Version reported by the node. -* `kube_proxy_version` - KubeProxy Version reported by the node. -* `operating_system` - The Operating System reported by the node -* `architecture` - The Architecture reported by the node - -### `taints` - -#### Attributes - -* `key` - The taint key to be applied to a node. -* `value` - (Optional) The taint value corresponding to the taint key. -* `effect` - The effect of the taint on pods that do not tolerate the taint. Valid effects are `NoSchedule`, `PreferNoSchedule` and `NoExecute`. diff --git a/website/docs/d/persistent_volume_claim.html.markdown b/website/docs/d/persistent_volume_claim.html.markdown deleted file mode 100644 index 16798825be..0000000000 --- a/website/docs/d/persistent_volume_claim.html.markdown +++ /dev/null @@ -1,63 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume_claim" -description: |- - A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. ---- - -# kubernetes_persistent_volume_claim - -A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. - - -## Example Usage - -```hcl -data "kubernetes_persistent_volume_claim" "example" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume claim's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the persistent volume claim, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the persistent volume claim must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this persistent volume claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Attributes - -* `access_modes` - A set of the desired access modes the volume should have. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes) -* `selector` - Claims can specify a label selector to further filter the set of volumes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector) -* `volume_name` - The binding reference to the PersistentVolume backing this claim. -* `storage_class_name` - Name of the storage class requested by the claim. -* `volume_mode` - (Optional) Defines what type of volume is required by the claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode) - -## Import - -Persistent Volume Claim can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_persistent_volume_claim.example default/example-name -``` diff --git a/website/docs/d/persistent_volume_claim_v1.html.markdown b/website/docs/d/persistent_volume_claim_v1.html.markdown deleted file mode 100644 index 42156c3a4b..0000000000 --- a/website/docs/d/persistent_volume_claim_v1.html.markdown +++ /dev/null @@ -1,63 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume_claim_v1" -description: |- - A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. ---- - -# kubernetes_persistent_volume_claim_v1 - -A PersistentVolumeClaim (PVC) is a request for storage by a user. This data source retrieves information about the specified PVC. - - -## Example Usage - -```hcl -data "kubernetes_persistent_volume_claim_v1" "example" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume claim's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the persistent volume claim, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the persistent volume claim must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this persistent volume claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Attributes - -* `access_modes` - A set of the desired access modes the volume should have. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes) -* `selector` - Claims can specify a label selector to further filter the set of volumes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector) -* `volume_name` - The binding reference to the PersistentVolume backing this claim. -* `storage_class_name` - Name of the storage class requested by the claim. -* `volume_mode` - (Optional) Defines what type of volume is required by the claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode) - -## Import - -Persistent Volume Claim can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_persistent_volume_claim_v1.example default/example-name -``` diff --git a/website/docs/d/persistent_volume_v1.html.markdown b/website/docs/d/persistent_volume_v1.html.markdown deleted file mode 100644 index 662bb9c8df..0000000000 --- a/website/docs/d/persistent_volume_v1.html.markdown +++ /dev/null @@ -1,303 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume_v1" -description: |- - A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. ---- - -# kubernetes_persistent_volume_v1 - -A PersistentVolume (PV) is a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. This data source retrieves information about the specified PV. - - -## Example Usage - -```hcl -data "kubernetes_persistent_volume_v1" "example" { - metadata { - name = "terraform-example" - } -} -data "kubernetes_secret" "example" { - metadata { - name = data.kubernetes_persistent_volume_v1.example.spec[0].persistent_volume_source[0].azure_file[0].secret_name - } -} -output "azure_storageaccount_name" { - value = data.kubernetes_secret.example.data.azurestorageaccountname -} -output "azure_storageaccount_key" { - value = data.kubernetes_secret.example.data.azurestorageaccountkey -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec of the persistent volume owned by the cluster. See below. - -## Nested Blocks - -### `spec` - -#### Arguments - -* `access_modes` - (Required) Contains all ways the volume can be mounted. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) -* `capacity` - (Required) A description of the persistent volume's resources and capacity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity) -* `node_affinity` - (Optional) NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume. -* `persistent_volume_reclaim_policy` - (Optional) What happens to a persistent volume when released from its claim. Valid options are Retain (default), Delete and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming) -* `persistent_volume_source` - (Required) The specification of a persistent volume. -* `storage_class_name` - (Optional) The name of the persistent volume's storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class) -* `mount_options` - (Options) A Kubernetes administrator can specify additional mount options for when a Persistent Volume is mounted on a node. *Note: Not all Persistent Volume types support mount options.* For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options) - -### `node_affinity` - -#### Arguments - -* `required` - (Optional) Required specifies hard node constraints that must be met. - -### `required` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -### `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` and `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are `In`, `NotIn`, `Exists`, `DoesNotExist`. `Gt`, and `Lt`. -* `values` - (Optional) 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. - -### `persistent_volume_source` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://examples.k8s.io/mysql-cinder-pd/README.md -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://examples.k8s.io/volumes/glusterfs/README.md -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `local` - (Optional) Represents a local storage volume on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#local) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://examples.k8s.io/volumes/rbd/README.md -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors For more info seehttps://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is / -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info seehttps://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret For more info seehttps://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info seehttps://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it. see [secret_ref](#secret_ref) for more details. -* `user` - (Optional) User is the rados user name, default is admin. For more info seehttps://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://examples.k8s.io/mysql-cinder-pd/README.md -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://examples.k8s.io/mysql-cinder-pd/README.md -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://examples.k8s.io/mysql-cinder-pd/README.md - -### `csi` - -#### Arguments - -* `driver` - (Required) the name of the volume driver to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_handle` - (Required) A map that specifies static properties of a volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_attributes` - (Optional) Attributes of the volume to publish. -* `fs_type` - (Optional) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. `ext4`, `xfs`, `ntfs`. -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to `true`. If omitted, the default is `false`. -* `controller_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. -* `node_stage_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. see [secret_ref](#secret_ref) for more details. -* `node_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. -* `controller_expand_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. see [secret_ref](#secret_ref) for more details. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. see [secret_ref](#secret_ref) for more details. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod -* `path` - (Required) The Glusterfs volume path. For more info see https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `local` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#local) - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. -**By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem).** -For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. -**By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem).** -For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) -* `name` - (Optional) Name of the persistent volume, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `self_link` - A URL representing this persistent volume. -* `uid` - The unique in time and space value for this persistent volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it -* `rbd_image` - (Required) The rados image name. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it. See [secret_ref](#secret_ref) for more details. - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) The Namespace of the referent secret. - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk diff --git a/website/docs/d/pod.html.markdown b/website/docs/d/pod.html.markdown deleted file mode 100644 index 3ce06ffe70..0000000000 --- a/website/docs/d/pod.html.markdown +++ /dev/null @@ -1,467 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod" -description: |- - A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. ---- - -# kubernetes_pod - -A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) - -## Example Usage - -``` -data "kubernetes_pod" "test" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard pod's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the pod, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the pod must be unique. - - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Attributes - -* `affinity` - A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - 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. -* `automount_service_account_token` - Indicates whether a service account token should be automatically mounted. Defaults to true for Pods. -* `container` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `init_container` - List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `host_alias` - List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_alias` block definition below. -* `host_ipc` - Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - 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. -* `host_pid` - Use the host's pid namespace. -* `hostname` - Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - 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. -* `node_selector` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `priority_class_name` - 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. -* `restart_policy` - Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `service_account_name` - ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/. -* `share_process_namespace` - 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. -* `subdomain` - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - 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 delete immediately. 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. -* `toleration` - Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) - -### `affinity` - -#### Attributes - -* `node_affinity` - Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - - -### `container` - -#### Attributes - -* `args` - 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - 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. -* `image` - Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - 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. -* `readiness_probe` - Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `stdin` - 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. -* `stdin_once` - 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. -* `termination_message_path` - 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. Defaults to /dev/termination-log. Cannot be updated. -* `tty` - Whether this container should allocate a TTY for itself -* `volume_mount` - Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - 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. - -### `config_map` - -#### Attributes - -* `default_mode` - Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Attributes - -* `key` - The key to select. -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `dns_config` - -#### Attributes - -* `nameservers` - A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - Name of the option. -* `value` - Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Attributes - -* `default_mode` - Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Attributes - -* `medium` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Attributes - -* `name` - Name of the environment variable. Must be a C_IDENTIFIER -* `value` - Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - Source for the environment variable's value - -### `env_from` - -#### Attributes - -* `config_map_ref` - The ConfigMap to select from -* `prefix` - An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - The Secret to select from - -### `exec` - -#### Attributes - -* `command` - 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. 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. - -### `grpc` - -#### Arguments - -* `port` - Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `image_pull_secrets` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `lifecycle` - -#### Attributes - -* `post_start` - post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `limits` - -#### Attributes - -* `cpu` - CPU -* `memory` - Memory - -### `liveness_probe` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `failure_threshold` - Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `http_get` - Specifies the http request to perform. -* `grpc` - GRPC specifies an action involving a GRPC port. -* `initial_delay_seconds` - Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - How often (in seconds) to perform the probe -* `success_threshold` - Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Attributes - -* `path` - Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Attributes - -* `claim_name` - ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Attributes - -* `fs_type` - 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. -* `pd_id` - ID that identifies Photon Controller persistent disk - -### `port` - -#### Attributes - -* `container_port` - Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - What host IP to bind the external port to. -* `host_port` - 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. -* `name` - 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 -* `protocol` - Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `http_get` - Specifies the http request to perform. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `http_get` - Specifies the http request to perform. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Attributes - -* `group` - Group to map volume access to Default is no group -* `read_only` - Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - 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 -* `user` - User to map volume access to Defaults to serivceaccount user -* `volume` - Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Attributes - -* `ceph_monitors` - A collection of Ceph monitors. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#cephfs. -* `fs_type` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rados_user` - The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_image` - The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_pool` - The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `read_only` - Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `secret_ref` - Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. - -### `readiness_probe` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `failure_threshold` - Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - GRPC specifies an action involving a GRPC port. -* `http_get` - Specifies the http request to perform. -* `initial_delay_seconds` - Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - How often (in seconds) to perform the probe -* `success_threshold` - Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `requests` - -#### Attributes - -* `cpu` - CPU -* `memory` - Memory - -### `resource_field_ref` - -#### Attributes - -* `container_name` - The name of the container -* `resource` - Resource to select - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Attributes - -* `level` - Level is SELinux level label that applies to the container. -* `role` - Role is a SELinux role label that applies to the container. -* `type` - Type is a SELinux type label that applies to the container. -* `user` - User is a SELinux user label that applies to the container. - -### `secret` - -#### Attributes - -* `default_mode` - Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - Specify whether the Secret or its keys must be defined. -* `secret_name` - Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - The key to project. -* `mode` - Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - 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 '..'. - -### `secret_ref` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Attributes - -* `key` - The key of the secret to select from. Must be a valid secret key. -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret_ref` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### ArgumAttributesents - -* `allow_privilege_escalation` - 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 -* `capabilities` - The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - Whether this container has a read-only root filesystem. Default is false. -* `run_as_group` - 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. -* `run_as_non_root` - 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. -* `run_as_user` - 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - 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. -* `fs_group_change_policy` - 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. Note that this field cannot be set when spec.os.name is windows. - -### `capabilities` - -#### Attributes - -* `add` - A list of added capabilities. -* `drop` - A list of removed capabilities. - -### pod `security_context` - -#### Attributes - -* `fs_group` - 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_group` - 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. -* `run_as_non_root` - 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. -* `run_as_user` - 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - 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. -* `supplemental_groups` - 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. - -### `tcp_socket` - -#### Attributes - -* `port` - 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. - - -### `value_from` - -#### Attributes - -* `config_map_key_ref` - Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `volume_mount` - -#### Attributes - -* `mount_path` - Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - This must match the Name of a Volume. -* `read_only` - Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -## Argument Reference - -The following attributes are exported: - -* `status` - The current status of the pods. - -## Import - -Pod can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_pod.example default/terraform-example -``` diff --git a/website/docs/d/pod_v1.html.markdown b/website/docs/d/pod_v1.html.markdown deleted file mode 100644 index 00b215a0bf..0000000000 --- a/website/docs/d/pod_v1.html.markdown +++ /dev/null @@ -1,466 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod_v1" -description: |- - A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. ---- - -# kubernetes_pod_v1 - -A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) - -## Example Usage - -``` -data "kubernetes_pod_v1" "test" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard pod's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the pod, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the pod must be unique. - - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Attributes - -* `affinity` - A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - 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. -* `automount_service_account_token` - Indicates whether a service account token should be automatically mounted. Defaults to true for Pods. -* `container` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `init_container` - List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `host_alias` - List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_alias` block definition below. -* `host_ipc` - Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - 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. -* `host_pid` - Use the host's pid namespace. -* `hostname` - Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - 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. -* `node_selector` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `priority_class_name` - 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. -* `restart_policy` - Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `service_account_name` - ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/. -* `share_process_namespace` - 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. -* `subdomain` - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - 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 delete immediately. 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. -* `toleration` - Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) - -### `affinity` - -#### Attributes - -* `node_affinity` - Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - - -### `container` - -#### Attributes - -* `args` - 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - 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. -* `image` - Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - 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. -* `readiness_probe` - Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `stdin` - 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. -* `stdin_once` - 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. -* `termination_message_path` - 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. Defaults to /dev/termination-log. Cannot be updated. -* `tty` - Whether this container should allocate a TTY for itself -* `volume_mount` - Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - 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. - -### `config_map` - -#### Attributes - -* `default_mode` - Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Attributes - -* `key` - The key to select. -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `dns_config` - -#### Attributes - -* `nameservers` - A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - Name of the option. -* `value` - Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Attributes - -* `default_mode` - Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Attributes - -* `medium` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Attributes - -* `name` - Name of the environment variable. Must be a C_IDENTIFIER -* `value` - Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - Source for the environment variable's value - -### `env_from` - -#### Attributes - -* `config_map_ref` - The ConfigMap to select from -* `prefix` - An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - The Secret to select from - -### `exec` - -#### Attributes - -* `command` - 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. 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. - -### `grpc` - -#### Arguments - -* `port` - Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `image_pull_secrets` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `lifecycle` - -#### Attributes - -* `post_start` - post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `limits` - -#### Attributes - -* `cpu` - CPU -* `memory` - Memory - -### `liveness_probe` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `failure_threshold` - Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - GRPC specifies an action involving a GRPC port. -* `http_get` - Specifies the http request to perform. -* `initial_delay_seconds` - Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - How often (in seconds) to perform the probe -* `success_threshold` - Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Attributes - -* `path` - Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Attributes - -* `claim_name` - ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Attributes - -* `fs_type` - 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. -* `pd_id` - ID that identifies Photon Controller persistent disk - -### `port` - -#### Attributes - -* `container_port` - Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - What host IP to bind the external port to. -* `host_port` - 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. -* `name` - 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 -* `protocol` - Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `http_get` - Specifies the http request to perform. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `http_get` - Specifies the http request to perform. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Attributes - -* `group` - Group to map volume access to Default is no group -* `read_only` - Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - 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 -* `user` - User to map volume access to Defaults to serivceaccount user -* `volume` - Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Attributes - -* `ceph_monitors` - A collection of Ceph monitors. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#cephfs. -* `fs_type` - 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rados_user` - The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_image` - The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_pool` - The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `read_only` - Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `secret_ref` - Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. - -### `readiness_probe` - -#### Attributes - -* `exec` - exec specifies the action to take. -* `failure_threshold` - Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - GRPC specifies an action involving a GRPC port. -* `http_get` - Specifies the http request to perform. -* `initial_delay_seconds` - Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - How often (in seconds) to perform the probe -* `success_threshold` - Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `requests` - -#### Attributes - -* `cpu` - CPU -* `memory` - Memory - -### `resource_field_ref` - -#### Attributes - -* `container_name` - The name of the container -* `resource` - Resource to select - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Attributes - -* `level` - Level is SELinux level label that applies to the container. -* `role` - Role is a SELinux role label that applies to the container. -* `type` - Type is a SELinux type label that applies to the container. -* `user` - User is a SELinux user label that applies to the container. - -### `secret` - -#### Attributes - -* `default_mode` - Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - Specify whether the Secret or its keys must be defined. -* `secret_name` - Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - The key to project. -* `mode` - Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - 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 '..'. - -### `secret_ref` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Attributes - -* `key` - The key of the secret to select from. Must be a valid secret key. -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret_ref` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### ArgumAttributesents - -* `allow_privilege_escalation` - 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 -* `capabilities` - The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - Whether this container has a read-only root filesystem. Default is false. -* `run_as_group` - 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. -* `run_as_non_root` - 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. -* `run_as_user` - 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - 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. - -### `capabilities` - -#### Attributes - -* `add` - A list of added capabilities. -* `drop` - A list of removed capabilities. - -### pod `security_context` - -#### Attributes - -* `fs_group` - 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_group` - 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. -* `run_as_non_root` - 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. -* `run_as_user` - 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - 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. -* `supplemental_groups` - 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. - -### `tcp_socket` - -#### Attributes - -* `port` - 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. - - -### `value_from` - -#### Attributes - -* `config_map_key_ref` - Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `volume_mount` - -#### Attributes - -* `mount_path` - Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - This must match the Name of a Volume. -* `read_only` - Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -## Argument Reference - -The following attributes are exported: - -* `status` - The current status of the pods. - -## Import - -Pod can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_pod_v1.example default/terraform-example -``` diff --git a/website/docs/d/resource.html.markdown b/website/docs/d/resource.html.markdown deleted file mode 100644 index 990181b15d..0000000000 --- a/website/docs/d/resource.html.markdown +++ /dev/null @@ -1,46 +0,0 @@ ---- -subcategory: "manifest" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_resource" -description: |- - This is a generic data source for Kubernetes API resources ---- - -# kubernetes_resource - -This data source is a generic way to retrieve resources from the Kubernetes API. - -### Example: Get data from a ConfigMap - -```hcl -data "kubernetes_resource" "example" { - api_version = "v1" - kind = "ConfigMap" - - metadata { - name = "example" - namespace = "default" - } -} - -output "test" { - value = data.kubernetes_resource.example.object.data.TEST -} -``` - -## Argument Reference - -The following arguments are supported: - -* `api_version` - (Required) The API version for the requested resource. -* `kind` - (Required) The kind for the requested resource. -* `metadata` - (Required) The metadata for the requested resource. -* `object` - (Optional) The response returned from the API server. - -### `metadata` - -#### Arguments - -* `name` - (Required) The name of the requested resource. -* `namespace` - (Optional) The namespace of the requested resource. - diff --git a/website/docs/d/service.html.markdown b/website/docs/d/service.html.markdown deleted file mode 100644 index a8dd524917..0000000000 --- a/website/docs/d/service.html.markdown +++ /dev/null @@ -1,113 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service" -description: |- - A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. ---- - -# kubernetes_service - -A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. -This data source allows you to pull data about such service. - -## Example Usage - -```hcl -data "kubernetes_service" "example" { - metadata { - name = "terraform-example" - } -} - -resource "aws_route53_record" "example" { - zone_id = "data.aws_route53_zone.k8.zone_id" - name = "example" - type = "CNAME" - ttl = "300" - records = [data.kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Attributes - -* `spec` - Spec defines the behavior of a service. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - Name of the service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `annotations` - (Optional) An unstructured key value map stored with the service that may be used to store arbitrary metadata. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `port` - -#### Attributes - -* `app_protocol` - (Optional) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per [RFC-6335](https://datatracker.ietf.org/doc/html/rfc6335) and [IANA standard service names](http://www.iana.org/assignments/service-names)). Non-standard protocols should use prefixed names such as `mycompany.com/my-custom-protocol`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol) -* `name` - The name of this port within the service. All ports within the service must have unique names. Optional if only one ServicePort is defined on this service. -* `node_port` - The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) -* `port` - The port that will be exposed by this service. -* `protocol` - The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. -* `target_port` - Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service) - -### `spec` - -#### Attributes - -* `allocate_load_balancer_node_ports` - (Optional) Defines if `NodePorts` will be automatically allocated for services with type `LoadBalancer`. It may be set to `false` if the cluster load-balancer does not rely on `NodePorts`. If the caller requests specific `NodePorts` (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type `LoadBalancer`. Default is `true`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation) -* `cluster_ip` - The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `cluster_ips` - (Optional) List of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise creation of the service will fail. If this field is not specified, it will be initialized from the `clusterIP` field. If this field is specified, clients must ensure that `clusterIPs[0]` and `clusterIP` have the same value. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `external_ips` - A list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. -* `external_name` - The external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires `type` to be `ExternalName`. -* `external_traffic_policy` - (Optional) Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. For more info see [Kubernetes reference](https://kubernetes.io/docs/tutorials/services/source-ip/) -* `ip_families` - (Optional) A list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the `ip_family_policy` field. If this field is specified manually, the requested family is available in the cluster, and `ip_family_policy` allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) -* `ip_family_policy` - (Optional) Represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to `SingleStack`. Services can be `SingleStack`(a single IP family), `PreferDualStack`(two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or `RequireDualStack`(two IP families on dual-stack configured clusters, otherwise fail). The `ip_families` and `cluster_ip` fields depend on the value of this field. -* `internal_traffic_policy` - (Optional) Specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. `Cluster` routes internal traffic to a Service to all endpoints. `Local` routes traffic to node-local endpoints only, traffic is dropped if no node-local endpoints are ready. The default value is `Cluster`. -* `load_balancer_class` - (Optional) The class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix. This field can only be set when the Service type is `LoadBalancer`. If not set, the default load balancer implementation is used. This field can only be set when creating or updating a Service to type `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class) -* `load_balancer_ip` - Only applies to `type = LoadBalancer`. LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying this field when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. -* `load_balancer_source_ranges` - If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/). -* `port` - The list of ports that are exposed by this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `selector` - Route service traffic to pods with label keys and values matching this selector. Only applies to types `ClusterIP`, `NodePort`, and `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/) -* `session_affinity` - Used to maintain session affinity. Supports `ClientIP` and `None`. Defaults to `None`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `session_affinity_config` - (Optional) Contains the configurations of session affinity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs) -* `type` - Determines how the service is exposed. Defaults to `ClusterIP`. Valid options are `ExternalName`, `ClusterIP`, `NodePort`, and `LoadBalancer`. `ExternalName` maps to the specified `external_name`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) - - -## Attributes - -* `status` - Status is a list containing the most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -### `status` -#### Attributes - -* `load_balancer` - a list containing the current status of the load-balancer, if one is present. - -### `load_balancer` -#### Attributes - -* `ingress` - a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -### `ingress` -#### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). - - diff --git a/website/docs/d/service_account.html.markdown b/website/docs/d/service_account.html.markdown deleted file mode 100644 index 20407c8d9f..0000000000 --- a/website/docs/d/service_account.html.markdown +++ /dev/null @@ -1,70 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service_account" -description: |- - A service account provides an identity for processes that run in a Pod. ---- - -# kubernetes_service_account - -A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) - -## Example Usage - -```hcl -data "kubernetes_service_account" "example" { - metadata { - name = "terraform-example" - } -} - -data "kubernetes_secret" "example" { - metadata { - name = "${data.kubernetes_service_account.example.default_secret_name}" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service account's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the service account, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service account must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -* `image_pull_secret` - A list of image pull secrets associated with the service account. -* `secret` - A list of secrets associated with the service account. -* `default_secret_name` - (Deprecated) Name of the default secret, containing service account token, created & managed by the service. By default, the provider will try to find the secret containing the service account token that Kubernetes automatically created for the service account. Where there are multiple tokens and the provider cannot determine which was created by Kubernetes, this attribute will be empty. When only one token is associated with the service account, the provider will return this single token secret. - - Starting from version `1.24.0` by default Kubernetes does not automatically generate tokens for service accounts. That leads to the situation when `default_secret_name` cannot be computed and thus will be an empty string. In order to create a service account token, please [use `kubernetes_secret_v1` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret_v1#example-usage-service-account-token) - -### `image_pull_secret` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) diff --git a/website/docs/d/service_account_v1.html.markdown b/website/docs/d/service_account_v1.html.markdown deleted file mode 100644 index 104bf58934..0000000000 --- a/website/docs/d/service_account_v1.html.markdown +++ /dev/null @@ -1,70 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service_account_v1" -description: |- - A service account provides an identity for processes that run in a Pod. ---- - -# kubernetes_service_account_v1 - -A service account provides an identity for processes that run in a Pod. This data source reads the service account and makes specific attributes available to Terraform. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) - -## Example Usage - -```hcl -data "kubernetes_service_account_v1" "example" { - metadata { - name = "terraform-example" - } -} - -data "kubernetes_secret" "example" { - metadata { - name = "${data.kubernetes_service_account_v1.example.default_secret_name}" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service account's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the service account, must be unique. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service account must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -* `image_pull_secret` - A list of image pull secrets associated with the service account. -* `secret` - A list of secrets associated with the service account. -* `default_secret_name` - (Deprecated) Name of the default secret, containing service account token, created & managed by the service. By default, the provider will try to find the secret containing the service account token that Kubernetes automatically created for the service account. Where there are multiple tokens and the provider cannot determine which was created by Kubernetes, this attribute will be empty. When only one token is associated with the service account, the provider will return this single token secret. - - Starting from version `1.24.0` by default Kubernetes does not automatically generate tokens for service accounts. That leads to the situation when `default_secret_name` cannot be computed and thus will be an empty string. In order to create a service account token, please [use `kubernetes_secret_v1` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret_v1#example-usage-service-account-token) - -### `image_pull_secret` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret` - -#### Attributes - -* `name` - Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) diff --git a/website/docs/d/service_v1.html.markdown b/website/docs/d/service_v1.html.markdown deleted file mode 100644 index a45161fdb8..0000000000 --- a/website/docs/d/service_v1.html.markdown +++ /dev/null @@ -1,113 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service_v1" -description: |- - A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. ---- - -# kubernetes_service_v1 - -A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. -This data source allows you to pull data about such service. - -## Example Usage - -```hcl -data "kubernetes_service_v1" "example" { - metadata { - name = "terraform-example" - } -} - -resource "aws_route53_record" "example" { - zone_id = "data.aws_route53_zone.k8.zone_id" - name = "example" - type = "CNAME" - ttl = "300" - records = [data.kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Attributes - -* `spec` - Spec defines the behavior of a service. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - Name of the service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `annotations` - (Optional) An unstructured key value map stored with the service that may be used to store arbitrary metadata. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `port` - -#### Attributes - -* `app_protocol` - (Optional) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per [RFC-6335](https://datatracker.ietf.org/doc/html/rfc6335) and [IANA standard service names](http://www.iana.org/assignments/service-names)). Non-standard protocols should use prefixed names such as `mycompany.com/my-custom-protocol`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol) -* `name` - The name of this port within the service. All ports within the service must have unique names. Optional if only one ServicePort is defined on this service. -* `node_port` - The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) -* `port` - The port that will be exposed by this service. -* `protocol` - The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. -* `target_port` - Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service) - -### `spec` - -#### Attributes - -* `allocate_load_balancer_node_ports` - (Optional) Defines if `NodePorts` will be automatically allocated for services with type `LoadBalancer`. It may be set to `false` if the cluster load-balancer does not rely on `NodePorts`. If the caller requests specific `NodePorts` (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type `LoadBalancer`. Default is `true`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation) -* `cluster_ip` - The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `cluster_ips` - (Optional) List of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise creation of the service will fail. If this field is not specified, it will be initialized from the `clusterIP` field. If this field is specified, clients must ensure that `clusterIPs[0]` and `clusterIP` have the same value. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `external_ips` - A list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. -* `external_name` - The external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires `type` to be `ExternalName`. -* `external_traffic_policy` - (Optional) Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. For more info see [Kubernetes reference](https://kubernetes.io/docs/tutorials/services/source-ip/) -* `ip_families` - (Optional) A list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the `ip_family_policy` field. If this field is specified manually, the requested family is available in the cluster, and `ip_family_policy` allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) -* `ip_family_policy` - (Optional) Represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to `SingleStack`. Services can be `SingleStack`(a single IP family), `PreferDualStack`(two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or `RequireDualStack`(two IP families on dual-stack configured clusters, otherwise fail). The `ip_families` and `cluster_ip` fields depend on the value of this field. -* `internal_traffic_policy` - (Optional) Specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. `Cluster` routes internal traffic to a Service to all endpoints. `Local` routes traffic to node-local endpoints only, traffic is dropped if no node-local endpoints are ready. The default value is `Cluster`. -* `load_balancer_class` - (Optional) The class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix. This field can only be set when the Service type is `LoadBalancer`. If not set, the default load balancer implementation is used. This field can only be set when creating or updating a Service to type `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class) -* `load_balancer_ip` - Only applies to `type = LoadBalancer`. LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying this field when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. -* `load_balancer_source_ranges` - If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/). -* `port` - The list of ports that are exposed by this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `selector` - Route service traffic to pods with label keys and values matching this selector. Only applies to types `ClusterIP`, `NodePort`, and `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/) -* `session_affinity` - Used to maintain session affinity. Supports `ClientIP` and `None`. Defaults to `None`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `session_affinity_config` - (Optional) Contains the configurations of session affinity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs) -* `type` - Determines how the service is exposed. Defaults to `ClusterIP`. Valid options are `ExternalName`, `ClusterIP`, `NodePort`, and `LoadBalancer`. `ExternalName` maps to the specified `external_name`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) - - -## Attributes - -* `status` - Status is a list containing the most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -### `status` -#### Attributes - -* `load_balancer` - a list containing the current status of the load-balancer, if one is present. - -### `load_balancer` -#### Attributes - -* `ingress` - a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -### `ingress` -#### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). - - diff --git a/website/docs/r/api_service.html.markdown b/website/docs/r/api_service.html.markdown deleted file mode 100644 index a3712b13e2..0000000000 --- a/website/docs/r/api_service.html.markdown +++ /dev/null @@ -1,93 +0,0 @@ ---- -subcategory: "apiregistration/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_api_service" -description: |- - An API Service is an abstraction which defines for locating and communicating with servers. ---- - -# kubernetes_api_service - -An API Service is an abstraction which defines for locating and communicating with servers. - - -## Example Usage - -```hcl -resource "kubernetes_api_service" "example" { - metadata { - name = "terraform-example" - } - spec { - selector { - app = "${kubernetes_pod.example.metadata.0.labels.app}" - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "LoadBalancer" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard API service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec contains information for locating and communicating with a server. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the API service that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the API service. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the API service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this API service that can be used by clients to determine when API service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this API service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `ca_bundle` - (Optional) CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used. -* `group` - (Required) Group is the API group name this server hosts. -* `group_priority_minimum` - (Required) GroupPriorityMininum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMininum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s. -* `insecure_skip_tls_verify` - (Required) InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead. -* `service` - (Optional) Service is a reference to the service for this API server. It must communicate on port 443. If the Service is nil, that means the handling for the API groupversion is handled locally on this server. The call will simply delegate to the normal handler chain to be fulfilled. See `service` block attributes below. -* `version` - (Required) Version is the API version this server hosts. For example, `v1`. -* `version_priority` - (Required) VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is `kube-like`, it will sort above non `kube-like` version strings, which are ordered lexicographically. `Kube-like` versions start with a `v`, then are followed by a number (the major version), then optionally the string `alpha` or `beta` and another number (the minor version). These are sorted first by GA > `beta` > `alpha` (where GA is a version with no suffix such as `beta` or `alpha`), and then by comparing major version, then minor version. An example sorted list of versions: `v10`, `v2`, `v1`, `v11beta2`, `v10beta3`, `v3beta1`, `v12alpha1`, `v11alpha2`, `foo1`, `foo10`.. - -### `service` - -#### Arguments - -* `name` - (Required) Name is the name of the service. -* `namespace` - (Required) Namespace is the namespace of the service. -* `port` - (Optional) If specified, the port on the service that is hosting the service. Defaults to 443 for backward compatibility. Should be a valid port number (1-65535, inclusive). - -## Import - -API service can be imported using its name, e.g. - -``` -$ terraform import kubernetes_api_service.example v1.terraform-name.k8s.io -``` diff --git a/website/docs/r/api_service_v1.html.markdown b/website/docs/r/api_service_v1.html.markdown deleted file mode 100644 index 2b3d3a10af..0000000000 --- a/website/docs/r/api_service_v1.html.markdown +++ /dev/null @@ -1,93 +0,0 @@ ---- -subcategory: "apiregistration/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_api_service_v1" -description: |- - An API Service is an abstraction which defines for locating and communicating with servers. ---- - -# kubernetes_api_service_v1 - -An API Service is an abstraction which defines for locating and communicating with servers. - - -## Example Usage - -```hcl -resource "kubernetes_api_service_v1" "example" { - metadata { - name = "terraform-example" - } - spec { - selector { - app = "${kubernetes_pod.example.metadata.0.labels.app}" - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "LoadBalancer" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard API service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec contains information for locating and communicating with a server. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the API service that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the API service. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the API service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this API service that can be used by clients to determine when API service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this API service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `ca_bundle` - (Optional) CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used. -* `group` - (Required) Group is the API group name this server hosts. -* `group_priority_minimum` - (Required) GroupPriorityMininum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMininum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s. -* `insecure_skip_tls_verify` - (Required) InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead. -* `service` - (Optional) Service is a reference to the service for this API server. It must communicate on port 443. If the Service is nil, that means the handling for the API groupversion is handled locally on this server. The call will simply delegate to the normal handler chain to be fulfilled. See `service` block attributes below. -* `version` - (Required) Version is the API version this server hosts. For example, `v1`. -* `version_priority` - (Required) VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is `kube-like`, it will sort above non `kube-like` version strings, which are ordered lexicographically. `Kube-like` versions start with a `v`, then are followed by a number (the major version), then optionally the string `alpha` or `beta` and another number (the minor version). These are sorted first by GA > `beta` > `alpha` (where GA is a version with no suffix such as `beta` or `alpha`), and then by comparing major version, then minor version. An example sorted list of versions: `v10`, `v2`, `v1`, `v11beta2`, `v10beta3`, `v3beta1`, `v12alpha1`, `v11alpha2`, `foo1`, `foo10`.. - -### `service` - -#### Arguments - -* `name` - (Required) Name is the name of the service. -* `namespace` - (Required) Namespace is the namespace of the service. -* `port` - (Optional) If specified, the port on the service that is hosting the service. Defaults to 443 for backward compatibility. Should be a valid port number (1-65535, inclusive). - -## Import - -API service can be imported using its name, e.g. - -``` -$ terraform import kubernetes_api_service_v1.example v1.terraform-name.k8s.io -``` diff --git a/website/docs/r/certificate_signing_request.html.markdown b/website/docs/r/certificate_signing_request.html.markdown deleted file mode 100644 index 5d5a973581..0000000000 --- a/website/docs/r/certificate_signing_request.html.markdown +++ /dev/null @@ -1,104 +0,0 @@ ---- -subcategory: "certificates/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_certificate_signing_request" -description: |- - Use this resource to generate TLS certificates using Kubernetes. ---- - -# kubernetes_certificate_signing_request - -Use this resource to generate TLS certificates using Kubernetes. - -This is a *logical resource*, so it contributes only to the current Terraform state and does not persist any external managed resources. - -This resource enables automation of [X.509](https://www.itu.int/rec/T-REC-X.509) credential provisioning (including TLS/SSL certificates). It does this by creating a CertificateSigningRequest using the Kubernetes API, which generates a certificate from the Certificate Authority (CA) configured in the Kubernetes cluster. The CSR can be approved automatically by Terraform, or it can be approved by a custom controller running in Kubernetes. See [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/) for all available options pertaining to CertificateSigningRequests. - -## Example Usage - -```hcl -resource "kubernetes_certificate_signing_request" "example" { - metadata { - name = "example" - } - spec { - usages = ["client auth", "server auth"] - request = < By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the certificate signing request. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the certificate signing request, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `certificate` - The signed certificate PEM data. -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this certificate signing request that can be used by clients to determine when certificate signing request has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this certificate signing request. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `request` - (Required) Base64-encoded PKCS#10 CSR data. -* `signer_name` - (Optional) Requested signer for the request. It is a qualified name in the form: `scope-hostname.io/name`. If empty, it will be defaulted: 1. If it's a kubelet client certificate, it is assigned "kubernetes.io/kube-apiserver-client-kubelet". 2. If it's a kubelet serving certificate, it is assigned "kubernetes.io/kubelet-serving". 3. Otherwise, it is assigned "kubernetes.io/legacy-unknown". Distribution of trust for signers happens out of band. -* `usages` - (Required) Specifies a set of usage contexts the key will be valid for. See https://godoc.org/k8s.io/api/certificates/v1beta1#KeyUsage - -## Generating a New Certificate - -Since the certificate is a logical resource that lives only in the Terraform state, -it will persist until it is explicitly destroyed by the user. - -In order to force the generation of a new certificate within an existing state, the -certificate instance can be "tainted": - -``` -terraform taint kubernetes_certificate_signing_request.example -``` - -A new certificate will then be generated on the next ``terraform apply``. diff --git a/website/docs/r/certificate_signing_request_v1.html.markdown b/website/docs/r/certificate_signing_request_v1.html.markdown deleted file mode 100644 index 884d354ec5..0000000000 --- a/website/docs/r/certificate_signing_request_v1.html.markdown +++ /dev/null @@ -1,107 +0,0 @@ ---- -subcategory: "certificates/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_certificate_signing_request_v1" -description: |- - Use this resource to generate TLS certificates using Kubernetes. ---- - -# kubernetes_certificate_signing_request_v1 - -Use this resource to generate TLS certificates using Kubernetes. - -This is a *logical resource*, so it contributes only to the current Terraform state and does not persist any external managed resources. - -This resource enables automation of [X.509](https://www.itu.int/rec/T-REC-X.509) credential provisioning (including TLS/SSL certificates). It does this by creating a CertificateSigningRequest using the Kubernetes API, which generates a certificate from the Certificate Authority (CA) configured in the Kubernetes cluster. The CSR can be approved automatically by Terraform, or it can be approved by a custom controller running in Kubernetes. See [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/) for all available options pertaining to CertificateSigningRequests. - -## Example Usage - -```hcl -resource "kubernetes_certificate_signing_request_v1" "example" { - metadata { - name = "example" - } - spec { - usages = ["client auth", "server auth"] - signer_name = "kubernetes.io/kube-apiserver-client" - - request = < By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the certificate signing request. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the certificate signing request, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `certificate` - The signed certificate PEM data. -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this certificate signing request that can be used by clients to determine when certificate signing request has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this certificate signing request. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `request` - (Required) Base64-encoded PKCS#10 CSR data. -* `signer_name` - (Required) Indicates the requested signer, and is a qualified name. See https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers -* `usages` - (Required) Specifies a set of usage contexts the key will be valid for. See https://godoc.org/k8s.io/api/certificates/v1#KeyUsage - -## Generating a New Certificate - -Since the certificate is a logical resource that lives only in the Terraform state, -it will persist until it is explicitly destroyed by the user. - -In order to force the generation of a new certificate within an existing state, the -certificate instance can be "tainted": - -``` -terraform taint kubernetes_certificate_signing_request_v1.example -``` - -A new certificate will then be generated on the next ``terraform apply``. diff --git a/website/docs/r/cluster_role.html.markdown b/website/docs/r/cluster_role.html.markdown deleted file mode 100644 index 78fb3c0a25..0000000000 --- a/website/docs/r/cluster_role.html.markdown +++ /dev/null @@ -1,115 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_cluster_role" -description: |- - A ClusterRole creates a role at the cluster level and in all namespaces. ---- - -# kubernetes_cluster_role - -A ClusterRole creates a role at the cluster level and in all namespaces. - -## Example Usage - -```hcl -resource "kubernetes_cluster_role" "example" { - metadata { - name = "terraform-example" - } - - rule { - api_groups = [""] - resources = ["namespaces", "pods"] - verbs = ["get", "list", "watch"] - } -} -``` - -## Aggregation Rule Example Usage - -```hcl -resource "kubernetes_cluster_role" "example" { - metadata { - name = "terraform-example" - } - - aggregation_rule { - cluster_role_selectors { - match_labels = { - foo = "bar" - } - - match_expressions { - key = "environment" - operator = "In" - values = ["non-exists-12345"] - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard kubernetes metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `rule` - (Optional) The PolicyRoles for this ClusterRole. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) -* `aggregation_rule` - (Optional) Describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be overwritten by the controller. -. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the cluster role binding that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the cluster role binding. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the cluster role binding, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this object that can be used by clients to determine when the object has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this cluster role binding. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `rule` - -#### Arguments - -* `api_groups` - (Optional) APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. -* `non_resource_urls` - (Optional) NonResourceURLs is a set of partial urls that a user should have access to. \*s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. -* `resource_names` - (Optional) ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. -* `resources` - (Optional) Resources is a list of resources this rule applies to. ResourceAll represents all resources. -* `verbs` - (Required) Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. - -### `aggregation_rule` - -#### Arguments - -* `cluster_role_selectors` - (Optional) A list of selectors which will be used to find ClusterRoles and create the rules. - -### `cluster_role_selectors` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) 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. - - -## Import - -ClusterRole can be imported using the name, e.g. - -``` -$ terraform import kubernetes_cluster_role.example terraform-name -``` diff --git a/website/docs/r/cluster_role_binding.html.markdown b/website/docs/r/cluster_role_binding.html.markdown deleted file mode 100644 index 3b9fa328b2..0000000000 --- a/website/docs/r/cluster_role_binding.html.markdown +++ /dev/null @@ -1,99 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_cluster_role_binding" -description: |- - A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. ---- - -# kubernetes_cluster_role_binding - -A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces - - -## Example Usage - -```hcl -resource "kubernetes_cluster_role_binding" "example" { - metadata { - name = "terraform-example" - } - role_ref { - api_group = "rbac.authorization.k8s.io" - kind = "ClusterRole" - name = "cluster-admin" - } - subject { - kind = "User" - name = "admin" - api_group = "rbac.authorization.k8s.io" - } - subject { - kind = "ServiceAccount" - name = "default" - namespace = "kube-system" - } - subject { - kind = "Group" - name = "system:masters" - api_group = "rbac.authorization.k8s.io" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard kubernetes metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `role_ref` - (Required) The ClusterRole to bind Subjects to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding) -* `subject` - (Required) The Users, Groups, or ServiceAccounts to grant permissions to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-subjects) - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the cluster role binding that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the cluster role binding. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the cluster role binding, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this object that can be used by clients to determine when the object has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this cluster role binding. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `role_ref` - -#### Arguments - -* `name` - (Required) The name of this ClusterRole to bind Subjects to. -* `kind` - (Required) The type of binding to use. This value must be and defaults to `ClusterRole` -* `api_group` - (Required) The API group to drive authorization decisions. This value must be and defaults to `rbac.authorization.k8s.io` - -### `subject` - -#### Arguments - -* `name` - (Required) The name of this ClusterRole to bind Subjects to. -* `namespace` - (Optional) Namespace defines the namespace of the ServiceAccount to bind to. This value only applies to kind `ServiceAccount` -* `kind` - (Required) The type of binding to use. This value must be `ServiceAccount`, `User` or `Group` -* `api_group` - (Required) The API group to drive authorization decisions. This value only applies to kind `User` and `Group`. It must be `rbac.authorization.k8s.io` - -## Import - -ClusterRoleBinding can be imported using the name, e.g. - -``` -$ terraform import kubernetes_cluster_role_binding.example terraform-name -``` diff --git a/website/docs/r/cluster_role_binding_v1.html.markdown b/website/docs/r/cluster_role_binding_v1.html.markdown deleted file mode 100644 index 68f268c55e..0000000000 --- a/website/docs/r/cluster_role_binding_v1.html.markdown +++ /dev/null @@ -1,99 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_cluster_role_binding_v1" -description: |- - A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces. ---- - -# kubernetes_cluster_role_binding_v1 - -A ClusterRoleBinding may be used to grant permission at the cluster level and in all namespaces - - -## Example Usage - -```hcl -resource "kubernetes_cluster_role_binding_v1" "example" { - metadata { - name = "terraform-example" - } - role_ref { - api_group = "rbac.authorization.k8s.io" - kind = "ClusterRole" - name = "cluster-admin" - } - subject { - kind = "User" - name = "admin" - api_group = "rbac.authorization.k8s.io" - } - subject { - kind = "ServiceAccount" - name = "default" - namespace = "kube-system" - } - subject { - kind = "Group" - name = "system:masters" - api_group = "rbac.authorization.k8s.io" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard kubernetes metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `role_ref` - (Required) The ClusterRole to bind Subjects to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding) -* `subject` - (Required) The Users, Groups, or ServiceAccounts to grant permissions to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-subjects) - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the cluster role binding that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the cluster role binding. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the cluster role binding, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this object that can be used by clients to determine when the object has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this cluster role binding. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `role_ref` - -#### Arguments - -* `name` - (Required) The name of this ClusterRole to bind Subjects to. -* `kind` - (Required) The type of binding to use. This value must be and defaults to `ClusterRole` -* `api_group` - (Required) The API group to drive authorization decisions. This value must be and defaults to `rbac.authorization.k8s.io` - -### `subject` - -#### Arguments - -* `name` - (Required) The name of this ClusterRole to bind Subjects to. -* `namespace` - (Optional) Namespace defines the namespace of the ServiceAccount to bind to. This value only applies to kind `ServiceAccount` -* `kind` - (Required) The type of binding to use. This value must be `ServiceAccount`, `User` or `Group` -* `api_group` - (Required) The API group to drive authorization decisions. This value only applies to kind `User` and `Group`. It must be `rbac.authorization.k8s.io` - -## Import - -ClusterRoleBinding can be imported using the name, e.g. - -``` -$ terraform import kubernetes_cluster_role_binding_v1.example terraform-name -``` diff --git a/website/docs/r/cluster_role_v1.html.markdown b/website/docs/r/cluster_role_v1.html.markdown deleted file mode 100644 index 8eb802b100..0000000000 --- a/website/docs/r/cluster_role_v1.html.markdown +++ /dev/null @@ -1,115 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_cluster_role_v1" -description: |- - A ClusterRole creates a role at the cluster level and in all namespaces. ---- - -# kubernetes_cluster_role_v1 - -A ClusterRole creates a role at the cluster level and in all namespaces. - -## Example Usage - -```hcl -resource "kubernetes_cluster_role_v1" "example" { - metadata { - name = "terraform-example" - } - - rule { - api_groups = [""] - resources = ["namespaces", "pods"] - verbs = ["get", "list", "watch"] - } -} -``` - -## Aggregation Rule Example Usage - -```hcl -resource "kubernetes_cluster_role_v1" "example" { - metadata { - name = "terraform-example" - } - - aggregation_rule { - cluster_role_selectors { - match_labels = { - foo = "bar" - } - - match_expressions { - key = "environment" - operator = "In" - values = ["non-exists-12345"] - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard kubernetes metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `rule` - (Optional) The PolicyRoles for this ClusterRole. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) -* `aggregation_rule` - (Optional) Describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be overwritten by the controller. -. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the cluster role binding that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the cluster role binding. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the cluster role binding, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this object that can be used by clients to determine when the object has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this cluster role binding. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `rule` - -#### Arguments - -* `api_groups` - (Optional) APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. -* `non_resource_urls` - (Optional) NonResourceURLs is a set of partial urls that a user should have access to. \*s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. -* `resource_names` - (Optional) ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. -* `resources` - (Optional) Resources is a list of resources this rule applies to. '\*' represents all resources. -* `verbs` - (Required) Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '\*' represents all kinds. - -### `aggregation_rule` - -#### Arguments - -* `cluster_role_selectors` - (Optional) A list of selectors which will be used to find ClusterRoles and create the rules. - -### `cluster_role_selectors` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) 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. - - -## Import - -ClusterRole can be imported using the name, e.g. - -``` -$ terraform import kubernetes_cluster_role_v1.example terraform-name -``` diff --git a/website/docs/r/config_map.html.markdown b/website/docs/r/config_map.html.markdown deleted file mode 100644 index 5d06373a3c..0000000000 --- a/website/docs/r/config_map.html.markdown +++ /dev/null @@ -1,73 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_config_map" -description: |- - The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. ---- - -# kubernetes_config_map - -The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. -Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs. - -## Example Usage - -```hcl -resource "kubernetes_config_map" "example" { - metadata { - name = "my-config" - } - - data = { - api_host = "myhost:443" - db_host = "dbhost:5432" - "my_config_file.yml" = "${file("${path.module}/my_config_file.yml")}" - } - - binary_data = { - "my_payload.bin" = "${filebase64("${path.module}/my_payload.bin")}" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `binary_data` - (Optional) BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. This field only accepts base64-encoded payloads that will be decoded/received before being sent/received to the apiserver. -* `data` - (Optional) Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process. -* `immutable` - (Optional) Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. -* `metadata` - (Required) Standard config map's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the config map that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the config map. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the config map, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the config map must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this config map. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -Config Map can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_config_map.example default/my-config -``` diff --git a/website/docs/r/config_map_v1.html.markdown b/website/docs/r/config_map_v1.html.markdown deleted file mode 100644 index f64f491295..0000000000 --- a/website/docs/r/config_map_v1.html.markdown +++ /dev/null @@ -1,73 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_config_map_v1" -description: |- - The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. ---- - -# kubernetes_config_map_v1 - -The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. -Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs. - -## Example Usage - -```hcl -resource "kubernetes_config_map_v1" "example" { - metadata { - name = "my-config" - } - - data = { - api_host = "myhost:443" - db_host = "dbhost:5432" - "my_config_file.yml" = "${file("${path.module}/my_config_file.yml")}" - } - - binary_data = { - "my_payload.bin" = "${filebase64("${path.module}/my_payload.bin")}" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `binary_data` - (Optional) BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. This field only accepts base64-encoded payloads that will be decoded/received before being sent/received to the apiserver. -* `data` - (Optional) Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process. -* `immutable` - (Optional) Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. -* `metadata` - (Required) Standard config map's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the config map that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the config map. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the config map, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the config map must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this config map. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -Config Map can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_config_map_v1.example default/my-config -``` diff --git a/website/docs/r/cron_job.html.markdown b/website/docs/r/cron_job.html.markdown deleted file mode 100644 index adb9dc6915..0000000000 --- a/website/docs/r/cron_job.html.markdown +++ /dev/null @@ -1,169 +0,0 @@ ---- -subcategory: "batch/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_cron_job" -description: |- - A Cron Job creates Jobs on a time-based schedule. One CronJob object is like one line of a crontab (cron table) file. ---- - -# kubernetes_cron_job - - A Cron Job creates Jobs on a time-based schedule. - - One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format. - - Note: All CronJob `schedule` times are based on the timezone of the master where the job is initiated. - For instructions on creating and working with cron jobs, and for an example of a spec file for a cron job, see [Kubernetes reference](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/). - -~> NOTE: With the release of Kubernetes v1.25, CronJob batch/v1beta1 has been removed. You can read more information about migrating to batch/v1 in the [Kubernetes 1.25 migration guide](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#cronjob-v125). - -## Example Usage - -```hcl -resource "kubernetes_cron_job" "demo" { - metadata { - name = "demo" - } - spec { - concurrency_policy = "Replace" - failed_jobs_history_limit = 5 - schedule = "1 0 * * *" - starting_deadline_seconds = 10 - successful_jobs_history_limit = 10 - job_template { - metadata {} - spec { - backoff_limit = 2 - ttl_seconds_after_finished = 10 - template { - metadata {} - spec { - container { - name = "hello" - image = "busybox" - command = ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"] - } - } - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource's metadata. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `spec` - (Required) Spec defines the behavior of a CronJob. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `concurrency_policy` - (Optional) Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one -* `failed_jobs_history_limit` - (Optional) The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. -* `job_template` - (Required) Specifies the job that will be created when executing a CronJob. -* `schedule` - (Required) The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. -* `starting_deadline_seconds` - (Optional) Deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. -* `successful_jobs_history_limit` - (Optional) The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3. -* `suspend` - (Optional) This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. - -### `job_template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata of the jobs created from this template. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Specification of the desired behavior of the job. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -### `metadata` - -These arguments are the same as the for the `metadata` block of a Pod with a few exceptions: - -* When `spec.template.metadata.namespace` does not have a default value, it is empty if not set. - -* The `spec.template.metadata.namespace` is a stub field that does not affect the namespace in which the Pod will be created. The Pod will be created in the same namespace as the main resource. However, modifying this field will force the resource recreation. - -### `spec` - -#### Arguments - -* `active_deadline_seconds` - (Optional) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. -* `backoff_limit` - (Optional) Specifies the number of retries before marking this job failed. Defaults to 6 -* `completions` - (Optional) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `manual_selector` - (Optional) Controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector -* `pod_failure_policy` - (Optional) Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure. -* `parallelism` - (Optional) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when `((.spec.completions - .status.successful) < .spec.parallelism)`, i.e. when the work left to do is less than max parallelism. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `selector` - (Optional) A label query over pods that should match the pod count. Normally, the system sets this field for you. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors -* `template` - (Optional) Describes the pod that will be created when executing a job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `ttl_seconds_after_finished` - (Optional) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. - -### `pod_failure_policy` - -#### Arguments - -* `rule` - (Required) A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. - -### `rule` - -#### Arguments - -* `action` - (Optional) Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. -* `on_exit_codes` - (Optional) Represents the requirement on the container exit codes. -* `on_pod_condition` - (Optional) Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. - -### `on_exit_codes` - -#### Arguments - -* `container_name` - (Optional) Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template. -* `operator` - (Optional) Represents the relationship between the container exit code(s) and the specified values. -* `values` - (Required) Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. - -### `on_pod_condition` - -#### Arguments - -* `status` - (Optional) Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True. -* `type` - (Optional) Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type. - - -### `selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) 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. - -### `template` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod.html#spec) for reference. diff --git a/website/docs/r/cron_job_v1.html.markdown b/website/docs/r/cron_job_v1.html.markdown deleted file mode 100644 index b7503f73b9..0000000000 --- a/website/docs/r/cron_job_v1.html.markdown +++ /dev/null @@ -1,168 +0,0 @@ ---- -subcategory: "batch/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_cron_job_v1" -description: |- - A Cron Job creates Jobs on a time-based schedule. One CronJob object is like one line of a crontab (cron table) file. ---- - -# kubernetes_cron_job_v1 - - A Cron Job creates Jobs on a time-based schedule. - - One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format. - - Note: All CronJob `schedule` times are based on the timezone of the master where the job is initiated. - For instructions on creating and working with cron jobs, and for an example of a spec file for a cron job, see [Kubernetes reference](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/). - -## Example Usage - -```hcl -resource "kubernetes_cron_job_v1" "demo" { - metadata { - name = "demo" - } - spec { - concurrency_policy = "Replace" - failed_jobs_history_limit = 5 - schedule = "1 0 * * *" - timezone = "Etc/UTC" - starting_deadline_seconds = 10 - successful_jobs_history_limit = 10 - job_template { - metadata {} - spec { - backoff_limit = 2 - ttl_seconds_after_finished = 10 - template { - metadata {} - spec { - container { - name = "hello" - image = "busybox" - command = ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"] - } - } - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource's metadata. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `spec` - (Required) Spec defines the behavior of a CronJob. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `concurrency_policy` - (Optional) Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one -* `failed_jobs_history_limit` - (Optional) The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. -* `job_template` - (Required) Specifies the job that will be created when executing a CronJob. -* `schedule` - (Required) The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. -* `timezone` - (Optional) The time zone for the given schedule. If not specified, this will rely on the time zone of the kube-controller-manager process. -* `starting_deadline_seconds` - (Optional) Deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. -* `successful_jobs_history_limit` - (Optional) The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3. -* `suspend` - (Optional) This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. - -### `job_template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata of the jobs created from this template. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Specification of the desired behavior of the job. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -### `metadata` - -These arguments are the same as the for the `metadata` block of a Pod with a few exceptions: - -* When `spec.template.metadata.namespace` does not have a default value, it is empty if not set. - -* The `spec.template.metadata.namespace` is a stub field that does not affect the namespace in which the Pod will be created. The Pod will be created in the same namespace as the main resource. However, modifying this field will force the resource recreation. - -### `spec` - -#### Arguments - -* `active_deadline_seconds` - (Optional) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. -* `backoff_limit` - (Optional) Specifies the number of retries before marking this job failed. Defaults to 6 -* `completions` - (Optional) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `manual_selector` - (Optional) Controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector -* `pod_failure_policy` - (Optional) Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure. -* `parallelism` - (Optional) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when `((.spec.completions - .status.successful) < .spec.parallelism)`, i.e. when the work left to do is less than max parallelism. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `selector` - (Optional) A label query over pods that should match the pod count. Normally, the system sets this field for you. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors -* `template` - (Optional) Describes the pod that will be created when executing a job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `ttl_seconds_after_finished` - (Optional) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. - -### `pod_failure_policy` - -#### Arguments - -* `rule` - (Required) A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. - -### `rule` - -#### Arguments - -* `action` - (Optional) Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. -* `on_exit_codes` - (Optional) Represents the requirement on the container exit codes. -* `on_pod_condition` - (Optional) Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. - -### `on_exit_codes` - -#### Arguments - -* `container_name` - (Optional) Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template. -* `operator` - (Optional) Represents the relationship between the container exit code(s) and the specified values. -* `values` - (Required) Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. - -### `on_pod_condition` - -#### Arguments - -* `status` - (Optional) Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True. -* `type` - (Optional) Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type. - -### `selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) 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. - -### `template` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod.html#spec) for reference. diff --git a/website/docs/r/csi_driver.html.markdown b/website/docs/r/csi_driver.html.markdown deleted file mode 100644 index ce0ae556d8..0000000000 --- a/website/docs/r/csi_driver.html.markdown +++ /dev/null @@ -1,73 +0,0 @@ ---- -subcategory: "storage/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_csi_driver" -description: |- - The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. ---- - -# kubernetes_csi_driver - -The [Container Storage Interface](https://kubernetes-csi.github.io/docs/introduction.html) -(CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container -Orchestration Systems (COs) like Kubernetes. - -## Example Usage - -```hcl -resource "kubernetes_csi_driver" "example" { - metadata { - name = "terraform-example" - } - - spec { - attach_required = true - pod_info_on_mount = true - volume_lifecycle_modes = ["Ephemeral"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard CSI driver's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) The Specification of the CSI Driver. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the csi driver that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the csi driver. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -### `spec` - -#### Arguments - -* `attach_required` - (Required) Indicates if the CSI volume driver requires an attachment operation. -* `pod_info_on_mount` - (Optional) Indicates that the CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. -* `volume_lifecycle_modes` - (Optional) A list of volume types the CSI volume driver supports. values can be `Persistent` and `Ephemeral`. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this csi driver that can be used by clients to determine when csi driver has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this csi driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -kubernetes_csi_driver can be imported using its name, e.g. - -``` -$ terraform import kubernetes_csi_driver.example terraform-example -``` diff --git a/website/docs/r/csi_driver_v1.html.markdown b/website/docs/r/csi_driver_v1.html.markdown deleted file mode 100644 index c70c879edd..0000000000 --- a/website/docs/r/csi_driver_v1.html.markdown +++ /dev/null @@ -1,73 +0,0 @@ ---- -subcategory: "storage/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_csi_driver_v1" -description: |- - The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container Orchestration Systems (COs) like Kubernetes. ---- - -# kubernetes_csi_driver_v1 - -The [Container Storage Interface](https://kubernetes-csi.github.io/docs/introduction.html) -(CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Container -Orchestration Systems (COs) like Kubernetes. - -## Example Usage - -```hcl -resource "kubernetes_csi_driver_v1" "example" { - metadata { - name = "terraform-example" - } - - spec { - attach_required = true - pod_info_on_mount = true - volume_lifecycle_modes = ["Ephemeral"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard CSI driver's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) The Specification of the CSI Driver. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the csi driver that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the csi driver. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -### `spec` - -#### Arguments - -* `attach_required` - (Required) Indicates if the CSI volume driver requires an attachment operation. -* `pod_info_on_mount` - (Optional) Indicates that the CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations. -* `volume_lifecycle_modes` - (Optional) A list of volume types the CSI volume driver supports. values can be `Persistent` and `Ephemeral`. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this csi driver that can be used by clients to determine when csi driver has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this csi driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -kubernetes_csi_driver_v1 can be imported using its name, e.g. - -``` -$ terraform import kubernetes_csi_driver_v1.example terraform-example -``` diff --git a/website/docs/r/daemon_set_v1.html.markdown b/website/docs/r/daemon_set_v1.html.markdown deleted file mode 100644 index 7891961f1b..0000000000 --- a/website/docs/r/daemon_set_v1.html.markdown +++ /dev/null @@ -1,898 +0,0 @@ ---- -subcategory: "apps/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_daemon_set_v1" -description: |- - A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. ---- - -# kubernetes_daemon_set_v1 - -A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. - -## Example Usage - -```hcl -resource "kubernetes_daemon_set_v1" "example" { - metadata { - name = "terraform-example" - namespace = "something" - labels = { - test = "MyExampleApp" - } - } - - spec { - selector { - match_labels = { - test = "MyExampleApp" - } - } - - template { - metadata { - labels = { - test = "MyExampleApp" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - resources { - limits = { - cpu = "0.5" - memory = "512Mi" - } - requests = { - cpu = "250m" - memory = "50Mi" - } - } - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard daemonset's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the daemonset. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_rollout` - (Optional) Wait for the deployment to successfully roll out. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the deployment. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). **Must match `selector`**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the deployment, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the deployment must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this deployment. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `min_ready_seconds` - (Optional) 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) -* `revision_history_limit` - (Optional) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. -* `strategy` - (Optional) The update strategy to use to replace existing pods with new ones. -* `selector` - (Optional) A label query over pods that should match the Replicas count. Label keys and values that must match in order to be controlled by this deployment. **Must match labels (`metadata.0.labels`)**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) -* `template` - (Required) Describes the pod that will be created per Node. This takes precedence over a TemplateRef. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template) - -### `strategy` - -#### Arguments - -* `type` - Type of daemon set update. Can be 'RollingUpdate' or 'OnDelete'. Default is 'RollingUpdate'. -* `rolling_update` - Rolling update config params. Present only if type = 'RollingUpdate'. - -### `rolling_update` - -#### Arguments - -* `max_unavailable` - The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update. - -### `template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata. For more info see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata. -* `spec` - (Required) Specification of the desired behavior of the pod. For more info see https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - -### template `metadata` - -These arguments are the same as the for the `metadata` block of a Pod with a few exceptions: - -* When `spec.template.metadata.namespace` does not have a default value, it is empty if not set. - -* The `spec.template.metadata.namespace` is a stub field that does not affect the namespace in which the Pod will be created. The Pod will be created in the same namespace as the main resource. However, modifying this field will force the resource recreation. - -Please see the [Pod resource](pod_v1.html#metadata) for reference. - -### template `spec` - -#### Arguments - -* `affinity` - (Optional) A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - (Optional) 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. -* `automount_service_account_token` - (Optional) Indicates whether a service account token should be automatically mounted. Defaults to `true`. -* `container` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `init_container` - (Optional) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - (Optional) Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - (Optional) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `enable_service_links` - (Optional) Enables generating environment variables for service discovery. Optional: Defaults to true. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service). -* `host_aliases` - (Optional) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_aliases` block definition below. -* `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - (Optional) 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. -* `host_pid` - (Optional) Use the host's pid namespace. -* `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - (Optional) 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. -* `node_selector` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `priority_class_name` - (Optional) 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. -* `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/. -* `share_process_namespace` - (Optional) 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. -* `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - (Optional) 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 delete immediately. 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. -* `toleration` - (Optional) Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) - -### `affinity` - -#### Arguments - -* `node_affinity` - (Optional) Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - -### `node_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -## `node_selector_term` - -#### Arguments - - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `preference` - (Required) A node selector term, associated with the corresponding weight. - -* `weight` - (Required) Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - -### `preference` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -## `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `pod_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `pod_anti_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` (pod_affinity_term) - -#### Arguments - -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. -* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace" -* `topology_key` - (Required) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `pod_affinity_term` - (Required) A pod affinity term, associated with the corresponding weight. -* `weight` - (Required) Weight associated with matching the corresponding `pod_affinity_term`, in the range 1-100. - -### `container` - -#### Arguments - -* `args` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - (Optional) Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - (Optional) 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. -* `image` - (Optional) Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - (Optional) 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. -* `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - (Optional) Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - (Optional) Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `startup_probe` - (Optional) 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. For more info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.17** -* `stdin` - (Optional) 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. -* `stdin_once` - (Optional) 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. -* `termination_message_path` - (Optional) 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. Defaults to /dev/termination-log. Cannot be updated. -* `tty` - (Optional) Whether this container should allocate a TTY for itself -* `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - (Optional) 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. - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `capabilities` - -#### Arguments - -* `add` - (Optional) Added capabilities -* `drop` - (Optional) Removed capabilities - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is / -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `config_map` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `optional` - (Optional) Specify whether the ConfigMap or its keys must be defined. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap or its key must be defined - -### `dns_config` - -#### Arguments - -* `nameservers` - (Optional) A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - (Optional) A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - (Optional) A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - (Required) Name of the option. -* `value` - (Optional) Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Arguments - -* `medium` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `env_from` - -#### Arguments - -* `config_map_ref` - (Optional) The ConfigMap to select from -* `prefix` - (Optional) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - (Optional) The Secret to select from - -### `exec` - -#### Arguments - -* `command` - (Optional) 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. 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. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `git_repo` - -#### Arguments - -* `directory` - (Optional) 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. -* `repository` - (Optional) Repository URL -* `revision` - (Optional) Commit hash for the specified revision. - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `grpc` - -#### Arguments - -* `port` - (Required) Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - (Optional) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `host_aliases` - -#### Arguments - -* `hostnames` - (Required) Array of hostnames for the IP address. -* `ip` - (Required) IP address of the host file entry. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `http_get` - -#### Arguments - -* `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. -* `http_header` - (Optional) Scheme to use for connecting to the host. -* `path` - (Optional) Path to access on the HTTP server. -* `port` - (Optional) 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. -* `scheme` - (Optional) Scheme to use for connecting to the host. - -### `http_header` - -#### Arguments - -* `name` - (Optional) The header field name -* `value` - (Optional) The header field value - -### `image_pull_secrets` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `items` - -#### Arguments - -* `key` - (Optional) The key to project. -* `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. -* `path` - (Optional) 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 '..'. - -### `lifecycle` - -#### Arguments - -* `post_start` - (Optional) post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `liveness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Arguments - -* `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `port` - -#### Arguments - -* `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - (Optional) What host IP to bind the external port to. -* `host_port` - (Optional) 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. -* `name` - (Optional) 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 -* `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. - -### `readiness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Arguments - -* `level` - (Optional) Level is SELinux level label that applies to the container. -* `role` - (Optional) Role is a SELinux role label that applies to the container. -* `type` - (Optional) Type is a SELinux type label that applies to the container. -* `user` - (Optional) User is a SELinux user label that applies to the container. - -### `secret` - -#### Arguments - -* `default_mode` - (Optional) Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - (Optional) Specify whether the Secret or its keys must be defined. -* `secret_name` - (Optional) Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - (Required) The key to project. -* `mode` - (Optional) Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - (Required) 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 '..'. - -### `secret_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) 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 -* `capabilities` - (Optional) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - (Optional) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - (Optional) Whether this container has a read-only root filesystem. Default is false. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. - -### `capabilities` - -#### Arguments - -* `add` - (Optional) A list of added capabilities. -* `drop` - (Optional) A list of removed capabilities. - -### pod `security_context` - -#### Arguments - -* `fs_group` - (Optional) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `supplemental_groups` - (Optional) 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. -* `sysctl` - (Optional) holds a list of namespaced sysctls used for the pod. see [Sysctl](#sysctl) block. See [official docs](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - -##### Sysctl - -* `name` - (Required) Name of a property to set. -* `value` - (Required) Value of a property to set. - -### `tcp_socket` - -#### Arguments - -* `port` - (Required) 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. - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `toleration` - -#### Arguments - -* `effect` - (Optional) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. -* `key` - (Optional) 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. -* `operator` - (Optional) 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. -* `toleration_seconds` - (Optional) 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. -* `value` - (Optional) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - -### `projected` - -#### Arguments - -* `default_mode` - (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. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. -* `sources` - (Required) List of volume projection sources - -### `sources` - -#### Arguments - -* `config_map` - (Optional) Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. -* `downward_api` - (Optional) Represents downward API info for projecting into a projected volume. Note that this is identical to a downward_api volume source without the default mode. -* `secret` - (Optional) Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. -* `service_account_token` - (Optional) Represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). - -### `service_account_token` - -#### Arguments - -* `audience` - (Optional) 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. -* `expiration_seconds` - (Optional) 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. -* `path` - (Required) Path is the path relative to the mount point of the file to project the token into. - -### `volume` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume -* `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume -* `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `ephemeral` - (Optional) Represents an ephemeral volume that is handled by a normal storage driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes) -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `persistent_volume_claim` - (Optional) The specification of a persistent volume. -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `projected` (Optional) Items for all in one resources secrets, configmaps, and downward API. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `secret` - (Optional) Secret represents a secret that should populate this volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - -### `volume_mount` - -#### Arguments - -* `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - (Required) This must match the Name of a Volume. -* `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - (Optional) Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -### `ephemeral` - -#### Arguments - -* `volume_claim_template` - (Required) 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. - -### `volume_claim_template` - -#### Arguments - -* `metadata` - (Optional) 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. -* `spec` - (Required) Please see the [persistent_volume_claim_v1 resource](persistent_volume_claim_v1.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_daemon_set_v1` resource: - -* `create` - (Default `10 minutes`) Used for creating new controller -* `update` - (Default `10 minutes`) Used for updating a controller -* `delete` - (Default `10 minutes`) Used for destroying a controller - -## Import - -DaemonSet can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_daemon_set_v1.example default/terraform-example -``` diff --git a/website/docs/r/daemonset.html.markdown b/website/docs/r/daemonset.html.markdown deleted file mode 100644 index 0ba9d9382f..0000000000 --- a/website/docs/r/daemonset.html.markdown +++ /dev/null @@ -1,910 +0,0 @@ ---- -subcategory: "apps/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_daemonset" -description: |- - A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. ---- - -# kubernetes_daemonset - -A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created. - -## Example Usage - -```hcl -resource "kubernetes_daemonset" "example" { - metadata { - name = "terraform-example" - namespace = "something" - labels = { - test = "MyExampleApp" - } - } - - spec { - selector { - match_labels = { - test = "MyExampleApp" - } - } - - template { - metadata { - labels = { - test = "MyExampleApp" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - resources { - limits = { - cpu = "0.5" - memory = "512Mi" - } - requests = { - cpu = "250m" - memory = "50Mi" - } - } - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard daemonset's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the daemonset. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_rollout` - (Optional) Wait for the deployment to successfully roll out. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the deployment. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). **Must match `selector`**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the deployment, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the deployment must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this deployment. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `min_ready_seconds` - (Optional) 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) -* `revision_history_limit` - (Optional) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. -* `strategy` - (Optional) The update strategy to use to replace existing pods with new ones. -* `selector` - (Optional) A label query over pods that should match the Replicas count. Label keys and values that must match in order to be controlled by this deployment. **Must match labels (`metadata.0.labels`)**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) -* `template` - (Required) Describes the pod that will be created per Node. This takes precedence over a TemplateRef. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template) - -### `strategy` - -#### Arguments - -* `type` - Type of daemon set update. Can be 'RollingUpdate' or 'OnDelete'. Default is 'RollingUpdate'. -* `rolling_update` - Rolling update config params. Present only if type = 'RollingUpdate'. - -### `rolling_update` - -#### Arguments - -* `max_unavailable` - The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update. - -### `template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata. For more info see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata. -* `spec` - (Required) Specification of the desired behavior of the pod. For more info see https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - -### template `metadata` - -These arguments are the same as the for the `metadata` block of a Pod with a few exceptions: - -* When `spec.template.metadata.namespace` does not have a default value, it is empty if not set. - -* The `spec.template.metadata.namespace` is a stub field that does not affect the namespace in which the Pod will be created. The Pod will be created in the same namespace as the main resource. However, modifying this field will force the resource recreation. - -Please see the [Pod resource](pod_v1.html#metadata) for reference. - -### template `spec` - -#### Arguments - -* `affinity` - (Optional) A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - (Optional) 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. -* `automount_service_account_token` - (Optional) Indicates whether a service account token should be automatically mounted. Defaults to `true`. -* `container` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `init_container` - (Optional) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - (Optional) Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - (Optional) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `enable_service_links` - (Optional) Enables generating environment variables for service discovery. Optional: Defaults to true. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service). -* `host_aliases` - (Optional) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_aliases` block definition below. -* `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - (Optional) 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. -* `host_pid` - (Optional) Use the host's pid namespace. -* `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - (Optional) 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. -* `node_selector` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `priority_class_name` - (Optional) 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. -* `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/. -* `share_process_namespace` - (Optional) 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. -* `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - (Optional) 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 delete immediately. 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. -* `toleration` - (Optional) Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) - -### `affinity` - -#### Arguments - -* `node_affinity` - (Optional) Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - -### `node_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -## `node_selector_term` - -#### Arguments - - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `preference` - (Required) A node selector term, associated with the corresponding weight. - -* `weight` - (Required) Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - -### `preference` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -## `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `pod_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `pod_anti_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` (pod_affinity_term) - -#### Arguments - -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. -* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace" -* `topology_key` - (Optional) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `pod_affinity_term` - (Required) A pod affinity term, associated with the corresponding weight. -* `weight` - (Required) Weight associated with matching the corresponding `pod_affinity_term`, in the range 1-100. - -### `container` - -#### Arguments - -* `args` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - (Optional) Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - (Optional) 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. -* `image` - (Optional) Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - (Optional) 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. -* `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - (Optional) Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - (Optional) Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `startup_probe` - (Optional) 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. For more info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.17** -* `stdin` - (Optional) 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. -* `stdin_once` - (Optional) 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. -* `termination_message_path` - (Optional) 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. Defaults to /dev/termination-log. Cannot be updated. -* `tty` - (Optional) Whether this container should allocate a TTY for itself -* `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - (Optional) 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. - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `capabilities` - -#### Arguments - -* `add` - (Optional) Added capabilities -* `drop` - (Optional) Removed capabilities - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is / -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `config_map` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `optional` - (Optional) Specify whether the ConfigMap or its keys must be defined. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap or its key must be defined - -### `csi` - -#### Arguments - -* `driver` - (Required) the name of the volume driver to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_attributes` - (Optional) Attributes of the volume to publish. -* `fs_type` - (Optional) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. `ext4`, `xfs`, `ntfs`. -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to `true`. If omitted, the default is `false`. -* `node_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. - -### `dns_config` - -#### Arguments - -* `nameservers` - (Optional) A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - (Optional) A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - (Optional) A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - (Required) Name of the option. -* `value` - (Optional) Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Arguments - -* `medium` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `env_from` - -#### Arguments - -* `config_map_ref` - (Optional) The ConfigMap to select from -* `prefix` - (Optional) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - (Optional) The Secret to select from - -### `exec` - -#### Arguments - -* `command` - (Optional) 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. 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. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `git_repo` - -#### Arguments - -* `directory` - (Optional) 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. -* `repository` - (Optional) Repository URL -* `revision` - (Optional) Commit hash for the specified revision. - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `grpc` - -#### Arguments - -* `port` - (Required) Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - (Optional) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `host_aliases` - -#### Arguments - -* `hostnames` - (Required) Array of hostnames for the IP address. -* `ip` - (Required) IP address of the host file entry. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `http_get` - -#### Arguments - -* `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. -* `http_header` - (Optional) Scheme to use for connecting to the host. -* `path` - (Optional) Path to access on the HTTP server. -* `port` - (Optional) 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. -* `scheme` - (Optional) Scheme to use for connecting to the host. - -### `http_header` - -#### Arguments - -* `name` - (Optional) The header field name -* `value` - (Optional) The header field value - -### `image_pull_secrets` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `items` - -#### Arguments - -* `key` - (Optional) The key to project. -* `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. -* `path` - (Optional) 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 '..'. - -### `lifecycle` - -#### Arguments - -* `post_start` - (Optional) post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `liveness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Arguments - -* `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `port` - -#### Arguments - -* `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - (Optional) What host IP to bind the external port to. -* `host_port` - (Optional) 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. -* `name` - (Optional) 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 -* `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. - -### `readiness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Arguments - -* `level` - (Optional) Level is SELinux level label that applies to the container. -* `role` - (Optional) Role is a SELinux role label that applies to the container. -* `type` - (Optional) Type is a SELinux type label that applies to the container. -* `user` - (Optional) User is a SELinux user label that applies to the container. - -### `secret` - -#### Arguments - -* `default_mode` - (Optional) Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - (Optional) Specify whether the Secret or its keys must be defined. -* `secret_name` - (Optional) Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - (Required) The key to project. -* `mode` - (Optional) Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - (Required) 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 '..'. - -### `secret_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) 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 -* `capabilities` - (Optional) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - (Optional) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - (Optional) Whether this container has a read-only root filesystem. Default is false. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `fs_group_change_policy` - 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. Note that this field cannot be set when spec.os.name is windows. - -### `capabilities` - -#### Arguments - -* `add` - (Optional) A list of added capabilities. -* `drop` - (Optional) A list of removed capabilities. - -### pod `security_context` - -#### Arguments - -* `fs_group` - (Optional) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `supplemental_groups` - (Optional) 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. -* `sysctl` - (Optional) holds a list of namespaced sysctls used for the pod. see [Sysctl](#sysctl) block. See [official docs](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - -##### Sysctl - -* `name` - (Required) Name of a property to set. -* `value` - (Required) Value of a property to set. - -### `tcp_socket` - -#### Arguments - -* `port` - (Required) 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. - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `toleration` - -#### Arguments - -* `effect` - (Optional) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. -* `key` - (Optional) 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. -* `operator` - (Optional) 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. -* `toleration_seconds` - (Optional) 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. -* `value` - (Optional) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - -### `projected` - -#### Arguments - -* `default_mode` - (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. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. -* `sources` - (Required) List of volume projection sources - -### `sources` - -#### Arguments - -* `config_map` - (Optional) Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. -* `downward_api` - (Optional) Represents downward API info for projecting into a projected volume. Note that this is identical to a downward_api volume source without the default mode. -* `secret` - (Optional) Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. -* `service_account_token` - (Optional) Represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). - -### `service_account_token` - -#### Arguments - -* `audience` - (Optional) 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. -* `expiration_seconds` - (Optional) 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. -* `path` - (Required) Path is the path relative to the mount point of the file to project the token into. - -### `volume` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume -* `csi` - (Optional) CSI represents storage that is handled by an external CSI driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi) -* `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume -* `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `ephemeral` - (Optional) Represents an ephemeral volume that is handled by a normal storage driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes) -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `persistent_volume_claim` - (Optional) The specification of a persistent volume. -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `projected` (Optional) Items for all in one resources secrets, configmaps, and downward API. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `secret` - (Optional) Secret represents a secret that should populate this volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - -### `volume_mount` - -#### Arguments - -* `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - (Required) This must match the Name of a Volume. -* `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - (Optional) Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -### `ephemeral` - -#### Arguments - -* `volume_claim_template` - (Required) 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. - -### `volume_claim_template` - -#### Arguments - -* `metadata` - (Optional) 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. -* `spec` - (Required) Please see the [persistent_volume_claim_v1 resource](persistent_volume_claim_v1.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_daemonset` resource: - -* `create` - (Default `10 minutes`) Used for creating new controller -* `update` - (Default `10 minutes`) Used for updating a controller -* `delete` - (Default `10 minutes`) Used for destroying a controller - -## Import - -DaemonSet can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_daemonset.example default/terraform-example -``` diff --git a/website/docs/r/default_service_account.html.markdown b/website/docs/r/default_service_account.html.markdown deleted file mode 100644 index d381c8fe65..0000000000 --- a/website/docs/r/default_service_account.html.markdown +++ /dev/null @@ -1,95 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_default_service_account" -description: |- - The default service account resource configures the default service account created by Kubernetes in each namespace. ---- - -# kubernetes_default_service_account - -Kubernetes creates a "default" service account in each namespace. This is the service account that will be assigned by default to pods in the namespace. - -The `kubernetes_default_service_account` resource behaves differently from normal resources. The service account is created by a Kubernetes controller and Terraform "adopts" it into management. This resource should only be used once per namespace. - -## Example Usage - -```hcl -resource "kubernetes_default_service_account" "example" { - metadata { - namespace = "terraform-example" - } - secret { - name = "${kubernetes_secret.example.metadata.0.name}" - } -} - -resource "kubernetes_secret" "example" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service account's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `image_pull_secret` - (Optional) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `secret` - (Optional) A list of secrets allowed to be used by pods running using this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret) -* `automount_service_account_token` - (Optional) Boolean, `true` to enable automatic mounting of the service account token. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `namespace` - (Optional) Namespace defines the namespace where Terraform will adopt the default service account. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `image_pull_secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -## Attributes Reference - -In addition to the arguments listed above, the following computed attributes are exported: - -* `default_secret_name` - (Deprecated) Name of the default secret, containing service account token, created & managed by the service. By default, the provider will try to find the secret containing the service account token that Kubernetes automatically created for the service account. Where there are multiple tokens and the provider cannot determine which was created by Kubernetes, this attribute will be empty. When only one token is associated with the service account, the provider will return this single token secret. - - Starting from version `1.24.0` by default Kubernetes does not automatically generate tokens for service accounts. That leads to the situation when `default_secret_name` cannot be computed and thus will be an empty string. In order to create a service account token, please [use `kubernetes_secret_v1` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret_v1#example-usage-service-account-token) - -## Destroying - -If you remove a `kubernetes_default_service_account` resource from your configuration, Terraform will send a delete request to the Kubernetes API. Kubernetes will automatically replace this service account, but any customizations will be lost. If you no longer want to manage a default service account with Terraform, use `terraform state rm` to remove it from state before removing the configuration. - -## Import - -The default service account can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_default_service_account.example terraform-example/default -``` diff --git a/website/docs/r/default_service_account_v1.html.markdown b/website/docs/r/default_service_account_v1.html.markdown deleted file mode 100644 index 57837f1051..0000000000 --- a/website/docs/r/default_service_account_v1.html.markdown +++ /dev/null @@ -1,95 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_default_service_account_v1" -description: |- - The default service account resource configures the default service account created by Kubernetes in each namespace. ---- - -# kubernetes_default_service_account_v1 - -Kubernetes creates a "default" service account in each namespace. This is the service account that will be assigned by default to pods in the namespace. - -The `kubernetes_default_service_account_v1` resource behaves differently from normal resources. The service account is created by a Kubernetes controller and Terraform "adopts" it into management. This resource should only be used once per namespace. - -## Example Usage - -```hcl -resource "kubernetes_default_service_account_v1" "example" { - metadata { - namespace = "terraform-example" - } - secret { - name = "${kubernetes_secret_v1.example.metadata.0.name}" - } -} - -resource "kubernetes_secret_v1" "example" { - metadata { - name = "terraform-example" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service account's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `image_pull_secret` - (Optional) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `secret` - (Optional) A list of secrets allowed to be used by pods running using this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret) -* `automount_service_account_token` - (Optional) Boolean, `true` to enable automatic mounting of the service account token. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `namespace` - (Optional) Namespace defines the namespace where Terraform will adopt the default service account. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `image_pull_secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -## Attributes Reference - -In addition to the arguments listed above, the following computed attributes are exported: - -* `default_secret_name` - (Deprecated) Name of the default secret, containing service account token, created & managed by the service. By default, the provider will try to find the secret containing the service account token that Kubernetes automatically created for the service account. Where there are multiple tokens and the provider cannot determine which was created by Kubernetes, this attribute will be empty. When only one token is associated with the service account, the provider will return this single token secret. - - Starting from version `1.24.0` by default Kubernetes does not automatically generate tokens for service accounts. That leads to the situation when `default_secret_name` cannot be computed and thus will be an empty string. In order to create a service account token, please [use `kubernetes_secret_v1` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret_v1#example-usage-service-account-token) - -## Destroying - -If you remove a `kubernetes_default_service_account_v1` resource from your configuration, Terraform will send a delete request to the Kubernetes API. Kubernetes will automatically replace this service account, but any customizations will be lost. If you no longer want to manage a default service account with Terraform, use `terraform state rm` to remove it from state before removing the configuration. - -## Import - -The default service account can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_default_service_account_v1.example terraform-example/default -``` diff --git a/website/docs/r/deployment.html.markdown b/website/docs/r/deployment.html.markdown deleted file mode 100644 index 53dfc55150..0000000000 --- a/website/docs/r/deployment.html.markdown +++ /dev/null @@ -1,914 +0,0 @@ ---- -subcategory: "apps/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_deployment" -description: |- - A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. ---- - -# kubernetes_deployment - -A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. - - -## Example Usage - -```hcl -resource "kubernetes_deployment" "example" { - metadata { - name = "terraform-example" - labels = { - test = "MyExampleApp" - } - } - - spec { - replicas = 3 - - selector { - match_labels = { - test = "MyExampleApp" - } - } - - template { - metadata { - labels = { - test = "MyExampleApp" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - resources { - limits = { - cpu = "0.5" - memory = "512Mi" - } - requests = { - cpu = "250m" - memory = "50Mi" - } - } - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard deployment's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the deployment. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_rollout` - (Optional) Wait for the deployment to successfully roll out. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the deployment. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). **Must match `selector`**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the deployment, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the deployment must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this deployment. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `min_ready_seconds` - (Optional) 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) -* `paused` - (Optional) Indicates that the deployment is paused. -* `progress_deadline_seconds` - (Optional) The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. -* `replicas` - (Optional) The number of desired replicas. This attribute is a string to be able to distinguish between explicit zero and not specified. Defaults to 1. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#scaling-a-deployment) -* `revision_history_limit` - (Optional) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. -* `strategy` - (Optional) The deployment strategy to use to replace existing pods with new ones. -* `selector` - (Optional) A label query over pods that should match the Replicas count. Label keys and values that must match in order to be controlled by this deployment. **Must match labels (`metadata.0.labels`)**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) -* `template` - (Required) Describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template) - -### `strategy` - -#### Arguments - -* `type` - Type of deployment. Can be 'Recreate' or 'RollingUpdate'. Default is RollingUpdate. -* `rolling_update` - Rolling update config params. Present only if type = RollingUpdate. - -### `rolling_update` - -#### Arguments - -* `max_surge` - The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods. -* `max_unavailable` - The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods. - -### `template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata. For more info see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata. -* `spec` - (Required) Specification of the desired behavior of the pod. For more info see https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - -### template `spec` - -#### Arguments - -* `affinity` - (Optional) A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - (Optional) 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. -* `automount_service_account_token` - (Optional) Indicates whether a service account token should be automatically mounted. Defaults to `true`. -* `container` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `readiness_gate` - (Optional) 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://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate) -* `init_container` - (Optional) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - (Optional) Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - (Optional) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `enable_service_links` - (Optional) Enables generating environment variables for service discovery. Optional: Defaults to true. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service). -* `host_aliases` - (Optional) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_aliases` block definition below. -* `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - (Optional) 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. -* `host_pid` - (Optional) Use the host's pid namespace. -* `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - (Optional) 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. -* `node_selector` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `priority_class_name` - (Optional) 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. -* `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `scheduler_name` - (Optional) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/. -* `share_process_namespace` - (Optional) 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. -* `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - (Optional) 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 delete immediately. 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. -* `toleration` - (Optional) Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) - -### `affinity` - -#### Arguments - -* `node_affinity` - (Optional) Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - -### `node_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -## `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `preference` - (Required) A node selector term, associated with the corresponding weight. - -* `weight` - (Required) Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - -### `preference` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -## `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `pod_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `pod_anti_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` (pod_affinity_term) - -#### Arguments - -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. -* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace" -* `topology_key` - (Optional) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `pod_affinity_term` - (Required) A pod affinity term, associated with the corresponding weight. -* `weight` - (Required) Weight associated with matching the corresponding `pod_affinity_term`, in the range 1-100. - -### `container` - -#### Arguments - -* `args` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - (Optional) Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - (Optional) 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. -* `image` - (Optional) Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - (Optional) 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. -* `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - (Optional) Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers) -* `security_context` - (Optional) Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ -* `startup_probe` - (Optional) 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. For more info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.17** -* `stdin` - (Optional) 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. -* `stdin_once` - (Optional) 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. -* `termination_message_path` - (Optional) 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. Defaults to /dev/termination-log. Cannot be updated. -* `tty` - (Optional) Whether this container should allocate a TTY for itself -* `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - (Optional) 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. - -### `readiness_gate` - -#### Arguments - -* `condition_type` - (Required) refers to a condition in the pod's condition list with matching type. - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `capabilities` - -#### Arguments - -* `add` - (Optional) Added capabilities -* `drop` - (Optional) Removed capabilities - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is /. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `config_map` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `optional` - (Optional) Specify whether the ConfigMap or its keys must be defined. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap or its key must be defined - -### `csi` - -#### Arguments - -- `driver` - (Required) the name of the volume driver to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -- `volume_attributes` - (Optional) Attributes of the volume to publish. -- `fs_type` - (Optional) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. `ext4`, `xfs`, `ntfs`. -- `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to `true`. If omitted, the default is `false`. -- `node_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. - -### `dns_config` - -#### Arguments - -* `nameservers` - (Optional) A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - (Optional) A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - (Optional) A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - (Required) Name of the option. -* `value` - (Optional) Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Arguments - -* `medium` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `env_from` - -#### Arguments - -* `config_map_ref` - (Optional) The ConfigMap to select from -* `prefix` - (Optional) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - (Optional) The Secret to select from - -### `exec` - -#### Arguments - -* `command` - (Optional) 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. 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. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `git_repo` - -#### Arguments - -* `directory` - (Optional) 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. -* `repository` - (Optional) Repository URL -* `revision` - (Optional) Commit hash for the specified revision. - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `grpc` - -#### Arguments - -* `port` - (Required) Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - (Optional) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `host_aliases` - -#### Arguments - -* `hostnames` - (Required) Array of hostnames for the IP address. -* `ip` - (Required) IP address of the host file entry. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `http_get` - -#### Arguments - -* `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. -* `http_header` - (Optional) Scheme to use for connecting to the host. -* `path` - (Optional) Path to access on the HTTP server. -* `port` - (Optional) 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. -* `scheme` - (Optional) Scheme to use for connecting to the host. - -### `http_header` - -#### Arguments - -* `name` - (Optional) The header field name -* `value` - (Optional) The header field value - -### `image_pull_secrets` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `items` - -#### Arguments - -* `key` - (Optional) The key to project. -* `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. -* `path` - (Optional) 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 '..'. - -### `lifecycle` - -#### Arguments - -* `post_start` - (Optional) post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `liveness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Arguments - -* `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `port` - -#### Arguments - -* `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - (Optional) What host IP to bind the external port to. -* `host_port` - (Optional) 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. -* `name` - (Optional) 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 -* `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. - -### `readiness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Arguments - -* `level` - (Optional) Level is SELinux level label that applies to the container. -* `role` - (Optional) Role is a SELinux role label that applies to the container. -* `type` - (Optional) Type is a SELinux type label that applies to the container. -* `user` - (Optional) User is a SELinux user label that applies to the container. - -### `secret` - -#### Arguments - -* `default_mode` - (Optional) Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - (Optional) Specify whether the Secret or its keys must be defined. -* `secret_name` - (Optional) Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - (Required) The key to project. -* `mode` - (Optional) Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - (Required) 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 '..'. - -### `secret_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) 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 -* `capabilities` - (Optional) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - (Optional) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - (Optional) Whether this container has a read-only root filesystem. Default is false. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `fs_group_change_policy` - 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. Note that this field cannot be set when spec.os.name is windows. - -### `capabilities` - -#### Arguments - -* `add` - (Optional) A list of added capabilities. -* `drop` - (Optional) A list of removed capabilities. - -### pod `security_context` - -#### Arguments - -* `fs_group` - (Optional) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `supplemental_groups` - (Optional) 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. -* `sysctl` - (Optional) holds a list of namespaced sysctls used for the pod. see [Sysctl](#sysctl) block. See [official docs](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - -##### Sysctl - -* `name` - (Required) Name of a property to set. -* `value` - (Required) Value of a property to set. - -### `tcp_socket` - -#### Arguments - -* `port` - (Required) 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. - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `toleration` - -#### Arguments - -* `effect` - (Optional) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. -* `key` - (Optional) 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. -* `operator` - (Optional) 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. -* `toleration_seconds` - (Optional) 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. -* `value` - (Optional) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - -### `projected` - -#### Arguments - -* `default_mode` - (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. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. -* `sources` - (Required) List of volume projection sources - -### `sources` - -#### Arguments - -* `config_map` - (Optional) Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. -* `downward_api` - (Optional) Represents downward API info for projecting into a projected volume. Note that this is identical to a downward_api volume source without the default mode. -* `secret` - (Optional) Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. -* `service_account_token` - (Optional) Represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). - -### `service_account_token` - -#### Arguments - -* `audience` - (Optional) 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. -* `expiration_seconds` - (Optional) 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. -* `path` - (Required) Path is the path relative to the mount point of the file to project the token into. - -### `volume` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume -* `csi` - (Optional) CSI represents storage that is handled by an external CSI driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi) -* `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume -* `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `ephemeral` - (Optional) Represents an ephemeral volume that is handled by a normal storage driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes) -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `persistent_volume_claim` - (Optional) The specification of a persistent volume. -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `projected` (Optional) Items for all in one resources secrets, configmaps, and downward API. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `secret` - (Optional) Secret represents a secret that should populate this volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - -### `volume_mount` - -#### Arguments - -* `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - (Required) This must match the Name of a Volume. -* `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - (Optional) Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -### `ephemeral` - -#### Arguments - -* `volume_claim_template` - (Required) 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. - -### `volume_claim_template` - -#### Arguments - -* `metadata` - (Optional) 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. -* `spec` - (Required) Please see the [persistent_volume_claim_v1 resource](persistent_volume_claim_v1.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_deployment` resource: - -* `create` - (Default `10 minutes`) Used for creating new controller -* `update` - (Default `10 minutes`) Used for updating a controller -* `delete` - (Default `10 minutes`) Used for destroying a controller - -## Import - -Deployment can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_deployment.example default/terraform-example -``` diff --git a/website/docs/r/deployment_v1.html.markdown b/website/docs/r/deployment_v1.html.markdown deleted file mode 100644 index dc1273ac9a..0000000000 --- a/website/docs/r/deployment_v1.html.markdown +++ /dev/null @@ -1,902 +0,0 @@ ---- -subcategory: "apps/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_deployment_v1" -description: |- - A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. ---- - -# kubernetes_deployment_v1 - -A Deployment ensures that a specified number of pod “replicas” are running at any one time. In other words, a Deployment makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Deployment will start more. - - -## Example Usage - -```hcl -resource "kubernetes_deployment_v1" "example" { - metadata { - name = "terraform-example" - labels = { - test = "MyExampleApp" - } - } - - spec { - replicas = 3 - - selector { - match_labels = { - test = "MyExampleApp" - } - } - - template { - metadata { - labels = { - test = "MyExampleApp" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - resources { - limits = { - cpu = "0.5" - memory = "512Mi" - } - requests = { - cpu = "250m" - memory = "50Mi" - } - } - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard deployment's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the deployment. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_rollout` - (Optional) Wait for the deployment to successfully roll out. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the deployment that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the deployment. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). **Must match `selector`**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the deployment, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the deployment must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this deployment that can be used by clients to determine when deployment has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this deployment. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `min_ready_seconds` - (Optional) 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) -* `paused` - (Optional) Indicates that the deployment is paused. -* `progress_deadline_seconds` - (Optional) The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. -* `replicas` - (Optional) The number of desired replicas. This attribute is a string to be able to distinguish between explicit zero and not specified. Defaults to 1. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#scaling-a-deployment) -* `revision_history_limit` - (Optional) The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. -* `strategy` - (Optional) The deployment strategy to use to replace existing pods with new ones. -* `selector` - (Optional) A label query over pods that should match the Replicas count. Label keys and values that must match in order to be controlled by this deployment. **Must match labels (`metadata.0.labels`)**. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) -* `template` - (Required) Describes the pod that will be created if insufficient replicas are detected. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template) - -### `strategy` - -#### Arguments - -* `type` - Type of deployment. Can be 'Recreate' or 'RollingUpdate'. Default is RollingUpdate. -* `rolling_update` - Rolling update config params. Present only if type = RollingUpdate. - -### `rolling_update` - -#### Arguments - -* `max_surge` - The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods. -* `max_unavailable` - The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods. - -### `template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata. For more info see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata. -* `spec` - (Required) Specification of the desired behavior of the pod. For more info see https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - -### template `spec` - -#### Arguments - -* `affinity` - (Optional) A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - (Optional) 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. -* `automount_service_account_token` - (Optional) Indicates whether a service account token should be automatically mounted. Defaults to `true`. -* `container` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `readiness_gate` - (Optional) 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://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate) -* `init_container` - (Optional) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - (Optional) Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - (Optional) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `enable_service_links` - (Optional) Enables generating environment variables for service discovery. Optional: Defaults to true. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service). -* `host_aliases` - (Optional) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_aliases` block definition below. -* `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - (Optional) 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. -* `host_pid` - (Optional) Use the host's pid namespace. -* `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - (Optional) 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. -* `node_selector` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `priority_class_name` - (Optional) 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. -* `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `scheduler_name` - (Optional) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/. -* `share_process_namespace` - (Optional) 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. -* `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - (Optional) 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 delete immediately. 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. -* `toleration` - (Optional) Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) - -### `affinity` - -#### Arguments - -* `node_affinity` - (Optional) Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - -### `node_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -## `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `preference` - (Required) A node selector term, associated with the corresponding weight. - -* `weight` - (Required) Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - -### `preference` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -## `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `pod_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `pod_anti_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` (pod_affinity_term) - -#### Arguments - -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. -* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace" -* `topology_key` - (Optional) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `pod_affinity_term` - (Required) A pod affinity term, associated with the corresponding weight. -* `weight` - (Required) Weight associated with matching the corresponding `pod_affinity_term`, in the range 1-100. - -### `container` - -#### Arguments - -* `args` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - (Optional) Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - (Optional) 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. -* `image` - (Optional) Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - (Optional) 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. -* `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - (Optional) Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - (Optional) Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `startup_probe` - (Optional) 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. For more info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.17** -* `stdin` - (Optional) 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. -* `stdin_once` - (Optional) 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. -* `termination_message_path` - (Optional) 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. Defaults to /dev/termination-log. Cannot be updated. -* `tty` - (Optional) Whether this container should allocate a TTY for itself -* `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - (Optional) 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. - -### `readiness_gate` - -#### Arguments - -* `condition_type` - (Required) refers to a condition in the pod's condition list with matching type. - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `capabilities` - -#### Arguments - -* `add` - (Optional) Added capabilities -* `drop` - (Optional) Removed capabilities - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is /. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `config_map` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `optional` - (Optional) Specify whether the ConfigMap or its keys must be defined. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap or its key must be defined - -### `dns_config` - -#### Arguments - -* `nameservers` - (Optional) A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - (Optional) A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - (Optional) A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - (Required) Name of the option. -* `value` - (Optional) Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Arguments - -* `medium` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `env_from` - -#### Arguments - -* `config_map_ref` - (Optional) The ConfigMap to select from -* `prefix` - (Optional) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - (Optional) The Secret to select from - -### `exec` - -#### Arguments - -* `command` - (Optional) 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. 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. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `git_repo` - -#### Arguments - -* `directory` - (Optional) 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. -* `repository` - (Optional) Repository URL -* `revision` - (Optional) Commit hash for the specified revision. - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `grpc` - -#### Arguments - -* `port` - (Required) Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - (Optional) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `host_aliases` - -#### Arguments - -* `hostnames` - (Required) Array of hostnames for the IP address. -* `ip` - (Required) IP address of the host file entry. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `http_get` - -#### Arguments - -* `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. -* `http_header` - (Optional) Scheme to use for connecting to the host. -* `path` - (Optional) Path to access on the HTTP server. -* `port` - (Optional) 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. -* `scheme` - (Optional) Scheme to use for connecting to the host. - -### `http_header` - -#### Arguments - -* `name` - (Optional) The header field name -* `value` - (Optional) The header field value - -### `image_pull_secrets` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `items` - -#### Arguments - -* `key` - (Optional) The key to project. -* `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. -* `path` - (Optional) 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 '..'. - -### `lifecycle` - -#### Arguments - -* `post_start` - (Optional) post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `liveness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Arguments - -* `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `port` - -#### Arguments - -* `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - (Optional) What host IP to bind the external port to. -* `host_port` - (Optional) 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. -* `name` - (Optional) 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 -* `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd#how-to-use-it. - -### `readiness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Arguments - -* `level` - (Optional) Level is SELinux level label that applies to the container. -* `role` - (Optional) Role is a SELinux role label that applies to the container. -* `type` - (Optional) Type is a SELinux type label that applies to the container. -* `user` - (Optional) User is a SELinux user label that applies to the container. - -### `secret` - -#### Arguments - -* `default_mode` - (Optional) Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - (Optional) Specify whether the Secret or its keys must be defined. -* `secret_name` - (Optional) Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - (Required) The key to project. -* `mode` - (Optional) Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - (Required) 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 '..'. - -### `secret_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) 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 -* `capabilities` - (Optional) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - (Optional) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - (Optional) Whether this container has a read-only root filesystem. Default is false. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. - -### `capabilities` - -#### Arguments - -* `add` - (Optional) A list of added capabilities. -* `drop` - (Optional) A list of removed capabilities. - -### pod `security_context` - -#### Arguments - -* `fs_group` - (Optional) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `supplemental_groups` - (Optional) 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. -* `sysctl` - (Optional) holds a list of namespaced sysctls used for the pod. see [Sysctl](#sysctl) block. See [official docs](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - -##### Sysctl - -* `name` - (Required) Name of a property to set. -* `value` - (Required) Value of a property to set. - -### `tcp_socket` - -#### Arguments - -* `port` - (Required) 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. - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `toleration` - -#### Arguments - -* `effect` - (Optional) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. -* `key` - (Optional) 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. -* `operator` - (Optional) 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. -* `toleration_seconds` - (Optional) 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. -* `value` - (Optional) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - -### `projected` - -#### Arguments - -* `default_mode` - (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. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. -* `sources` - (Required) List of volume projection sources - -### `sources` - -#### Arguments - -* `config_map` - (Optional) Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. -* `downward_api` - (Optional) Represents downward API info for projecting into a projected volume. Note that this is identical to a downward_api volume source without the default mode. -* `secret` - (Optional) Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. -* `service_account_token` - (Optional) Represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). - -### `service_account_token` - -#### Arguments - -* `audience` - (Optional) 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. -* `expiration_seconds` - (Optional) 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. -* `path` - (Required) Path is the path relative to the mount point of the file to project the token into. - -### `volume` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume -* `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume -* `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `ephemeral` - (Optional) Represents an ephemeral volume that is handled by a normal storage driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes) -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `persistent_volume_claim` - (Optional) The specification of a persistent volume. -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `projected` (Optional) Items for all in one resources secrets, configmaps, and downward API. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `secret` - (Optional) Secret represents a secret that should populate this volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - -### `volume_mount` - -#### Arguments - -* `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - (Required) This must match the Name of a Volume. -* `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - (Optional) Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -### `ephemeral` - -#### Arguments - -* `volume_claim_template` - (Required) 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. - -### `volume_claim_template` - -#### Arguments - -* `metadata` - (Optional) 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. -* `spec` - (Required) Please see the [persistent_volume_claim_v1 resource](persistent_volume_claim_v1.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_deployment_v1` resource: - -* `create` - (Default `10 minutes`) Used for creating new controller -* `update` - (Default `10 minutes`) Used for updating a controller -* `delete` - (Default `10 minutes`) Used for destroying a controller - -## Import - -Deployment can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_deployment_v1.example default/terraform-example -``` diff --git a/website/docs/r/endpoint_slice_v1.html.markdown b/website/docs/r/endpoint_slice_v1.html.markdown deleted file mode 100644 index 0cfa4a63db..0000000000 --- a/website/docs/r/endpoint_slice_v1.html.markdown +++ /dev/null @@ -1,106 +0,0 @@ ---- -subcategory: "discovery/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_endpoint_slice_v1" -description: |- - An EndpointSlice contains references to a set of network endpoints. ---- - -# kubernetes_endpoints_slice_v1 - -An EndpointSlice contains references to a set of network endpoints. - -## Example Usage - -```hcl -resource "kubernetes_endpoint_slice_v1" "test" { - metadata { - name = "test" - } - - endpoint { - condition { - ready = true - } - addresses = ["129.144.50.56"] - } - - port { - port = "9000" - name = "first" - } - - address_type = "IPv4" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard endpoints' metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `address_type` - (Required) Specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: *IPv4: Represents an IPv4 Address.* IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. -* `endpoint` - (Required) A list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. -* `port` - (Required) Specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the endpoints resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoints resource. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the endpoints resource, must be unique. Cannot be updated. This name should correspond with an accompanying Service resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the endpoints resource must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this endpoints resource that can be used by clients to determine when endpoints resource has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this endpoints resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `endpoint` - -#### Arguments - -* `addresses` - (Required) addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. -* `condition` - (Optional) Contains information about the current status of the endpoint. -* `hostname` - (Optional) hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation. -* `node_name` - (Optional) Represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node. -* `target_ref` - (Optional) targetRef is a reference to a Kubernetes object that represents this endpoint. -* `zone` - (Optional) The name of the Zone this endpoint exists in. - -### `condition` - -#### Attributes - -* `ready` - (Optional) Indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. -* `serving` - (Optional) Serving is identical to ready except that it is set regardless of the terminating state of endpoints. -* `terminating` - (Optional) Indicates that this endpoint is terminating. - -### `target_ref` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. -* `zone` - (Optional) The name of the zone this endpoint exists in. - -### `port` - -#### Arguments - -* `name` - (Optional) The name of this port within the endpoint. All ports within the endpoint must have unique names. Optional if only one port is defined on this endpoint. -* `port` - (Required) The port that will be utilized by this endpoint. -* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. -* `app_protocol` - (Optional) The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. diff --git a/website/docs/r/endpoints.html.markdown b/website/docs/r/endpoints.html.markdown deleted file mode 100644 index b60715f079..0000000000 --- a/website/docs/r/endpoints.html.markdown +++ /dev/null @@ -1,156 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_endpoints" -description: |- - An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. ---- - -# kubernetes_endpoints - -An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. - - -## Example Usage - -```hcl -resource "kubernetes_endpoints" "example" { - metadata { - name = "terraform-example" - } - - subset { - address { - ip = "10.0.0.4" - } - - address { - ip = "10.0.0.5" - } - - port { - name = "http" - port = 80 - protocol = "TCP" - } - - port { - name = "https" - port = 443 - protocol = "TCP" - } - } - - subset { - address { - ip = "10.0.1.4" - } - - address { - ip = "10.0.1.5" - } - - port { - name = "http" - port = 80 - protocol = "TCP" - } - - port { - name = "https" - port = 443 - protocol = "TCP" - } - } -} - -resource "kubernetes_service" "example" { - metadata { - name = "${kubernetes_endpoints.example.metadata.0.name}" - } - - spec { - port { - port = 8080 - target_port = 80 - } - - port { - port = 8443 - target_port = 443 - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard endpoints' metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `subset` - (Optional) Set of addresses and ports that comprise a service. Can be repeated multiple times. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the endpoints resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoints resource. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the endpoints resource, must be unique. Cannot be updated. This name should correspond with an accompanying Service resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the endpoints resource must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this endpoints resource that can be used by clients to determine when endpoints resource has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this endpoints resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `subset` - -#### Arguments - -* `address` - (Optional) An IP address block which offers the related ports and is ready to accept traffic. These endpoints should be considered safe for load balancers and clients to utilize. Can be repeated multiple times. -* `not_ready_address` - (Optional) A IP address block which offers the related ports but is not currently marked as ready because it have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check. Can be repeated multiple times. -* `port` - (Optional) A port number block available on the related IP addresses. Can be repeated multiple times. - -### `address` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. - -### `not_ready_address` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. - -### `port` - -#### Arguments - -* `name` - (Optional) The name of this port within the endpoint. All ports within the endpoint must have unique names. Optional if only one port is defined on this endpoint. -* `port` - (Required) The port that will be utilized by this endpoint. -* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. - -## Import - -An Endpoints resource can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_endpoints.example default/terraform-name -``` diff --git a/website/docs/r/endpoints_v1.html.markdown b/website/docs/r/endpoints_v1.html.markdown deleted file mode 100644 index 89ae1f8c47..0000000000 --- a/website/docs/r/endpoints_v1.html.markdown +++ /dev/null @@ -1,156 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_endpoints_v1" -description: |- - An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. ---- - -# kubernetes_endpoints_v1 - -An Endpoints resource is an abstraction, linked to a Service, which defines the list of endpoints that actually implement the service. - - -## Example Usage - -```hcl -resource "kubernetes_endpoints_v1" "example" { - metadata { - name = "terraform-example" - } - - subset { - address { - ip = "10.0.0.4" - } - - address { - ip = "10.0.0.5" - } - - port { - name = "http" - port = 80 - protocol = "TCP" - } - - port { - name = "https" - port = 443 - protocol = "TCP" - } - } - - subset { - address { - ip = "10.0.1.4" - } - - address { - ip = "10.0.1.5" - } - - port { - name = "http" - port = 80 - protocol = "TCP" - } - - port { - name = "https" - port = 443 - protocol = "TCP" - } - } -} - -resource "kubernetes_service_v1" "example" { - metadata { - name = "${kubernetes_endpoints_v1.example.metadata.0.name}" - } - - spec { - port { - port = 8080 - target_port = 80 - } - - port { - port = 8443 - target_port = 443 - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard endpoints' metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `subset` - (Optional) Set of addresses and ports that comprise a service. Can be repeated multiple times. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the endpoints resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the endpoints resource. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the endpoints resource, must be unique. Cannot be updated. This name should correspond with an accompanying Service resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the endpoints resource must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this endpoints resource that can be used by clients to determine when endpoints resource has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this endpoints resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `subset` - -#### Arguments - -* `address` - (Optional) An IP address block which offers the related ports and is ready to accept traffic. These endpoints should be considered safe for load balancers and clients to utilize. Can be repeated multiple times. -* `not_ready_address` - (Optional) A IP address block which offers the related ports but is not currently marked as ready because it have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check. Can be repeated multiple times. -* `port` - (Optional) A port number block available on the related IP addresses. Can be repeated multiple times. - -### `address` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. - -### `not_ready_address` - -#### Attributes - -* `ip` - The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). -* `hostname` - (Optional) The Hostname of this endpoint. -* `node_name` - (Optional) Node hosting this endpoint. This can be used to determine endpoints local to a node. - -### `port` - -#### Arguments - -* `name` - (Optional) The name of this port within the endpoint. All ports within the endpoint must have unique names. Optional if only one port is defined on this endpoint. -* `port` - (Required) The port that will be utilized by this endpoint. -* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. - -## Import - -An Endpoints resource can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_endpoints_v1.example default/terraform-name -``` diff --git a/website/docs/r/env.html.markdown b/website/docs/r/env.html.markdown deleted file mode 100644 index 0341fae781..0000000000 --- a/website/docs/r/env.html.markdown +++ /dev/null @@ -1,110 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_env" -description: |- - This resource provides a way to manage environment variables in resources that were created outside of Terraform. ---- - -# kubernetes_env - -This resource provides a way to manage environment variables in resources that were created outside of Terraform. This resource provides functionality similar to the `kubectl set env` command. - -## Example Usage - -```hcl -resource "kubernetes_env" "example" { - container = "nginx" - metadata { - name = "nginx-deployment" - } - - api_version = "apps/v1" - kind = "Deployment" - - env { - name = "NGINX_HOST" - value = "google.com" - } - - env { - name = "NGINX_PORT" - value = "90" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `api_version` - (Required) The apiVersion of the resource to add environment variables to. -* `kind` - (Required) The kind of the resource to add environment variables to. -* `metadata` - (Required) Standard metadata of the resource to add environment variables to. -* `container` - (Optional) Name of the container for which we are updating the environment variables. -* `init_container` - (Optional) Name of the initContainer for which we are updating the environment variables. -* `env` - (Required) Value block with custom values used to represent environment variables -* `force` - (Optional) Force management of environment variables if there is a conflict. -* `field_manager` - (Optional) The name of the [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management). Defaults to `Terraform`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `name` - (Required) Name of the resource to add environment variables to. -* `namespace` - (Optional) Namespace of the resource to add environment variables to. - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - - -## Import - -This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it. diff --git a/website/docs/r/horizontal_pod_autoscaler.html.markdown b/website/docs/r/horizontal_pod_autoscaler.html.markdown deleted file mode 100644 index 2dc76ccbf5..0000000000 --- a/website/docs/r/horizontal_pod_autoscaler.html.markdown +++ /dev/null @@ -1,281 +0,0 @@ ---- -layout: "kubernetes" -subcategory: "autoscaling/v1" -page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler" -description: |- - Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. ---- - -# kubernetes_horizontal_pod_autoscaler - -Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. - - -## Example Usage - -```hcl -resource "kubernetes_horizontal_pod_autoscaler" "example" { - metadata { - name = "terraform-example" - } - - spec { - max_replicas = 10 - min_replicas = 8 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - } -} -``` - -## Example Usage, with `metric` - -```hcl -resource "kubernetes_horizontal_pod_autoscaler" "example" { - metadata { - name = "test" - } - - spec { - min_replicas = 50 - max_replicas = 100 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - - metric { - type = "External" - external { - metric { - name = "latency" - selector { - match_labels = { - lb_name = "test" - } - } - } - target { - type = "Value" - value = "100" - } - } - } - } -} -``` - -## Example Usage, with `behavior` - -```hcl -resource "kubernetes_horizontal_pod_autoscaler" "example" { - metadata { - name = "test" - } - - spec { - min_replicas = 50 - max_replicas = 100 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - - behavior { - scale_down { - stabilization_window_seconds = 300 - select_policy = "Min" - policy { - period_seconds = 120 - type = "Pods" - value = 1 - } - - policy { - period_seconds = 310 - type = "Percent" - value = 100 - } - } - scale_up { - stabilization_window_seconds = 600 - select_policy = "Max" - policy { - period_seconds = 180 - type = "Percent" - value = 100 - } - policy { - period_seconds = 600 - type = "Pods" - value = 5 - } - } - } - } -} -``` - -## Support for multiple and custom metrics - -The provider currently supports two version of the HorizontalPodAutoscaler API resource. - -If you wish to use `autoscaling/v1` use the `target_cpu_utilization_percentage` field. - -If you wish to use `autoscaling/v2beta2` then set one or more `metric` fields. - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard horizontal pod autoscaler's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Behaviour of the autoscaler. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this horizontal pod autoscaler. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `max_replicas` - (Required) Upper limit for the number of pods that can be set by the autoscaler. -* `min_replicas` - (Optional) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. -* `scale_target_ref` - (Required) Reference to scaled resource. e.g. Replication Controller -* `target_cpu_utilization_percentage` - (Optional) Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. -* `metric` - (Optional) A metric on which to scale. -* `behavior` - (Optional) Behavior configures the scaling behavior of the target in both Up and Down directions (scale_up and scale_down fields respectively) - -### `metric` - -#### Arguments - -* `type` - (Required) The type of metric. It can be one of "Object", "Pods", "Resource", or "External". -* `object` - (Optional) A metric describing a single kubernetes object (for example, hits-per-second on an Ingress object). -* `pods` - (Optional) A metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. -* `resource` - (Optional) A resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. -* `external` - (Optional) A global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). - -### Metric Type: `external` - -#### Arguments - -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `object` - -#### Arguments - -* `described_object` - (Required) Reference to the object. -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `pods` - -#### Arguments - -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `resource` - -#### Arguments - -* `name` - (Required) Name of the resource in question. -* `target` - (Required) The target for the given metric. - -### `metric` - -#### Arguments - -* `name` - (Required) The name of the given metric -* `selector` - (Optional) The label selector for the given metric - -### `target` - -#### Arguments - -* `type` - (Required) Represents whether the metric type is Utilization, Value, or AverageValue. -* `average_value` - (Optional) The target value of the average of the metric across all relevant pods (as a quantity). -* `average_utilization` - (Optional) The target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type. -* `value` - (Optional) value is the target value of the metric (as a quantity). - -#### Quantities - -See [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for documentation on resource management for pods and containers. - -### `described_object` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `scale_target_ref` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `behavior` - -#### Arguments - -* `scale_up` - (Optional) Scaling policy for scaling Up -* `scale_down` - (Optional) Scaling policy for scaling Down - - -### `scale_up` - -#### Arguments - -* `policy` - (Required) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. -* `select_policy` - (Optional) Used to specify which policy should be used. If not set, the default value Max is used. -* `stabilization_window_seconds` - (Optional) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). - -### `policy` - -#### Arguments - -* `period_seconds` - (Required) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). -* `type` - (Required) Type is used to specify the scaling policy: Percent or Pods -* `value` - (Required) Value contains the amount of change which is permitted by the policy. It must be greater than zero. - - -## Import - -Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_horizontal_pod_autoscaler.example default/terraform-example -``` diff --git a/website/docs/r/horizontal_pod_autoscaler_v1.html.markdown b/website/docs/r/horizontal_pod_autoscaler_v1.html.markdown deleted file mode 100644 index 6c74ccd85d..0000000000 --- a/website/docs/r/horizontal_pod_autoscaler_v1.html.markdown +++ /dev/null @@ -1,90 +0,0 @@ ---- -subcategory: "autoscaling/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v1" -description: |- - Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. ---- - -# kubernetes_horizontal_pod_autoscaler_v1 - -Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. - - -## Example Usage - -```hcl -resource "kubernetes_horizontal_pod_autoscaler_v1" "example" { - metadata { - name = "terraform-example" - } - - spec { - max_replicas = 10 - min_replicas = 8 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - } -} -``` - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard horizontal pod autoscaler's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Behaviour of the autoscaler. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this horizontal pod autoscaler. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `max_replicas` - (Required) Upper limit for the number of pods that can be set by the autoscaler. -* `min_replicas` - (Optional) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. -* `scale_target_ref` - (Required) Reference to scaled resource. e.g. Replication Controller -* `target_cpu_utilization_percentage` - (Optional) Target average CPU utilization (represented as a percentage of requested CPU) over all the pods. If not specified the default autoscaling policy will be used. - -### `scale_target_ref` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -## Import - -Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_horizontal_pod_autoscaler_v1.example default/terraform-example -``` diff --git a/website/docs/r/horizontal_pod_autoscaler_v2.html.markdown b/website/docs/r/horizontal_pod_autoscaler_v2.html.markdown deleted file mode 100644 index 7239552e2f..0000000000 --- a/website/docs/r/horizontal_pod_autoscaler_v2.html.markdown +++ /dev/null @@ -1,262 +0,0 @@ ---- -layout: "kubernetes" -subcategory: "autoscaling/v2" -page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v2" -description: |- - Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. ---- - -# kubernetes_horizontal_pod_autoscaler_v2 - -Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. - - - -## Example Usage, with `metric` - -```hcl -resource "kubernetes_horizontal_pod_autoscaler_v2" "example" { - metadata { - name = "test" - } - - spec { - min_replicas = 50 - max_replicas = 100 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - - metric { - type = "External" - external { - metric { - name = "latency" - selector { - match_labels = { - lb_name = "test" - } - } - } - target { - type = "Value" - value = "100" - } - } - } - } -} -``` - -## Example Usage, with `behavior` - -```hcl -resource "kubernetes_horizontal_pod_autoscaler_v2" "example" { - metadata { - name = "test" - } - - spec { - min_replicas = 50 - max_replicas = 100 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - - behavior { - scale_down { - stabilization_window_seconds = 300 - select_policy = "Min" - policy { - period_seconds = 120 - type = "Pods" - value = 1 - } - - policy { - period_seconds = 310 - type = "Percent" - value = 100 - } - } - scale_up { - stabilization_window_seconds = 600 - select_policy = "Max" - policy { - period_seconds = 180 - type = "Percent" - value = 100 - } - policy { - period_seconds = 600 - type = "Pods" - value = 5 - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard horizontal pod autoscaler's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Behaviour of the autoscaler. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this horizontal pod autoscaler. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `max_replicas` - (Required) Upper limit for the number of pods that can be set by the autoscaler. -* `min_replicas` - (Optional) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. -* `scale_target_ref` - (Required) Reference to scaled resource. e.g. Replication Controller -* `metric` - (Optional) A metric on which to scale. -* `behavior` - (Optional) Behavior configures the scaling behavior of the target in both Up and Down directions (`scale_up` and `scale_down` fields respectively) - -### `metric` - -#### Arguments - -* `type` - (Required) The type of metric. It can be one of "Object", "Pods", "Resource", "External", or "ContainerResource". -* `object` - (Optional) A metric describing a single kubernetes object (for example, hits-per-second on an Ingress object). -* `pods` - (Optional) A metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. -* `resource` - (Optional) A resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. -* `external` - (Optional) A global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). -* `container_resource` - (Optional) A resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. - -### Metric Type: `container_resource` - -#### Arguments - -* `container` - (Required) Name of the container in the pods of the scaling target. -* `name` - (Required) Name of the resource in question. -* `target` - (Required) The target for the given metric. - -### Metric Type: `external` - -#### Arguments - -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `object` - -#### Arguments - -* `described_object` - (Required) Reference to the object. -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `pods` - -#### Arguments - -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `resource` - -#### Arguments - -* `name` - (Required) Name of the resource in question. -* `target` - (Required) The target for the given metric. - -### `metric` - -#### Arguments - -* `name` - (Required) The name of the given metric -* `selector` - (Optional) The label selector for the given metric - -### `target` - -#### Arguments - -* `type` - (Required) Represents whether the metric type is Utilization, Value, or AverageValue. -* `average_value` - (Optional) The target value of the average of the metric across all relevant pods (as a quantity). -* `average_utilization` - (Optional) The target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type. -* `value` - (Optional) value is the target value of the metric (as a quantity). - -#### Quantities - -See [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for documentation on resource management for pods and containers. - -### `described_object` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `scale_target_ref` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `behavior` - -#### Arguments - -* `scale_up` - (Optional) Scaling policy for scaling Up -* `scale_down` - (Optional) Scaling policy for scaling Down - - -### `scale_up` - -#### Arguments - -* `policy` - (Required) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. -* `select_policy` - (Optional) Used to specify which policy should be used. If not set, the default value Max is used. -* `stabilization_window_seconds` - (Optional) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). - -### `policy` - -#### Arguments - -* `period_seconds` - (Required) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). -* `type` - (Required) Type is used to specify the scaling policy: Percent or Pods -* `value` - (Required) Value contains the amount of change which is permitted by the policy. It must be greater than zero. - - -## Import - -Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_horizontal_pod_autoscaler_v2.example default/terraform-example -``` diff --git a/website/docs/r/horizontal_pod_autoscaler_v2beta2.html.markdown b/website/docs/r/horizontal_pod_autoscaler_v2beta2.html.markdown deleted file mode 100644 index 3fb82dec24..0000000000 --- a/website/docs/r/horizontal_pod_autoscaler_v2beta2.html.markdown +++ /dev/null @@ -1,262 +0,0 @@ ---- -layout: "kubernetes" -subcategory: "autoscaling/v2beta2" -page_title: "Kubernetes: kubernetes_horizontal_pod_autoscaler_v2beta2" -description: |- - Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. ---- - -# kubernetes_horizontal_pod_autoscaler_v2beta2 - -Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. - - - -## Example Usage, with `metric` - -```hcl -resource "kubernetes_horizontal_pod_autoscaler_v2beta2" "example" { - metadata { - name = "test" - } - - spec { - min_replicas = 50 - max_replicas = 100 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - - metric { - type = "External" - external { - metric { - name = "latency" - selector { - match_labels = { - lb_name = "test" - } - } - } - target { - type = "Value" - value = "100" - } - } - } - } -} -``` - -## Example Usage, with `behavior` - -```hcl -resource "kubernetes_horizontal_pod_autoscaler_v2beta2" "example" { - metadata { - name = "test" - } - - spec { - min_replicas = 50 - max_replicas = 100 - - scale_target_ref { - kind = "Deployment" - name = "MyApp" - } - - behavior { - scale_down { - stabilization_window_seconds = 300 - select_policy = "Min" - policy { - period_seconds = 120 - type = "Pods" - value = 1 - } - - policy { - period_seconds = 310 - type = "Percent" - value = 100 - } - } - scale_up { - stabilization_window_seconds = 600 - select_policy = "Max" - policy { - period_seconds = 180 - type = "Percent" - value = 100 - } - policy { - period_seconds = 600 - type = "Pods" - value = 5 - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard horizontal pod autoscaler's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Behaviour of the autoscaler. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the horizontal pod autoscaler that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the horizontal pod autoscaler. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the horizontal pod autoscaler, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the horizontal pod autoscaler must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this horizontal pod autoscaler that can be used by clients to determine when horizontal pod autoscaler has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this horizontal pod autoscaler. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `max_replicas` - (Required) Upper limit for the number of pods that can be set by the autoscaler. -* `min_replicas` - (Optional) Lower limit for the number of pods that can be set by the autoscaler, defaults to `1`. -* `scale_target_ref` - (Required) Reference to scaled resource. e.g. Replication Controller -* `metric` - (Optional) A metric on which to scale. -* `behavior` - (Optional) Behavior configures the scaling behavior of the target in both Up and Down directions (`scale_up` and `scale_down` fields respectively) - -### `metric` - -#### Arguments - -* `type` - (Required) The type of metric. It can be one of "Object", "Pods", "Resource", "External", or "ContainerResource". -* `object` - (Optional) A metric describing a single kubernetes object (for example, hits-per-second on an Ingress object). -* `pods` - (Optional) A metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. -* `resource` - (Optional) A resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. -* `external` - (Optional) A global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). -* `container_resource` - (Optional) A resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. - -### Metric Type: `container_resource` - -#### Arguments - -* `container` - (Required) Name of the container in the pods of the scaling target. -* `name` - (Required) Name of the resource in question. -* `target` - (Required) The target for the given metric. - -### Metric Type: `external` - -#### Arguments - -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `object` - -#### Arguments - -* `described_object` - (Required) Reference to the object. -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `pods` - -#### Arguments - -* `metric` - (Required) Identifies the target by name and selector. -* `target` - (Required) The target for the given metric. - -### Metric Type: `resource` - -#### Arguments - -* `name` - (Required) Name of the resource in question. -* `target` - (Required) The target for the given metric. - -### `metric` - -#### Arguments - -* `name` - (Required) The name of the given metric -* `selector` - (Optional) The label selector for the given metric - -### `target` - -#### Arguments - -* `type` - (Required) Represents whether the metric type is Utilization, Value, or AverageValue. -* `average_value` - (Optional) The target value of the average of the metric across all relevant pods (as a quantity). -* `average_utilization` - (Optional) The target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. Currently only valid for Resource metric source type. -* `value` - (Optional) value is the target value of the metric (as a quantity). - -#### Quantities - -See [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for documentation on resource management for pods and containers. - -### `described_object` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `scale_target_ref` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. This argument is optional for the `v1` API version referents and mandatory for the rest. -* `kind` - (Required) Kind of the referent. e.g. `ReplicationController`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds) -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `behavior` - -#### Arguments - -* `scale_up` - (Optional) Scaling policy for scaling Up -* `scale_down` - (Optional) Scaling policy for scaling Down - - -### `scale_up` - -#### Arguments - -* `policy` - (Required) List of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the scaling rule will be discarded as invalid. -* `select_policy` - (Optional) Used to specify which policy should be used. If not set, the default value Max is used. -* `stabilization_window_seconds` - (Optional) Number of seconds for which past recommendations should be considered while scaling up or scaling down. This value must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long). - -### `policy` - -#### Arguments - -* `period_seconds` - (Required) Period specifies the window of time for which the policy should hold true. PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). -* `type` - (Required) Type is used to specify the scaling policy: Percent or Pods -* `value` - (Required) Value contains the amount of change which is permitted by the policy. It must be greater than zero. - - -## Import - -Horizontal Pod Autoscaler can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_horizontal_pod_autoscaler_v2beta2.example default/terraform-example -``` diff --git a/website/docs/r/ingress.html.markdown b/website/docs/r/ingress.html.markdown deleted file mode 100644 index 977b17552c..0000000000 --- a/website/docs/r/ingress.html.markdown +++ /dev/null @@ -1,291 +0,0 @@ ---- -subcategory: "extensions/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_ingress" -description: |- - Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. ---- - -# kubernetes_ingress - -Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. - - -## Example Usage - -```hcl -resource "kubernetes_ingress" "example_ingress" { - metadata { - name = "example-ingress" - } - - spec { - backend { - service_name = "myapp-1" - service_port = 8080 - } - - rule { - http { - path { - backend { - service_name = "myapp-1" - service_port = 8080 - } - - path = "/app1/*" - } - - path { - backend { - service_name = "myapp-2" - service_port = 8080 - } - - path = "/app2/*" - } - } - } - - tls { - secret_name = "tls-secret" - } - } -} - -resource "kubernetes_service_v1" "example" { - metadata { - name = "myapp-1" - } - spec { - selector = { - app = kubernetes_pod.example.metadata.0.labels.app - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "NodePort" - } -} - -resource "kubernetes_service_v1" "example2" { - metadata { - name = "myapp-2" - } - spec { - selector = { - app = kubernetes_pod.example2.metadata.0.labels.app - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "NodePort" - } -} - -resource "kubernetes_pod" "example" { - metadata { - name = "terraform-example" - labels = { - app = "myapp-1" - } - } - - spec { - container { - image = "nginx:1.7.9" - name = "example" - - port { - container_port = 8080 - } - } - } -} - -resource "kubernetes_pod" "example2" { - metadata { - name = "terraform-example2" - labels = { - app = "myapp-2" - } - } - - spec { - container { - image = "nginx:1.7.9" - name = "example" - - port { - container_port = 8080 - } - } - } -} -``` - -## Example using Nginx ingress controller - -```hcl -resource "kubernetes_service" "example" { - metadata { - name = "ingress-service" - } - spec { - port { - port = 80 - target_port = 80 - protocol = "TCP" - } - type = "NodePort" - } -} - -resource "kubernetes_ingress" "example" { - wait_for_load_balancer = true - metadata { - name = "example" - annotations = { - "kubernetes.io/ingress.class" = "nginx" - } - } - spec { - rule { - http { - path { - path = "/*" - backend { - service_name = kubernetes_service.example.metadata.0.name - service_port = 80 - } - } - } - } - } -} - -# Display load balancer hostname (typically present in AWS) -output "load_balancer_hostname" { - value = kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.hostname -} - -# Display load balancer IP (typically present in GCP, or using Nginx ingress controller) -output "load_balancer_ip" { - value = kubernetes_ingress.example.status.0.load_balancer.0.ingress.0.ip -} -``` - - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard ingress's metadata. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Spec defines the behavior of a ingress. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `wait_for_load_balancer` - (Optional) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. Defaults to `false`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `backend` - (Optional) Backend defines the referenced service endpoint to which the traffic will be forwarded. See `backend` block attributes below. -* `rule` - (Optional) A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. See `rule` block attributes below. -* `tls` - (Optional) TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. See `tls` block attributes below. -* `ingress_class_name` - (Optional) The ingress class name references an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. - -### `backend` - -#### Arguments - -* `service_name` - (Optional) Specifies the name of the referenced service. -* `service_port` - (Optional) Specifies the port of the referenced service. - -### `rule` - -#### Arguments - -* `host` - (Optional) Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the IP in the Spec of the parent Ingress. 2. The : delimiter is not respected because ports are not allowed. Currently the port of an Ingress is implicitly :80 for http and :443 for https. Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue. -* `http` - (Required) http is a list of http selectors pointing to backends. In the example: http:///? -> backend where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'. See `http` block attributes below. - - -#### `http` - -* `path` - (Required) Path array of path regex associated with a backend. Incoming urls matching the path are forwarded to the backend, see below for `path` block structure. - -#### `path` - -* `path` - (Required) A string or an extended POSIX regular expression as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend. -* `backend` - (Required) Backend defines the referenced service endpoint to which the traffic will be forwarded to. - -### `tls` - -#### Arguments - -* `hosts` - (Optional) Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified. -* `secret_name` - (Optional) SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing. - -## Attributes - -### `status` - -* `status` - Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -#### `load_balancer` - -* LoadBalancer contains the current status of the load-balancer, if one is present. - -##### `ingress` - -* `ingress` - Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -###### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). - - -## Import - -Ingress can be imported using its namespace and name: - -``` -terraform import kubernetes_ingress. / -``` - -e.g. - -``` -$ terraform import kubernetes_ingress.example default/terraform-name -``` diff --git a/website/docs/r/ingress_class.html.markdown b/website/docs/r/ingress_class.html.markdown deleted file mode 100644 index 62bcd1a121..0000000000 --- a/website/docs/r/ingress_class.html.markdown +++ /dev/null @@ -1,90 +0,0 @@ ---- -subcategory: "networking/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_ingress_class" -description: |- - Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. ---- - -# kubernetes_ingress_class - -Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. - - -## Example Usage - -```hcl -resource "kubernetes_ingress_class" "example" { - metadata { - name = "example" - } - - spec { - controller = "example.com/ingress-controller" - parameters { - api_group = "k8s.example.com" - kind = "IngressParameters" - name = "external-lb" - } - } -} -``` - - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard ingress's metadata. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Spec defines the behavior of a ingress. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `wait_for_load_balancer` - (Optional) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. Defaults to `false`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the ingress class, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `controller` - (Required) the name of the controller that should handle this class. -* `parameters` - (Optional) Parameters is a link to a custom resource containing additional configuration for the controller. See `parameters` block attributes below. - -### `parameters` - -#### Arguments - -* `name` - (Required) The name of resource being referenced. -* `kind` - (Required) The type of resource being referenced. -* `api_group` - (Optional) The group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. -* `scope` - (Optional) Refers to a cluster or namespace scoped resource. This may be set to "Cluster" (default) or "Namespace". Field can be enabled with IngressClassNamespacedParams feature gate. -* `namespace` - (Optional) The namespace of the resource being referenced. This field is required when scope is set to "Namespace" and must be unset when scope is set to "Cluster". - -## Import - -Ingress Classes can be imported using its name, e.g: - -``` -$ terraform import kubernetes_ingress_class.example example -``` diff --git a/website/docs/r/ingress_class_v1.html.markdown b/website/docs/r/ingress_class_v1.html.markdown deleted file mode 100644 index 2bd16952ba..0000000000 --- a/website/docs/r/ingress_class_v1.html.markdown +++ /dev/null @@ -1,90 +0,0 @@ ---- -subcategory: "networking/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_ingress_class_v1" -description: |- - Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. ---- - -# kubernetes_ingress_class_v1 - -Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. - - -## Example Usage - -```hcl -resource "kubernetes_ingress_class_v1" "example" { - metadata { - name = "example" - } - - spec { - controller = "example.com/ingress-controller" - parameters { - api_group = "k8s.example.com" - kind = "IngressParameters" - name = "external-lb" - } - } -} -``` - - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard ingress's metadata. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Spec defines the behavior of a ingress. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `wait_for_load_balancer` - (Optional) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. Defaults to `false`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the ingress class, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `controller` - (Required) the name of the controller that should handle this class. -* `parameters` - (Optional) Parameters is a link to a custom resource containing additional configuration for the controller. See `parameters` block attributes below. - -### `parameters` - -#### Arguments - -* `name` - (Required) The name of resource being referenced. -* `kind` - (Required) The type of resource being referenced. -* `api_group` - (Optional) The group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. -* `scope` - (Optional) Refers to a cluster or namespace scoped resource. This may be set to "Cluster" (default) or "Namespace". Field can be enabled with IngressClassNamespacedParams feature gate. -* `namespace` - (Optional) The namespace of the resource being referenced. This field is required when scope is set to "Namespace" and must be unset when scope is set to "Cluster". - -## Import - -Ingress Classes can be imported using its name, e.g: - -``` -$ terraform import kubernetes_ingress_class_v1.example example -``` diff --git a/website/docs/r/ingress_v1.html.markdown b/website/docs/r/ingress_v1.html.markdown deleted file mode 100644 index 2fab5c97a8..0000000000 --- a/website/docs/r/ingress_v1.html.markdown +++ /dev/null @@ -1,327 +0,0 @@ ---- -subcategory: "networking/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_ingress_v1" -description: |- - Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. ---- - -# kubernetes_ingress_v1 - -Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. - -## Example Usage - -```hcl -resource "kubernetes_ingress_v1" "example_ingress" { - metadata { - name = "example-ingress" - } - - spec { - default_backend { - service { - name = "myapp-1" - port { - number = 8080 - } - } - } - - rule { - http { - path { - backend { - service { - name = "myapp-1" - port { - number = 8080 - } - } - } - - path = "/app1/*" - } - - path { - backend { - service { - name = "myapp-2" - port { - number = 8080 - } - } - } - - path = "/app2/*" - } - } - } - - tls { - secret_name = "tls-secret" - } - } -} - -resource "kubernetes_service_v1" "example" { - metadata { - name = "myapp-1" - } - spec { - selector = { - app = kubernetes_pod_v1.example.metadata.0.labels.app - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "NodePort" - } -} - -resource "kubernetes_service_v1" "example2" { - metadata { - name = "myapp-2" - } - spec { - selector = { - app = kubernetes_pod_v1.example2.metadata.0.labels.app - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "NodePort" - } -} - -resource "kubernetes_pod_v1" "example" { - metadata { - name = "terraform-example" - labels = { - app = "myapp-1" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - port { - container_port = 80 - } - } - } -} - -resource "kubernetes_pod_v1" "example2" { - metadata { - name = "terraform-example2" - labels = { - app = "myapp-2" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - port { - container_port = 80 - } - } - } -} -``` - -## Example using Nginx ingress controller - -```hcl -resource "kubernetes_service_v1" "example" { - metadata { - name = "ingress-service" - } - spec { - port { - port = 80 - target_port = 80 - protocol = "TCP" - } - type = "NodePort" - } -} - -resource "kubernetes_ingress_v1" "example" { - wait_for_load_balancer = true - metadata { - name = "example" - } - spec { - ingress_class_name = "nginx" - rule { - http { - path { - path = "/*" - backend { - service { - name = kubernetes_service_v1.example.metadata.0.name - port { - number = 80 - } - } - } - } - } - } - } -} - -# Display load balancer hostname (typically present in AWS) -output "load_balancer_hostname" { - value = kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.hostname -} - -# Display load balancer IP (typically present in GCP, or using Nginx ingress controller) -output "load_balancer_ip" { - value = kubernetes_ingress_v1.example.status.0.load_balancer.0.ingress.0.ip -} -``` - - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard ingress's metadata. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Spec defines the behavior of a ingress. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `wait_for_load_balancer` - (Optional) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. Defaults to `false`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the ingress that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `default_backend` - (Optional) DefaultBackend is the backend that should handle requests that don't match any rule. If Rules are not specified, DefaultBackend must be specified. If DefaultBackend is not set, the handling of requests that do not match any of the rules will be up to the Ingress controller. See `backend` block attributes below. -* `rule` - (Optional) A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. See `rule` block attributes below. -* `tls` - (Optional) TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. See `tls` block attributes below. -* `ingress_class_name` - (Optional) The ingress class name references an IngressClass resource that contains additional configuration including the name of the controller that should implement the class. - -### `backend` - -#### Arguments - - -* `resource` - (Optional) Resource is an ObjectRef to another Kubernetes resource in the namespace of the Ingress object. If resource is specified, a `service.name` and `service.port` must not be specified. -* `service` - (Optional) Service references a Service as a Backend. - -### `service` - -#### Arguments - -* `name` - (Optional) Specifies the name of the referenced service. -* `port` - (Optional) Specifies the port of the referenced service. - -### `port` - -* `name` - (Optional) Name is the name of the port on the Service. -* `number` - (Optional) Number is the numerical port number (e.g. 80) on the Service. - - -#### Arguments - -### `rule` - -#### Arguments - -* `host` - (Optional) Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the IP in the Spec of the parent Ingress. 2. The : delimiter is not respected because ports are not allowed. Currently the port of an Ingress is implicitly :80 for http and :443 for https. Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue. -* `http` - (Optional) http is a list of http selectors pointing to backends. In the example: http:///? -> backend where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'. See `http` block attributes below. - - -#### `http` - -* `path` - (Required) Path array of path regex associated with a backend. Incoming urls matching the path are forwarded to the backend, see below for `path` block structure. - -#### `path` - -* `path` - (Required) A string or an extended POSIX regular expression as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend. -* `path_type` - (Optional) PathType determines the interpretation of the Path matching. PathType can be one of the following values: `ImplementationSpecific`, `Exact`, or `Prefix`. See the [Kubernetes Ingress documentation](https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types) for details. -* `backend` - (Required) Backend defines the referenced service endpoint to which the traffic will be forwarded to. - -### `tls` - -#### Arguments - -* `hosts` - (Optional) Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified. -* `secret_name` - (Optional) SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing. - -## Attributes - -### `status` - -* `status` - Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -#### `load_balancer` - -* LoadBalancer contains the current status of the load-balancer, if one is present. - -##### `ingress` - -* `ingress` - Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -###### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). - -## Timeouts - -The following [Timeout](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts) configuration options are available for the `kubernetes_ingress_v1` resource: - -* `create` - ingress load balancer creation timeout (default `20 minutes`). -* `delete` - ingress load balancer deletion timeout (default `20 minutes`). - -## Import - -Ingress can be imported using its namespace and name: - -``` -terraform import kubernetes_ingress_v1. / -``` - -e.g. - -``` -$ terraform import kubernetes_ingress_v1.example default/terraform-name -``` diff --git a/website/docs/r/job.html.markdown b/website/docs/r/job.html.markdown deleted file mode 100644 index 2491e20489..0000000000 --- a/website/docs/r/job.html.markdown +++ /dev/null @@ -1,174 +0,0 @@ ---- -subcategory: "batch/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_job" -description: |- - A Job creates one or more Pods and ensures that a specified number of them successfully terminate. You can also use a Job to run multiple Pods in parallel. ---- - -# kubernetes_job - - A Job creates one or more Pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. - - A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot. - - You can also use a Job to run multiple Pods in parallel. - -## Example Usage - No waiting - -```hcl -resource "kubernetes_job" "demo" { - metadata { - name = "demo" - } - spec { - template { - metadata {} - spec { - container { - name = "pi" - image = "alpine" - command = ["sh", "-c", "sleep 10"] - } - restart_policy = "Never" - } - } - backoff_limit = 4 - } - wait_for_completion = false -} -``` - -## Example Usage - waiting for job successful completion - -```hcl -resource "kubernetes_job" "demo" { - metadata { - name = "demo" - } - spec { - template { - metadata {} - spec { - container { - name = "pi" - image = "perl" - command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] - } - restart_policy = "Never" - } - } - backoff_limit = 4 - } - wait_for_completion = true - timeouts { - create = "2m" - update = "2m" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource's metadata. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Specification of the desired behavior of a job. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `wait_for_completion` - -(Optional) If `true` blocks job `create` or `update` until the status of the job has a `Complete` or `Failed` condition. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `active_deadline_seconds` - (Optional) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. -* `backoff_limit` - (Optional) Specifies the number of retries before marking this job failed. Defaults to 6 -* `completions` - (Optional) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `completion_mode` - (Optional) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode). -* `pod_failure_policy` - (Optional) Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure. -* `manual_selector` - (Optional) Controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector -* `parallelism` - (Optional) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when `((.spec.completions - .status.successful) < .spec.parallelism)`, i.e. when the work left to do is less than max parallelism. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `selector` - (Optional) A label query over pods that should match the pod count. Normally, the system sets this field for you. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors -* `template` - (Optional) Describes the pod that will be created when executing a job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `ttl_seconds_after_finished` - (Optional) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. - -### `pod_failure_policy` - -#### Arguments - -* `rule` - (Required) A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. - -### `rule` - -#### Arguments - -* `action` - (Optional) Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. -* `on_exit_codes` - (Optional) Represents the requirement on the container exit codes. -* `on_pod_condition` - (Optional) Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. - -### `on_exit_codes` - -#### Arguments - -* `container_name` - (Optional) Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template. -* `operator` - (Optional) Represents the relationship between the container exit code(s) and the specified values. -* `values` - (Required) Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. - -### `on_pod_condition` - -#### Arguments - -* `status` - (Optional) Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True. -* `type` - (Optional) Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type. - -### `selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) 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. - -### `template` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/language/resources/syntax.html#operation-timeouts) configuration options are available for the `kubernetes_job` resource when used with `wait_for_completion = true`: - -* `create` - (Default `1m`) Used for creating a new job and waiting for a successful job completion. -* `update` - (Default `1m`) Used for updating an existing job and waiting for a successful job completion. - -Note: - -- Kubernetes provider will treat update operations that change the Job spec resulting in the job re-run as "# forces replacement". -In such cases, the `create` timeout value is used for both Create and Update operations. -- `wait_for_completion` is not applicable during Delete operations; thus, there is no "delete" timeout value for Delete operation. diff --git a/website/docs/r/job_v1.html.markdown b/website/docs/r/job_v1.html.markdown deleted file mode 100644 index 1163b23685..0000000000 --- a/website/docs/r/job_v1.html.markdown +++ /dev/null @@ -1,174 +0,0 @@ ---- -subcategory: "batch/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_job_v1" -description: |- - A Job creates one or more Pods and ensures that a specified number of them successfully terminate. You can also use a Job to run multiple Pods in parallel. ---- - -# kubernetes_job_v1 - - A Job creates one or more Pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. - - A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot. - - You can also use a Job to run multiple Pods in parallel. - -## Example Usage - No waiting - -```hcl -resource "kubernetes_job_v1" "demo" { - metadata { - name = "demo" - } - spec { - template { - metadata {} - spec { - container { - name = "pi" - image = "perl" - command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] - } - restart_policy = "Never" - } - } - backoff_limit = 4 - } - wait_for_completion = false -} -``` - -## Example Usage - waiting for job successful completion - -```hcl -resource "kubernetes_job_v1" "demo" { - metadata { - name = "demo" - } - spec { - template { - metadata {} - spec { - container { - name = "pi" - image = "perl" - command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] - } - restart_policy = "Never" - } - } - backoff_limit = 4 - } - wait_for_completion = true - timeouts { - create = "2m" - update = "2m" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource's metadata. For more info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata -* `spec` - (Required) Specification of the desired behavior of a job. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `wait_for_completion` - -(Optional) If `true` blocks job `create` or `update` until the status of the job has a `Complete` or `Failed` condition. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `active_deadline_seconds` - (Optional) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. -* `backoff_limit` - (Optional) Specifies the number of retries before marking this job failed. Defaults to 6 -* `completions` - (Optional) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `completion_mode` - (Optional) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode). -* `manual_selector` - (Optional) Controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector -* `pod_failure_policy` - (Optional) Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure. -* `parallelism` - (Optional) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when `((.spec.completions - .status.successful) < .spec.parallelism)`, i.e. when the work left to do is less than max parallelism. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `selector` - (Optional) A label query over pods that should match the pod count. Normally, the system sets this field for you. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors -* `template` - (Optional) Describes the pod that will be created when executing a job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ -* `ttl_seconds_after_finished` - (Optional) ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. - -### `pod_failure_policy` - -#### Arguments - -* `rule` - (Required) A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. - -### `rule` - -#### Arguments - -* `action` - (Optional) Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. -* `on_exit_codes` - (Optional) Represents the requirement on the container exit codes. -* `on_pod_condition` - (Optional) Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. - -### `on_exit_codes` - -#### Arguments - -* `container_name` - (Optional) Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template. -* `operator` - (Optional) Represents the relationship between the container exit code(s) and the specified values. -* `values` - (Required) Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. - -### `on_pod_condition` - -#### Arguments - -* `status` - (Optional) Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True. -* `type` - (Optional) Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type. - -### `selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) 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. - -### `template` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/language/resources/syntax.html#operation-timeouts) configuration options are available for the `kubernetes_job_v1` resource when used with `wait_for_completion = true`: - -* `create` - (Default `1m`) Used for creating a new job and waiting for a successful job completion. -* `update` - (Default `1m`) Used for updating an existing job and waiting for a successful job completion. - -Note: - -- Kubernetes provider will treat update operations that change the Job spec resulting in the job re-run as "# forces replacement". -In such cases, the `create` timeout value is used for both Create and Update operations. -- `wait_for_completion` is not applicable during Delete operations; thus, there is no "delete" timeout value for Delete operation. diff --git a/website/docs/r/limit_range.html.markdown b/website/docs/r/limit_range.html.markdown deleted file mode 100644 index 12cddf4b0a..0000000000 --- a/website/docs/r/limit_range.html.markdown +++ /dev/null @@ -1,102 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_limit_range" -description: |- - Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. ---- - -# kubernetes_limit_range - -Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. - -Read more in [the official docs](https://kubernetes.io/docs/concepts/policy/limit-range/). - - -## Example Usage - -```hcl -resource "kubernetes_limit_range" "example" { - metadata { - name = "terraform-example" - } - spec { - limit { - type = "Pod" - max = { - cpu = "200m" - memory = "1024Mi" - } - } - limit { - type = "PersistentVolumeClaim" - min = { - storage = "24M" - } - } - limit { - type = "Container" - default = { - cpu = "50m" - memory = "24Mi" - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard limit range's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Optional) Spec defines the limits enforced. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `spec` - -#### Arguments - -* `limit` - (Optional) The list of limits that are enforced. - -### `limit` - -#### Arguments - -* `default` - (Optional) Default resource requirement limit value by resource name if resource limit is omitted. -* `default_request` - (Optional) The default resource requirement request value by resource name if resource request is omitted. -* `max` - (Optional) Max usage constraints on this kind by resource name. -* `max_limit_request_ratio` - (Optional) The named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. -* `min` - (Optional) Min usage constraints on this kind by resource name. -* `type` - (Optional) Type of resource that this limit applies to. e.g. `Pod`, `Container` or `PersistentVolumeClaim` - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the limit range that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the limit range. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the limit range, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the limit range must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this limit range that can be used by clients to determine when limit range has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this limit range. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -Limit Range can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_limit_range.example default/terraform-example -``` diff --git a/website/docs/r/limit_range_v1.html.markdown b/website/docs/r/limit_range_v1.html.markdown deleted file mode 100644 index a4f50c8ce8..0000000000 --- a/website/docs/r/limit_range_v1.html.markdown +++ /dev/null @@ -1,102 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_limit_range_v1" -description: |- - Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. ---- - -# kubernetes_limit_range_v1 - -Limit Range sets resource usage limits (e.g. memory, cpu, storage) for supported kinds of resources in a namespace. - -Read more in [the official docs](https://kubernetes.io/docs/concepts/policy/limit-range/). - - -## Example Usage - -```hcl -resource "kubernetes_limit_range_v1" "example" { - metadata { - name = "terraform-example" - } - spec { - limit { - type = "Pod" - max = { - cpu = "200m" - memory = "1024Mi" - } - } - limit { - type = "PersistentVolumeClaim" - min = { - storage = "24M" - } - } - limit { - type = "Container" - default = { - cpu = "50m" - memory = "24Mi" - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard limit range's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Optional) Spec defines the limits enforced. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `spec` - -#### Arguments - -* `limit` - (Optional) The list of limits that are enforced. - -### `limit` - -#### Arguments - -* `default` - (Optional) Default resource requirement limit value by resource name if resource limit is omitted. -* `default_request` - (Optional) The default resource requirement request value by resource name if resource request is omitted. -* `max` - (Optional) Max usage constraints on this kind by resource name. -* `max_limit_request_ratio` - (Optional) The named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. -* `min` - (Optional) Min usage constraints on this kind by resource name. -* `type` - (Optional) Type of resource that this limit applies to. e.g. `Pod`, `Container` or `PersistentVolumeClaim` - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the limit range that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the limit range. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the limit range, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the limit range must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this limit range that can be used by clients to determine when limit range has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this limit range. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -Limit Range can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_limit_range_v1.example default/terraform-example -``` diff --git a/website/docs/r/mutating_webhook_configuration.html.markdown b/website/docs/r/mutating_webhook_configuration.html.markdown deleted file mode 100644 index f0e6c87772..0000000000 --- a/website/docs/r/mutating_webhook_configuration.html.markdown +++ /dev/null @@ -1,135 +0,0 @@ ---- -subcategory: "admissionregistration/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_mutating_webhook_configuration" -description: |- - Mutating Webhook Configuration configures a mutating admission webhook ---- - -# kubernetes_mutating_webhook_configuration - -Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). - -## Example Usage - -```hcl -resource "kubernetes_mutating_webhook_configuration" "example" { - metadata { - name = "test.terraform.io" - } - - webhook { - name = "test.terraform.io" - - admission_review_versions = ["v1", "v1beta1"] - - client_config { - service { - namespace = "example-namespace" - name = "example-service" - } - } - - rule { - api_groups = ["apps"] - api_versions = ["v1"] - operations = ["CREATE"] - resources = ["deployments"] - scope = "Namespaced" - } - - reinvocation_policy = "IfNeeded" - side_effects = "None" - } -} -``` - - -## API version support - -The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Mutating Webhook Configuration metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `webhook` - (Required) A list of webhooks and the affected resources and operations. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the Mutating Webhook Configuration that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the Mutating Webhook Configuration. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the Mutating Webhook Configuration, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this Mutating Webhook Configuration that can be used by clients to determine when Mutating Webhook Configuration has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this Mutating Webhook Configuration. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `webhook` - -#### Arguments - -* `admission_review_versions` - (Optional) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list are supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. -* `client_config` - (Required) ClientConfig defines how to communicate with the hook. -* `failure_policy` - (Optional) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - Allowed values are "Ignore" or "Fail". Defaults to "Fail". -* `match_policy` - (Optional) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. Defaults to "Equivalent" -* `name` - (Required) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. -* `namespace_selector` - (Optional) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "runlevel", "operator": "NotIn", "values": [ "0", "1" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "environment", "operator": "In", "values": [ "prod", "staging" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. Default to the empty LabelSelector, which matches everything. -* `object_selector` - (Optional) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. -* `reinvocation_policy` - (Optional) reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded". Never: the webhook will not be called more than once in a single admission evaluation. IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: *the number of additional invocations is not guaranteed to be exactly one.* if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. *webhooks that use this option may be reordered to minimize the number of additional invocations.* to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. Defaults to "Never". -* `rule` - (Optional) Describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. -* `side_effects` - (Required) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. -* `timeout_seconds` - (Optional) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. - - -### `client_config` - -#### Arguments - -* `ca_bundle` - (Optional) A PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. -* `service` - (Optional) A reference to the service for this webhook. Either `service` or `url` must be specified. If the webhook is running within the cluster, then you should use `service`. -* `url` - (Optional) Gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. - -~> Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be "https"; the URL must begin with "https://". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. - -### `service` - -#### Arguments - -* `name` - (Required) The name of the service. -* `namespace` - (Required) The namespace of the service. -* `path` - (Optional) The URL path which will be sent in any request to this service. -* `port` - (Optional) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). - -### `rule` - -#### Arguments - -* `api_groups` - (Required) The API groups the resources belong to. '\*' is all groups. If '\*' is present, the length of the list must be one. -* `api_versions` - (Required) The API versions the resources belong to. '\*' is all versions. If '\*' is present, the length of the list must be one. -* `operations` - (Required) The operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '\*' is present, the length of the list must be one. -* `resources` - (Required) A list of resources this rule applies to. For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '\*' means all resources, but not subresources. 'pods/\*' means all subresources of pods. '\*/scale' means all scale subresources. '\*/\*' means all resources and their subresources. If wildcard is present, the validation rule will ensure resources do not overlap with each other. Depending on the enclosing object, subresources might not be allowed. -* `scope` - (Optional) Specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". - -## Import - -Mutating Webhook Configuration can be imported using the name, e.g. - -``` -$ terraform import kubernetes_mutating_webhook_configuration.example terraform-example -``` diff --git a/website/docs/r/mutating_webhook_configuration_v1.html.markdown b/website/docs/r/mutating_webhook_configuration_v1.html.markdown deleted file mode 100644 index a602e80c70..0000000000 --- a/website/docs/r/mutating_webhook_configuration_v1.html.markdown +++ /dev/null @@ -1,135 +0,0 @@ ---- -subcategory: "admissionregistration/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_mutating_webhook_configuration_v1" -description: |- - Mutating Webhook Configuration configures a mutating admission webhook ---- - -# kubernetes_mutating_webhook_configuration_v1 - -Mutating Webhook Configuration configures a [mutating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). - -## Example Usage - -```hcl -resource "kubernetes_mutating_webhook_configuration_v1" "example" { - metadata { - name = "test.terraform.io" - } - - webhook { - name = "test.terraform.io" - - admission_review_versions = ["v1", "v1beta1"] - - client_config { - service { - namespace = "example-namespace" - name = "example-service" - } - } - - rule { - api_groups = ["apps"] - api_versions = ["v1"] - operations = ["CREATE"] - resources = ["deployments"] - scope = "Namespaced" - } - - reinvocation_policy = "IfNeeded" - side_effects = "None" - } -} -``` - - -## API version support - -The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Mutating Webhook Configuration metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `webhook` - (Required) A list of webhooks and the affected resources and operations. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the Mutating Webhook Configuration that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the Mutating Webhook Configuration. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the Mutating Webhook Configuration, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this Mutating Webhook Configuration that can be used by clients to determine when Mutating Webhook Configuration has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this Mutating Webhook Configuration. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `webhook` - -#### Arguments - -* `admission_review_versions` - (Optional) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list are supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. -* `client_config` - (Required) ClientConfig defines how to communicate with the hook. -* `failure_policy` - (Optional) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - Allowed values are "Ignore" or "Fail". Defaults to "Fail". -* `match_policy` - (Optional) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. Defaults to "Equivalent" -* `name` - (Required) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. -* `namespace_selector` - (Optional) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "runlevel", "operator": "NotIn", "values": [ "0", "1" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "environment", "operator": "In", "values": [ "prod", "staging" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. Default to the empty LabelSelector, which matches everything. -* `object_selector` - (Optional) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. -* `reinvocation_policy` - (Optional) reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded". Never: the webhook will not be called more than once in a single admission evaluation. IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: *the number of additional invocations is not guaranteed to be exactly one.* if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. *webhooks that use this option may be reordered to minimize the number of additional invocations.* to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. Defaults to "Never". -* `rule` - (Optional) Describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. -* `side_effects` - (Required) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. -* `timeout_seconds` - (Optional) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. - - -### `client_config` - -#### Arguments - -* `ca_bundle` - (Optional) A PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. -* `service` - (Optional) A reference to the service for this webhook. Either `service` or `url` must be specified. If the webhook is running within the cluster, then you should use `service`. -* `url` - (Optional) Gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. - -~> Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be "https"; the URL must begin with "https://". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. - -### `service` - -#### Arguments - -* `name` - (Required) The name of the service. -* `namespace` - (Required) The namespace of the service. -* `path` - (Optional) The URL path which will be sent in any request to this service. -* `port` - (Optional) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). - -### `rule` - -#### Arguments - -* `api_groups` - (Required) The API groups the resources belong to. '\*' is all groups. If '\*' is present, the length of the list must be one. -* `api_versions` - (Required) The API versions the resources belong to. '\*' is all versions. If '\*' is present, the length of the list must be one. -* `operations` - (Required) The operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '\*' is present, the length of the list must be one. -* `resources` - (Required) A list of resources this rule applies to. For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '\*' means all resources, but not subresources. 'pods/\*' means all subresources of pods. '\*/scale' means all scale subresources. '\*/\*' means all resources and their subresources. If wildcard is present, the validation rule will ensure resources do not overlap with each other. Depending on the enclosing object, subresources might not be allowed. -* `scope` - (Optional) Specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". - -## Import - -Mutating Webhook Configuration can be imported using the name, e.g. - -``` -$ terraform import kubernetes_mutating_webhook_configuration_v1.example terraform-example -``` diff --git a/website/docs/r/namespace.html.markdown b/website/docs/r/namespace.html.markdown deleted file mode 100644 index 93827a0557..0000000000 --- a/website/docs/r/namespace.html.markdown +++ /dev/null @@ -1,79 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_namespace" -description: |- - Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. ---- - -# kubernetes_namespace - -Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. -Read more about namespaces at [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/). - -## Example Usage - -```hcl -resource "kubernetes_namespace" "example" { - metadata { - annotations = { - name = "example-annotation" - } - - labels = { - mylabel = "label-value" - } - - name = "terraform-example-namespace" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard namespace's [metadata](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). - -### Timeouts - -`kubernetes_namespace` provides the following -[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: - -- `delete` - Default `5 minutes` - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/). - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more about [name idempotency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency). -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) namespaces. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). - -* `name` - (Optional) Name of the namespace, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespaces have changed. Read more about [concurrency control and consistency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency). -* `uid` - The unique in time and space value for this namespace. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids). - -## Attribute Reference - -* `wait_for_default_service_account` - (Optional) When set to `true` Terraform will wait until the default service account has been asynchronously created by Kubernetes when creating the namespace resource. This has the equivalent effect of creating a `kubernetes_default_service_account` resource for dependent resources but allows a user to consume the "default" service account directly. The default behaviour (`false`) does not wait for the default service account to exist. - -## Import - -Namespaces can be imported using their name, e.g. - -``` -$ terraform import kubernetes_namespace.n terraform-example-namespace -``` - diff --git a/website/docs/r/namespace_v1.html.markdown b/website/docs/r/namespace_v1.html.markdown deleted file mode 100644 index 6588ebaab3..0000000000 --- a/website/docs/r/namespace_v1.html.markdown +++ /dev/null @@ -1,78 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_namespace_v1" -description: |- - Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. ---- - -# kubernetes_namespace_v1 - -Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. -Read more about namespaces at [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) - -## Example Usage - -```hcl -resource "kubernetes_namespace_v1" "example" { - metadata { - annotations = { - name = "example-annotation" - } - - labels = { - mylabel = "label-value" - } - - name = "terraform-example-namespace" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard namespace's [metadata](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). - -### Timeouts - -`kubernetes_namespace_v1` provides the following -[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: - -- `delete` - Default `5 minutes` - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the namespace that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more about [name idempotency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency). -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) namespaces. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the namespace, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this namespace that can be used by clients to determine when namespaces have changed. Read more about [concurrency control and consistency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency). -* `uid` - The unique in time and space value for this namespace. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Attribute Reference - -* `wait_for_default_service_account` - (Optional) When set to `true` Terraform will wait until the default service account has been asynchronously created by Kubernetes when creating the namespace resource. This has the equivalent effect of creating a `kubernetes_default_service_account_v1` resource for dependent resources but allows a user to consume the "default" service account directly. The default behaviour (`false`) does not wait for the default service account to exist. - -## Import - -Namespaces can be imported using their name, e.g. - -``` -$ terraform import kubernetes_namespace_v1.n terraform-example-namespace -``` diff --git a/website/docs/r/network_policy.html.markdown b/website/docs/r/network_policy.html.markdown deleted file mode 100644 index 63062a9bbf..0000000000 --- a/website/docs/r/network_policy.html.markdown +++ /dev/null @@ -1,189 +0,0 @@ ---- -subcategory: "networking/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_network_policy" -description: |- - Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. - NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. ---- - -# kubernetes_network_policy - -Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. -NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. -Read more about network policies at https://kubernetes.io/docs/concepts/services-networking/network-policies/ - -## Example Usage - -```hcl -resource "kubernetes_network_policy" "example" { - metadata { - name = "terraform-example-network-policy" - namespace = "default" - } - - spec { - pod_selector { - match_expressions { - key = "name" - operator = "In" - values = ["webfront", "api"] - } - } - - ingress { - ports { - port = "http" - protocol = "TCP" - } - ports { - port = "8125" - protocol = "UDP" - } - - from { - namespace_selector { - match_labels = { - name = "default" - } - } - } - - from { - ip_block { - cidr = "10.0.0.0/8" - except = [ - "10.0.0.0/24", - "10.0.1.0/24", - ] - } - } - } - - egress {} # single empty rule to allow all egress traffic - - policy_types = ["Ingress", "Egress"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard network policy's [metadata](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the network policy that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more about [name idempotency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency). -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) network policies. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the network policy, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this network policy that can be used by clients to determine when network policies have changed. Read more about [concurrency control and consistency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency). -* `uid` - The unique in time and space value for this network policy. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - - -### `spec` - -#### Arguments - -* `egress` - (Optional) List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this block is empty then this NetworkPolicy allows all outgoing traffic. If this block is omitted then this NetworkPolicy does not allow any outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). -* `ingress` - (Optional) List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this block is empty then this NetworkPolicy allows all incoming traffic. If this block is omitted then this NetworkPolicy does not allow any incoming traffic (and serves solely to ensure that the pods it selects are isolated by default). -* `pod_selector` - (Required) Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace. -* `policy_types` (Required) List of rule types that the NetworkPolicy relates to. Valid options are `Ingress`, `Egress`, or `Ingress,Egress`. This field is beta-level in 1.8 -**Note**: the native Kubernetes API allows not to specify the `policy_types` property with the following description: - > If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). - - Leaving the `policy_types` property optional here would have prevented an `egress` rule added to a Network Policy initially created without any `egress` rule nor `policy_types` from working as expected. Indeed, the PolicyTypes would have stuck to Ingress server side as the default value is only computed server side on resource creation, not on updates. - -### `ingress` - -#### Arguments - -* `from` - (Optional) List of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least on item, this rule allows traffic only if the traffic matches at least one item in the from list. -* `ports` - (Optional) List of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. - -### `egress` - -#### Arguments - -* `to` - (Optional) List of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list. -* `ports` - (Optional) List of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. - -### `from` - -#### Arguments - -* `namespace_selector` - (Optional) Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If present but empty, this selector selects all namespaces. -* `pod_selector` - (Optional) This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If present but empty, this selector selects all pods in this namespace. - - -### `ports` - -#### Arguments - -* `port` - (Optional) The port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. -* `protocol` - (Optional) The protocol (TCP or UDP) which traffic must match. If not specified, this field defaults to TCP. - - -### `to` - -#### Arguments - -* `ip_block` - (Optional) IPBlock defines policy on a particular IPBlock -* `namespace_selector` - (Optional) Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If present but empty, this selector selects all namespaces. -* `pod_selector` - (Optional) This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If present but empty, this selector selects all pods in this namespace. - -### `ip_block` - -#### Arguments - -* `cidr` - (Optional) CIDR is a string representing the IP Block Valid examples are "192.168.1.1/24" -* `except` - (Optional) Except is a slice of CIDRs that should not be included within an IP Block. Valid examples are "192.168.1.1/24". Except values will be rejected if they are outside the CIDR range. - -### `namespace_selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - - -### `pod_selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - - -### `match_expressions` - -#### Arguments - -* `key` - (Optional) The label key that the selector applies to. -* `operator` - (Optional) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. -* `values` - (Optional) 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. - - -## Import - -Network policies can be imported using their identifier consisting of `/`, e.g.: - -``` -$ terraform import kubernetes_network_policy.example default/terraform-example-network-policy -``` diff --git a/website/docs/r/network_policy_v1.html.markdown b/website/docs/r/network_policy_v1.html.markdown deleted file mode 100644 index a961e2ca04..0000000000 --- a/website/docs/r/network_policy_v1.html.markdown +++ /dev/null @@ -1,189 +0,0 @@ ---- -subcategory: "networking/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_network_policy_v1" -description: |- - Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. - NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. ---- - -# kubernetes_network_policy_v1 - -Kubernetes supports network policies to specify how groups of pods are allowed to communicate with each other and with other network endpoints. -NetworkPolicy resources use labels to select pods and define rules which specify what traffic is allowed to the selected pods. -Read more about network policies at https://kubernetes.io/docs/concepts/services-networking/network-policies/ - -## Example Usage - -```hcl -resource "kubernetes_network_policy_v1" "example" { - metadata { - name = "terraform-example-network-policy" - namespace = "default" - } - - spec { - pod_selector { - match_expressions { - key = "name" - operator = "In" - values = ["webfront", "api"] - } - } - - ingress { - ports { - port = "http" - protocol = "TCP" - } - ports { - port = "8125" - protocol = "UDP" - } - - from { - namespace_selector { - match_labels = { - name = "default" - } - } - } - - from { - ip_block { - cidr = "10.0.0.0/8" - except = [ - "10.0.0.0/24", - "10.0.1.0/24", - ] - } - } - } - - egress {} # single empty rule to allow all egress traffic - - policy_types = ["Ingress", "Egress"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard network policy's [metadata](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the network policy that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more about [name idempotency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency). -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) network policies. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the network policy, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this network policy that can be used by clients to determine when network policies have changed. Read more about [concurrency control and consistency](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency). -* `uid` - The unique in time and space value for this network policy. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - - -### `spec` - -#### Arguments - -* `egress` - (Optional) List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this block is empty then this NetworkPolicy allows all outgoing traffic. If this block is omitted then this NetworkPolicy does not allow any outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). -* `ingress` - (Optional) List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this block is empty then this NetworkPolicy allows all incoming traffic. If this block is omitted then this NetworkPolicy does not allow any incoming traffic (and serves solely to ensure that the pods it selects are isolated by default). -* `pod_selector` - (Required) Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace. -* `policy_types` (Required) List of rule types that the NetworkPolicy relates to. Valid options are `Ingress`, `Egress`, or `Ingress,Egress`. This field is beta-level in 1.8 -**Note**: the native Kubernetes API allows not to specify the `policy_types` property with the following description: - > If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). - - Leaving the `policy_types` property optional here would have prevented an `egress` rule added to a Network Policy initially created without any `egress` rule nor `policy_types` from working as expected. Indeed, the PolicyTypes would have stuck to Ingress server side as the default value is only computed server side on resource creation, not on updates. - -### `ingress` - -#### Arguments - -* `from` - (Optional) List of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least on item, this rule allows traffic only if the traffic matches at least one item in the from list. -* `ports` - (Optional) List of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. - -### `egress` - -#### Arguments - -* `to` - (Optional) List of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list. -* `ports` - (Optional) List of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list. - -### `from` - -#### Arguments - -* `namespace_selector` - (Optional) Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If present but empty, this selector selects all namespaces. -* `pod_selector` - (Optional) This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If present but empty, this selector selects all pods in this namespace. - - -### `ports` - -#### Arguments - -* `port` - (Optional) The port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. -* `protocol` - (Optional) The protocol (TCP or UDP) which traffic must match. If not specified, this field defaults to TCP. - - -### `to` - -#### Arguments - -* `ip_block` - (Optional) IPBlock defines policy on a particular IPBlock -* `namespace_selector` - (Optional) Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If present but empty, this selector selects all namespaces. -* `pod_selector` - (Optional) This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If present but empty, this selector selects all pods in this namespace. - -### `ip_block` - -#### Arguments - -* `cidr` - (Optional) CIDR is a string representing the IP Block Valid examples are "192.168.1.1/24" -* `except` - (Optional) Except is a slice of CIDRs that should not be included within an IP Block. Valid examples are "192.168.1.1/24". Except values will be rejected if they are outside the CIDR range. - -### `namespace_selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - - -### `pod_selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - - -### `match_expressions` - -#### Arguments - -* `key` - (Optional) The label key that the selector applies to. -* `operator` - (Optional) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. -* `values` - (Optional) 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. - - -## Import - -Network policies can be imported using their identifier consisting of `/`, e.g.: - -``` -$ terraform import kubernetes_network_policy_v1.example default/terraform-example-network-policy -``` diff --git a/website/docs/r/persistent_volume.html.markdown b/website/docs/r/persistent_volume.html.markdown deleted file mode 100644 index a9feb29373..0000000000 --- a/website/docs/r/persistent_volume.html.markdown +++ /dev/null @@ -1,366 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume" -description: |- - A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. ---- - -# kubernetes_persistent_volume - -The resource provides a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. -For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - -## Example Usage - -```hcl -resource "kubernetes_persistent_volume" "example" { - metadata { - name = "terraform-example" - } - spec { - capacity = { - storage = "2Gi" - } - access_modes = ["ReadWriteMany"] - persistent_volume_source { - vsphere_volume { - volume_path = "/absolute/path" - } - } - } -} -``` - -## Example: Persistent Volume using Azure Managed Disk - -```hcl -resource "kubernetes_persistent_volume" "example" { - metadata { - name = "example" - } - spec { - capacity = { - storage = "1Gi" - } - access_modes = ["ReadWriteOnce"] - persistent_volume_source { - azure_disk { - caching_mode = "None" - data_disk_uri = azurerm_managed_disk.example.id - disk_name = "example" - kind = "Managed" - } - } - } -} - -provider "azurerm" { - version = ">=2.20.0" - features {} -} - -resource "azurerm_resource_group" "example" { - name = "example" - location = "westus2" -} - - -resource "azurerm_managed_disk" "example" { - name = "example" - location = azurerm_resource_group.example.location - resource_group_name = azurerm_resource_group.example.name - storage_account_type = "Standard_LRS" - create_option = "Empty" - disk_size_gb = "1" - tags = { - environment = azurerm_resource_group.example.name - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec of the persistent volume owned by the cluster. See below. - -## Nested Blocks - -### `spec` - -#### Arguments - -* `access_modes` - (Required) Contains all ways the volume can be mounted. Valid values are `ReadWriteOnce`, `ReadOnlyMany`, `ReadWriteMany`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) -* `capacity` - (Required) A description of the persistent volume's resources and capacity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity) -* `node_affinity` - (Optional) NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume. -* `persistent_volume_reclaim_policy` - (Optional) What happens to a persistent volume when released from its claim. Valid options are Retain (default), Delete and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming) -* `persistent_volume_source` - (Required) The specification of a persistent volume. -* `storage_class_name` - (Optional) The name of the persistent volume's storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class) -* `mount_options` - (Optional) A Kubernetes administrator can specify additional mount options for when a Persistent Volume is mounted on a node. - -~> Not all Persistent Volume types support mount options. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options) - -* `volume_mode` - (Optional) Defines if a volume is used with a formatted filesystem or to remain in raw block state. Possible values are `Block` and `Filesystem`. Default value is `Filesystem`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode) - -### `node_affinity` - -#### Arguments - -* `required` - (Optional) Required specifies hard node constraints that must be met. - -### `required` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -### `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` and `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are `In`, `NotIn`, `Exists`, `DoesNotExist`. `Gt`, and `Lt`. -* `values` - (Optional) 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. - -### `persistent_volume_source` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime. -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/tree/master/mysql-cinder-pd#mysql-installation-with-cinder-volume-plugin. -* `csi` - (Optional) CSI represents storage that is handled by an external CSI driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running. -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk). -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `local` - (Optional) Represents a local storage volume on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#local). -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs). -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime. -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine. - - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage OR the resource ID of an Azure managed data disk if `kind` is `Managed`. -* `disk_name` - (Required) The Name of the data disk in the blob storage OR the name of an Azure managed data disk if `kind` is `Managed`. -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `kind` - (Optional) The type for the data disk. Expected values: `Shared`, `Dedicated`, `Managed`. Defaults to `Shared`. - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key. -* `secret_namespace` - (Optional) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is \"default\" namespace. -* `share_name` - (Required) Share Name - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is /. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. sFor more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. see [secret_ref](#secret_ref) for more details. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `csi` - -#### Arguments - -* `driver` - (Required) the name of the volume driver to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_handle` - (Required) A map that specifies static properties of a volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_attributes` - (Optional) Attributes of the volume to publish. -* `fs_type` - (Optional) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. `ext4`, `xfs`, `ntfs`. -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to `true`. If omitted, the default is `false`. -* `controller_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. -* `node_stage_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. see [secret_ref](#secret_ref) for more details. -* `node_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. -* `controller_expand_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. see [secret_ref](#secret_ref) for more details. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. see [secret_ref](#secret_ref) for more details. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `local` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#local) - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the persistent volume, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this persistent volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. see [secret_ref](#secret_ref) for more details. - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) The Namespace of the referent secret. - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -## Import - -Persistent Volume can be imported using its name, e.g. - -``` -$ terraform import kubernetes_persistent_volume.example terraform-example -``` diff --git a/website/docs/r/persistent_volume_claim.html.markdown b/website/docs/r/persistent_volume_claim.html.markdown deleted file mode 100644 index 8d72d5bf73..0000000000 --- a/website/docs/r/persistent_volume_claim.html.markdown +++ /dev/null @@ -1,121 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume_claim" -description: |- - This resource allows the user to request for and claim to a persistent volume. ---- - -# kubernetes_persistent_volume_claim - -This resource allows the user to request for and claim to a persistent volume. - -## Example Usage - -```hcl -resource "kubernetes_persistent_volume_claim" "example" { - metadata { - name = "exampleclaimname" - } - spec { - access_modes = ["ReadWriteMany"] - resources { - requests = { - storage = "5Gi" - } - } - volume_name = "${kubernetes_persistent_volume.example.metadata.0.name}" - } -} - -resource "kubernetes_persistent_volume" "example" { - metadata { - name = "examplevolumename" - } - spec { - capacity = { - storage = "10Gi" - } - access_modes = ["ReadWriteMany"] - persistent_volume_source { - gce_persistent_disk { - pd_name = "test-123" - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume claim's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the desired characteristics of a volume requested by a pod author. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) -* `wait_until_bound` - (Optional) Whether to wait for the claim to reach `Bound` state (to find volume in which to claim the space) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the persistent volume claim, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the persistent volume claim must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this persistent volume claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `access_modes` - (Required) A set of the desired access modes the volume should have. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes) -* `resources` - (Required) A list of the minimum resources the volume should have. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `selector` - (Optional) A label query over volumes to consider for binding. -* `volume_name` - (Optional) The binding reference to the PersistentVolume backing this claim. -* `storage_class_name` - (Optional) Name of the storage class requested by the claim. -* `volume_mode` - (Optional) Defines what type of volume is required by the claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode) - -### `match_expressions` - -#### Arguments - -* `key` - (Optional) The label key that the selector applies to. -* `operator` - (Optional) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. -* `values` - (Optional) 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. - - -### `resources` - -#### Arguments - -* `limits` - (Optional) Map describing the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Map describing the minimum amount of compute resources required. If this is omitted for a container, it defaults to `limits` if that is explicitly specified, otherwise to an implementation-defined value. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) - -### `selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - -## Import - -Persistent Volume Claim can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_persistent_volume_claim.example default/example-name -``` diff --git a/website/docs/r/persistent_volume_claim_v1.html.markdown b/website/docs/r/persistent_volume_claim_v1.html.markdown deleted file mode 100644 index e13a91d719..0000000000 --- a/website/docs/r/persistent_volume_claim_v1.html.markdown +++ /dev/null @@ -1,121 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume_claim_v1" -description: |- - This resource allows the user to request for and claim to a persistent volume. ---- - -# kubernetes_persistent_volume_claim_v1 - -This resource allows the user to request for and claim to a persistent volume. - -## Example Usage - -```hcl -resource "kubernetes_persistent_volume_claim_v1" "example" { - metadata { - name = "exampleclaimname" - } - spec { - access_modes = ["ReadWriteMany"] - resources { - requests = { - storage = "5Gi" - } - } - volume_name = "${kubernetes_persistent_volume_v1.example.metadata.0.name}" - } -} - -resource "kubernetes_persistent_volume_v1" "example" { - metadata { - name = "examplevolumename" - } - spec { - capacity = { - storage = "10Gi" - } - access_modes = ["ReadWriteMany"] - persistent_volume_source { - gce_persistent_disk { - pd_name = "test-123" - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume claim's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the desired characteristics of a volume requested by a pod author. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) -* `wait_until_bound` - (Optional) Whether to wait for the claim to reach `Bound` state (to find volume in which to claim the space) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the persistent volume claim that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume claim. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the persistent volume claim, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the persistent volume claim must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume claim that can be used by clients to determine when persistent volume claim has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this persistent volume claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `access_modes` - (Required) A set of the desired access modes the volume should have. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes) -* `resources` - (Required) A list of the minimum resources the volume should have. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `selector` - (Optional) A label query over volumes to consider for binding. -* `volume_name` - (Optional) The binding reference to the PersistentVolume backing this claim. -* `storage_class_name` - (Optional) Name of the storage class requested by the claim. -* `volume_mode` - (Optional) Defines what type of volume is required by the claim. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode) - -### `match_expressions` - -#### Arguments - -* `key` - (Optional) The label key that the selector applies to. -* `operator` - (Optional) A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`. -* `values` - (Optional) 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. - - -### `resources` - -#### Arguments - -* `limits` - (Optional) Map describing the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Map describing the minimum amount of compute resources required. If this is omitted for a container, it defaults to `limits` if that is explicitly specified, otherwise to an implementation-defined value. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) - -### `selector` - -#### Arguments - -* `match_expressions` - (Optional) A list of label selector requirements. The requirements are ANDed. -* `match_labels` - (Optional) A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - -## Import - -Persistent Volume Claim can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_persistent_volume_claim_v1.example default/example-name -``` diff --git a/website/docs/r/persistent_volume_v1.html.markdown b/website/docs/r/persistent_volume_v1.html.markdown deleted file mode 100644 index ed6c763f62..0000000000 --- a/website/docs/r/persistent_volume_v1.html.markdown +++ /dev/null @@ -1,366 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_persistent_volume_v1" -description: |- - A Persistent Volume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. ---- - -# kubernetes_persistent_volume_v1 - -The resource provides a piece of networked storage in the cluster provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. Persistent Volumes have a lifecycle independent of any individual pod that uses the PV. -For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) - -## Example Usage - -```hcl -resource "kubernetes_persistent_volume_v1" "example" { - metadata { - name = "terraform-example" - } - spec { - capacity = { - storage = "2Gi" - } - access_modes = ["ReadWriteMany"] - persistent_volume_source { - vsphere_volume { - volume_path = "/absolute/path" - } - } - } -} -``` - -## Example: Persistent Volume using Azure Managed Disk - -```hcl -resource "kubernetes_persistent_volume_v1" "example" { - metadata { - name = "example" - } - spec { - capacity = { - storage = "1Gi" - } - access_modes = ["ReadWriteOnce"] - persistent_volume_source { - azure_disk { - caching_mode = "None" - data_disk_uri = azurerm_managed_disk.example.id - disk_name = "example" - kind = "Managed" - } - } - } -} - -provider "azurerm" { - version = ">=2.20.0" - features {} -} - -resource "azurerm_resource_group" "example" { - name = "example" - location = "westus2" -} - - -resource "azurerm_managed_disk" "example" { - name = "example" - location = azurerm_resource_group.example.location - resource_group_name = azurerm_resource_group.example.name - storage_account_type = "Standard_LRS" - create_option = "Empty" - disk_size_gb = "1" - tags = { - environment = azurerm_resource_group.example.name - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard persistent volume's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec of the persistent volume owned by the cluster. See below. - -## Nested Blocks - -### `spec` - -#### Arguments - -* `access_modes` - (Required) Contains all ways the volume can be mounted. Valid values are `ReadWriteOnce`, `ReadOnlyMany`, `ReadWriteMany`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) -* `capacity` - (Required) A description of the persistent volume's resources and capacity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity) -* `node_affinity` - (Optional) NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume. -* `persistent_volume_reclaim_policy` - (Optional) What happens to a persistent volume when released from its claim. Valid options are Retain (default), Delete and Recycle. Recycling must be supported by the volume plugin underlying this persistent volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming) -* `persistent_volume_source` - (Required) The specification of a persistent volume. -* `storage_class_name` - (Optional) The name of the persistent volume's storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class) -* `mount_options` - (Optional) A Kubernetes administrator can specify additional mount options for when a Persistent Volume is mounted on a node. - -~> Not all Persistent Volume types support mount options. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options) - -* `volume_mode` - (Optional) Defines if a volume is used with a formatted filesystem or to remain in raw block state. Possible values are `Block` and `Filesystem`. Default value is `Filesystem`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode) - -### `node_affinity` - -#### Arguments - -* `required` - (Optional) Required specifies hard node constraints that must be met. - -### `required` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -### `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` and `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are `In`, `NotIn`, `Exists`, `DoesNotExist`. `Gt`, and `Lt`. -* `values` - (Optional) 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. - -### `persistent_volume_source` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime. -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/tree/master/mysql-cinder-pd#mysql-installation-with-cinder-volume-plugin. -* `csi` - (Optional) CSI represents storage that is handled by an external CSI driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running. -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk). -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `local` - (Optional) Represents a local storage volume on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#local). -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs). -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime. -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine. - - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage OR the resource ID of an Azure managed data disk if `kind` is `Managed`. -* `disk_name` - (Required) The Name of the data disk in the blob storage OR the name of an Azure managed data disk if `kind` is `Managed`. -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `kind` - (Optional) The type for the data disk. Expected values: `Shared`, `Dedicated`, `Managed`. Defaults to `Shared`. - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key. -* `secret_namespace` - (Optional) The namespace of the secret that contains Azure Storage Account Name and Key. For Kubernetes up to 1.18.x the default is the same as the Pod. For Kubernetes 1.19.x and later the default is \"default\" namespace. -* `share_name` - (Required) Share Name - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is /. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. sFor more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. see [secret_ref](#secret_ref) for more details. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `csi` - -#### Arguments - -* `driver` - (Required) the name of the volume driver to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_handle` - (Required) A map that specifies static properties of a volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_attributes` - (Optional) Attributes of the volume to publish. -* `fs_type` - (Optional) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. `ext4`, `xfs`, `ntfs`. -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to `true`. If omitted, the default is `false`. -* `controller_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. -* `node_stage_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. see [secret_ref](#secret_ref) for more details. -* `node_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. -* `controller_expand_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. see [secret_ref](#secret_ref) for more details. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. see [secret_ref](#secret_ref) for more details. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `local` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#local) - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the persistent volume that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the persistent volume. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the persistent volume, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this persistent volume that can be used by clients to determine when persistent volume has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this persistent volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. see [secret_ref](#secret_ref) for more details. - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) The Namespace of the referent secret. - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -## Import - -Persistent Volume can be imported using its name, e.g. - -``` -$ terraform import kubernetes_persistent_volume_v1.example terraform-example -``` diff --git a/website/docs/r/pod.html.markdown b/website/docs/r/pod.html.markdown deleted file mode 100644 index e43d706adf..0000000000 --- a/website/docs/r/pod.html.markdown +++ /dev/null @@ -1,989 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod" -description: |- - A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. ---- - -# kubernetes_pod - -A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) - -## Example Usage - -```hcl -resource "kubernetes_pod" "test" { - metadata { - name = "terraform-example" - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - env { - name = "environment" - value = "test" - } - - port { - container_port = 80 - } - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - } - - dns_config { - nameservers = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] - searches = ["example.com"] - - option { - name = "ndots" - value = 1 - } - - option { - name = "use-vc" - } - } - - dns_policy = "None" - } -} -``` - -terraform version of the [pods/pod-with-node-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml) example. - -```hcl -resource "kubernetes_pod" "with_node_affinity" { - metadata { - name = "with-node-affinity" - } - - spec { - affinity { - node_affinity { - required_during_scheduling_ignored_during_execution { - node_selector_term { - match_expressions { - key = "kubernetes.io/e2e-az-name" - operator = "In" - values = ["e2e-az1", "e2e-az2"] - } - } - } - - preferred_during_scheduling_ignored_during_execution { - weight = 1 - - preference { - match_expressions { - key = "another-node-label-key" - operator = "In" - values = ["another-node-label-value"] - } - } - } - } - } - - container { - name = "with-node-affinity" - image = "k8s.gcr.io/pause:2.0" - } - } -} -``` - -terraform version of the [pods/pod-with-pod-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-pod-affinity.yaml) example. - -```hcl -resource "kubernetes_pod" "with_pod_affinity" { - metadata { - name = "with-pod-affinity" - } - - spec { - affinity { - pod_affinity { - required_during_scheduling_ignored_during_execution { - label_selector { - match_expressions { - key = "security" - operator = "In" - values = ["S1"] - } - } - - topology_key = "failure-domain.beta.kubernetes.io/zone" - } - } - - pod_anti_affinity { - preferred_during_scheduling_ignored_during_execution { - weight = 100 - - pod_affinity_term { - label_selector { - match_expressions { - key = "security" - operator = "In" - values = ["S2"] - } - } - - topology_key = "failure-domain.beta.kubernetes.io/zone" - } - } - } - } - - container { - name = "with-pod-affinity" - image = "k8s.gcr.io/pause:2.0" - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard pod's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec of the pod owned by the cluster -* `target_state` - (Optional) A list of the pod phases that indicate whether it was successfully created. Options: "Pending", "Running", "Succeeded", "Failed", "Unknown". Default: "Running". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase") - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the pod, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the pod must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `affinity` - (Optional) A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - (Optional) 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. -* `automount_service_account_token` - (Optional) Indicates whether a service account token should be automatically mounted. Defaults to `true` for Pods. -* `container` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `init_container` - (Optional) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - (Optional) Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - (Optional) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `enable_service_links` - (Optional) Enables generating environment variables for service discovery. Optional: Defaults to true. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service). -* `host_aliases` - (Optional) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_aliases` block definition below. -* `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - (Optional) 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. -* `host_pid` - (Optional) Use the host's pid namespace. -* `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - (Optional) 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. -* `node_selector` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `os` - (Optional) Specifies the OS of the containers in the pod. -* `priority_class_name` - (Optional) 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 formerer 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. -* `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `scheduler_name` - (Optional) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/. -* `share_process_namespace` - (Optional) 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. -* `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - (Optional) 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 delete immediately. 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. -* `toleration` - (Optional) Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `topology_spread_constraint` - (Optional) Describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) -* `readiness_gate` - (Optional) 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://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate) - -### `affinity` - -#### Arguments - -* `node_affinity` - (Optional) Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - -### `node_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -## `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `preference` - (Required) A node selector term, associated with the corresponding weight. - -* `weight` - (Required) Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - -### `preference` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -## `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `pod_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `pod_anti_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` (pod_affinity_term) - -#### Arguments - -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. -* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace" -* `topology_key` - (Optional) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `pod_affinity_term` - (Required) A pod affinity term, associated with the corresponding weight. -* `weight` - (Required) Weight associated with matching the corresponding `pod_affinity_term`, in the range 1-100. - -### `os` - -#### Arguments - -* `name` - (Required) Name is the name of the operating system. The currently supported values are `linux` and `windows`. - -### `container` - -#### Arguments - -* `args` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - (Optional) Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - (Optional) 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. -* `image` - (Optional) Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - (Optional) Block(s) of [port](#port)s to expose on 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. May be used multiple times. Cannot be updated. -* `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - (Optional) Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - (Optional) Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `startup_probe` - (Optional) 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. For more info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.17** -* `stdin` - (Optional) 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. -* `stdin_once` - (Optional) 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. -* `termination_message_path` - (Optional) 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. Defaults to /dev/termination-log. Cannot be updated. -* `termination_message_policy` - (Optional): 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. -* `tty` - (Optional) Whether this container should allocate a TTY for itself -* `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - (Optional) 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. - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `capabilities` - -#### Arguments - -* `add` - (Optional) Added capabilities -* `drop` - (Optional) Removed capabilities - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is /. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `config_map` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `optional` - (Optional) Specify whether the ConfigMap or its keys must be defined. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `csi` - -#### Arguments - -* `driver` - (Required) the name of the volume driver to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi). -* `volume_attributes` - (Optional) Attributes of the volume to publish. -* `fs_type` - (Optional) Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. `ext4`, `xfs`, `ntfs`. -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to `true`. If omitted, the default is `false`. -* `node_publish_secret_ref` - (Optional) A reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. see [secret_ref](#secret_ref) for more details. - -### `dns_config` - -#### Arguments - -* `nameservers` - (Optional) A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - (Optional) A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - (Optional) A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - (Required) Name of the option. -* `value` - (Optional) Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Arguments - -* `medium` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `env_from` - -#### Arguments - -* `config_map_ref` - (Optional) The ConfigMap to select from -* `prefix` - (Optional) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - (Optional) The Secret to select from - -### `exec` - -#### Arguments - -* `command` - (Optional) 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. 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. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `git_repo` - -#### Arguments - -* `directory` - (Optional) 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. -* `repository` - (Optional) Repository URL -* `revision` - (Optional) Commit hash for the specified revision. - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `grpc` - -#### Arguments - -* `port` - (Required) Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - (Optional) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `host_aliases` - -#### Arguments - -* `hostnames` - (Required) Array of hostnames for the IP address. -* `ip` - (Required) IP address of the host file entry. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `http_get` - -#### Arguments - -* `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. -* `http_header` - (Optional) Scheme to use for connecting to the host. -* `path` - (Optional) Path to access on the HTTP server. -* `port` - (Optional) 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. -* `scheme` - (Optional) Scheme to use for connecting to the host. - -### `http_header` - -#### Arguments - -* `name` - (Optional) The header field name -* `value` - (Optional) The header field value - -### `image_pull_secrets` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `items` - -#### Arguments - -* `key` - (Optional) The key to project. -* `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. -* `path` - (Optional) 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 '..'. - -### `lifecycle` - -#### Arguments - -* `post_start` - (Optional) post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `liveness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Arguments - -* `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `port` - -#### Arguments - -* `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - (Optional) What host IP to bind the external port to. -* `host_port` - (Optional) 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. -* `name` - (Optional) 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 -* `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. - -### `readiness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Arguments - -* `level` - (Optional) Level is SELinux level label that applies to the container. -* `role` - (Optional) Role is a SELinux role label that applies to the container. -* `type` - (Optional) Type is a SELinux type label that applies to the container. -* `user` - (Optional) User is a SELinux user label that applies to the container. - -### `secret` - -#### Arguments - -* `default_mode` - (Optional) Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - (Optional) Specify whether the Secret or its keys must be defined. -* `secret_name` - (Optional) Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - (Required) The key to project. -* `mode` - (Optional) Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - (Required) 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 '..'. - -### `secret_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) 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 -* `capabilities` - (Optional) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - (Optional) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - (Optional) Whether this container has a read-only root filesystem. Default is false. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `sysctl` - (Optional) holds a list of namespaced sysctls used for the pod. see [Sysctl](#sysctl) block. See [official docs](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) for more details. -* `fs_group_change_policy` - 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. Note that this field cannot be set when spec.os.name is windows. - -##### Sysctl - -* `name` - (Required) Name of a property to set. -* `value` - (Required) Value of a property to set. - -### `capabilities` - -#### Arguments - -* `add` - (Optional) A list of added capabilities. -* `drop` - (Optional) A list of removed capabilities. - -### pod `security_context` - -#### Arguments - -* `fs_group` - (Optional) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `supplemental_groups` - (Optional) 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. - -### `tcp_socket` - -#### Arguments - -* `port` - (Required) 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. - -### `toleration` - -#### Arguments - -* `effect` - (Optional) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. -* `key` - (Optional) 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. -* `operator` - (Optional) 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. -* `toleration_seconds` - (Optional) 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. -* `value` - (Optional) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - -### `topology_spread_constraint` - -#### Arguments - -* `match_label_keys` - (Optional) Is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both `match_label_keys` and `label_selector`. `match_label_keys` cannot be set when `label_selector` isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against `label_selector`. -* `max_skew` - (Optional) Describes the degree to which pods may be unevenly distributed. Default value is `1`. -* `min_domains` - (Optional) Indicates a minimum number of eligible domains. Must be number greater than `0`. When set, `when_unsatisfiable` must be set to `DoNotSchedule`. -* `node_affinity_policy` - (Optional) Indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Valid values are `Honor` and `Ignore`. When unset, behavior defaults to `Honor`. -* `node_taints_policy` - (Optional) Indicates how we will treat node taints when calculating pod topology spread skew. Valid values are `Honor` and `Ignore`. When unset, behavior defaults to `Ignore`. -* `topology_key` - (Optional) The key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. -* `when_unsatisfiable` - (Optional) Indicates how to deal with a pod if it doesn't satisfy the spread constraint. Valid values are `DoNotSchedule` and `ScheduleAnyway`. Default value is `DoNotSchedule`. -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `projected` - -#### Arguments - -* `default_mode` - (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. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. -* `sources` - (Required) List of volume projection sources - -### `sources` - -#### Arguments - -* `config_map` - (Optional) Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. -* `downward_api` - (Optional) Represents downward API info for projecting into a projected volume. Note that this is identical to a downward_api volume source without the default mode. -* `secret` - (Optional) Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. -* `service_account_token` - (Optional) Represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). - -### `service_account_token` - -#### Arguments - -* `audience` - (Optional) 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. -* `expiration_seconds` - (Optional) 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. -* `path` - (Required) Path is the path relative to the mount point of the file to project the token into. - -### `volume` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume -* `csi` - (Optional) CSI represents storage that is handled by an external CSI driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#csi) -* `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume -* `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `ephemeral` - (Optional) Represents an ephemeral volume that is handled by a normal storage driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes) -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `persistent_volume_claim` - (Optional) The specification of a persistent volume. -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `projected` (Optional) Items for all in one resources secrets, configmaps, and downward API. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `secret` - (Optional) Secret represents a secret that should populate this volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - -### `volume_mount` - -#### Arguments - -* `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - (Required) This must match the Name of a Volume. -* `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - (Optional) Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -### `ephemeral` - -#### Arguments - -* `volume_claim_template` - (Required) 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. - -### `volume_claim_template` - -#### Arguments - -* `metadata` - (Optional) 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. -* `spec` - (Required) Please see the [persistent_volume_claim_v1 resource](persistent_volume_claim_v1.html#spec) for reference. - -### `readiness_gate` - -#### Arguments - -* `condition_type` - (Required) refers to a condition in the pod's condition list with matching type. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_pod` resource: - -* `create` - (Default `5 minutes`) Used for Creating Pods. -* `delete` - (Default `5 minutes`) Used for Destroying Pods. - -## Import - -Pod can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_pod.example default/terraform-example -``` diff --git a/website/docs/r/pod_disruption_budget.html.markdown b/website/docs/r/pod_disruption_budget.html.markdown deleted file mode 100644 index 3dd05d9377..0000000000 --- a/website/docs/r/pod_disruption_budget.html.markdown +++ /dev/null @@ -1,70 +0,0 @@ ---- -subcategory: "policy/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod_disruption_budget" -description: |- - A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. ---- - -# kubernetes_pod_disruption_budget - - A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. - - For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. - -## Example Usage - -```hcl -resource "kubernetes_pod_disruption_budget" "demo" { - metadata { - name = "demo" - } - spec { - max_unavailable = "20%" - selector { - match_labels = { - test = "MyExampleApp" - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource's metadata. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `spec` - (Required) Spec defines the behavior of a Pod Disruption Budget. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `max_unavailable` - (Optional) Specifies the number of pods from the selected set that can be unavailable after the eviction. It can be either an absolute number or a percentage. You can specify only one of max_unavailable and min_available in a single Pod Disruption Budget. max_unavailable can only be used to control the eviction of pods that have an associated controller managing them. -* `min_available` - (Optional) Specifies the number of pods from the selected set that must still be available after the eviction, even in the absence of the evicted pod. min_available can be either an absolute number or a percentage. You can specify only one of min_available and max_unavailable in a single Pod Disruption Budget. min_available can only be used to control the eviction of pods that have an associated controller managing them. -* `selector` - (Optional) A label query over controllers (Deployment, ReplicationController, ReplicaSet, or StatefulSet) that the Pod Disruption Budget should be applied to. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors diff --git a/website/docs/r/pod_disruption_budget_v1.html.markdown b/website/docs/r/pod_disruption_budget_v1.html.markdown deleted file mode 100644 index 835e49c2f0..0000000000 --- a/website/docs/r/pod_disruption_budget_v1.html.markdown +++ /dev/null @@ -1,70 +0,0 @@ ---- -subcategory: "policy/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod_disruption_budget_v1" -description: |- - A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. ---- - -# kubernetes_pod_disruption_budget_v1 - - A Pod Disruption Budget limits the number of pods of a replicated application that are down simultaneously from voluntary disruptions. - - For example, a quorum-based application would like to ensure that the number of replicas running is never brought below the number needed for a quorum. A web front end might want to ensure that the number of replicas serving load never falls below a certain percentage of the total. - -## Example Usage - -```hcl -resource "kubernetes_pod_disruption_budget_v1" "demo" { - metadata { - name = "demo" - } - spec { - max_unavailable = "20%" - selector { - match_labels = { - test = "MyExampleApp" - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource's metadata. For more info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -* `spec` - (Required) Spec defines the behavior of a Pod Disruption Budget. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#idempotency -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#concurrency-control-and-consistency -* `uid` - The unique in time and space value for this service. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - -### `spec` - -#### Arguments - -* `max_unavailable` - (Optional) Specifies the number of pods from the selected set that can be unavailable after the eviction. It can be either an absolute number or a percentage. You can specify only one of max_unavailable and min_available in a single Pod Disruption Budget. max_unavailable can only be used to control the eviction of pods that have an associated controller managing them. -* `min_available` - (Optional) Specifies the number of pods from the selected set that must still be available after the eviction, even in the absence of the evicted pod. min_available can be either an absolute number or a percentage. You can specify only one of min_available and max_unavailable in a single Pod Disruption Budget. min_available can only be used to control the eviction of pods that have an associated controller managing them. -* `selector` - (Optional) A label query over controllers (Deployment, ReplicationController, ReplicaSet, or StatefulSet) that the Pod Disruption Budget should be applied to. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors diff --git a/website/docs/r/pod_security_policy.html.markdown b/website/docs/r/pod_security_policy.html.markdown deleted file mode 100644 index 813a323175..0000000000 --- a/website/docs/r/pod_security_policy.html.markdown +++ /dev/null @@ -1,184 +0,0 @@ ---- -subcategory: "policy/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod_security_policy" -description: |- - A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. ---- - -# kubernetes_pod_security_policy - -A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields. - -~> NOTE: With the release of Kubernetes v1.25, PodSecurityPolicy has been removed. You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes). - -## Example Usage - -```hcl -resource "kubernetes_pod_security_policy" "example" { - metadata { - name = "terraform-example" - } - spec { - privileged = false - allow_privilege_escalation = false - - volumes = [ - "configMap", - "emptyDir", - "projected", - "secret", - "downwardAPI", - "persistentVolumeClaim", - ] - - run_as_user { - rule = "MustRunAsNonRoot" - } - - se_linux { - rule = "RunAsAny" - } - - supplemental_groups { - rule = "MustRunAs" - range { - min = 1 - max = 65535 - } - } - - fs_group { - rule = "MustRunAs" - range { - min = 1 - max = 65535 - } - } - - read_only_root_filesystem = true - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Pod Security Policy's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#metadata) -* `spec` - (Required) Spec contains information for locating and communicating with a server. [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the Pod Security Policy that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the Pod Security Policy. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the Pod Security Policy, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this Pod Security Policy that can be used by clients to determine when Pod Security Policy has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this Pod Security Policy. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) determines if a pod can request to allow privilege escalation. If unspecified, defaults to true. -* `allowed_capabilities` - (Optional) a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities. -* [`allowed_flex_volumes`](#allowed_flex_volumes) - (Optional) a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field. -* [`allowed_host_paths`](#allowed_host_paths) - (Optional) a white list of allowed host paths. Empty indicates that all host paths may be used. -* `allowed_proc_mount_types` - (Optional) a whitelist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled. Possible values are `"Default"` or `"Unmasked"` -* `allowed_unsafe_sysctls` - (Optional) a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of allowed sysctls. Single* means all unsafe sysctls are allowed. Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection. Examples: "foo/*" allows "foo/bar", "foo/baz", etc. and "foo.*" allows "foo.bar", "foo.baz", etc. -* `default_add_capabilities` - (Optional) the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list. -* `default_allow_privilege_escalation` - (Optional) controls the default setting for whether a process can gain more privileges than its parent process. -* `forbidden_sysctls` - (Optional) forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of forbidden sysctls. Single* means all sysctls are forbidden. -* [`fs_group`](#fs_group) - (Required) the strategy that will dictate what fs group is used by the SecurityContext. -* `host_ipc` - (Optional) determines if the policy allows the use of HostIPC in the pod spec. -* `host_network` - (Optional) determines if the policy allows the use of HostNetwork in the pod spec. -* `host_pid` - (Optional) determines if the policy allows the use of HostPID in the pod spec. -* `host_ports` - (Optional) determines which host port ranges are allowed to be exposed. -* `privileged` - (Optional) determines if a pod can request to be run as privileged. -* `read_only_root_filesystem` - (Optional) when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to. -* `required_drop_capabilities` - (Optional) the capabilities that will be dropped from the container. These are required to be dropped and cannot be added. -* [`run_as_user`](#run_as_user) - (Required) the strategy that will dictate the allowable RunAsUser values that may be set. -* [`run_as_group`](#run_as_group) - (Optional) the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod's RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled. -* [`se_linux`](#se_linux) - (Required) the strategy that will dictate the allowable labels that may be set. -* [`supplemental_groups`](#supplemental_groups) - (Required) the strategy that will dictate what supplemental groups are used by the SecurityContext. -* `volumes` - (Optional) a white list of allowed volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'. - -### allowed_flex_volumes - -### Arguments - -* `driver` - (Required) the name of the Flexvolume driver. - -### allowed_host_paths - -### Arguments - -* `path_prefix` - (Required) the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path. Examples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar`. `/foo` would not allow `/food` or `/etc/foo` -* `read_only` - (Optional) when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. - -### `fs_group` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate what FSGroup is used in the SecurityContext. -* `range` - (Optional) the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs. - -### `run_as_user` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate the allowable RunAsUser values that may be set. -* `range` - (Optional) the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs. - -### `run_as_group` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate the allowable RunAsGroup values that may be set. -* `range` - (Optional) the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs. - -### `se_linux` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate the allowable labels that may be set. -* `se_linux_options` - (Optional) required to run as; required for MustRunAs. For more info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - -### `supplemental_groups` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate what supplemental groups is used in the SecurityContext. -* `range` - (Optional) the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs. - - -### `range` - -#### Arguments - -* `min` - (Required) the start of the range, inclusive. -* `max` - (Required) the end of the range, inclusive. - -## Import - -Pod Security Policy can be imported using its name, e.g. - -``` -$ terraform import kubernetes_pod_security_policy.example terraform-example -``` diff --git a/website/docs/r/pod_security_policy_v1beta1.html.markdown b/website/docs/r/pod_security_policy_v1beta1.html.markdown deleted file mode 100644 index aa3eb65190..0000000000 --- a/website/docs/r/pod_security_policy_v1beta1.html.markdown +++ /dev/null @@ -1,184 +0,0 @@ ---- -subcategory: "policy/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod_security_policy_v1beta1" -description: |- - A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. ---- - -# kubernetes_pod_security_policy_v1beta1 - -A Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields. - -~> NOTE: With the release of Kubernetes v1.25, PodSecurityPolicy has been removed. You can read more information about the removal of PodSecurityPolicy in the [Kubernetes 1.25 release notes](https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes). - -## Example Usage - -```hcl -resource "kubernetes_pod_security_policy_v1beta1" "example" { - metadata { - name = "terraform-example" - } - spec { - privileged = false - allow_privilege_escalation = false - - volumes = [ - "configMap", - "emptyDir", - "projected", - "secret", - "downwardAPI", - "persistentVolumeClaim", - ] - - run_as_user { - rule = "MustRunAsNonRoot" - } - - se_linux { - rule = "RunAsAny" - } - - supplemental_groups { - rule = "MustRunAs" - range { - min = 1 - max = 65535 - } - } - - fs_group { - rule = "MustRunAs" - range { - min = 1 - max = 65535 - } - } - - read_only_root_filesystem = true - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Pod Security Policy's metadata. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `spec` - (Required) Spec contains information for locating and communicating with a server. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the Pod Security Policy that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the Pod Security Policy. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the Pod Security Policy, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this Pod Security Policy that can be used by clients to determine when Pod Security Policy has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/e59e666e3464c7d4851136baa8835a311efdfb8e/contributors/devel/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this Pod Security Policy. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) determines if a pod can request to allow privilege escalation. If unspecified, defaults to true. -* `allowed_capabilities` - (Optional) a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both allowedCapabilities and requiredDropCapabilities. -* [`allowed_flex_volumes`](#allowed_flex_volumes) - (Optional) a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the "volumes" field. -* [`allowed_host_paths`](#allowed_host_paths) - (Optional) a white list of allowed host paths. Empty indicates that all host paths may be used. -* `allowed_proc_mount_types` - (Optional) a whitelist of allowed ProcMountTypes. Empty or nil indicates that only the DefaultProcMountType may be used. This requires the ProcMountType feature flag to be enabled. Possible values are `"Default"` or `"Unmasked"` -* `allowed_unsafe_sysctls` - (Optional) a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of allowed sysctls. Single* means all unsafe sysctls are allowed. Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection. Examples: "foo/*" allows "foo/bar", "foo/baz", etc. and "foo.*" allows "foo.bar", "foo.baz", etc. -* `default_add_capabilities` - (Optional) the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the allowedCapabilities list. -* `default_allow_privilege_escalation` - (Optional) controls the default setting for whether a process can gain more privileges than its parent process. -* `forbidden_sysctls` - (Optional) forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in "*" in which case it is considered as a prefix of forbidden sysctls. Single* means all sysctls are forbidden. -* [`fs_group`](#fs_group) - (Required) the strategy that will dictate what fs group is used by the SecurityContext. -* `host_ipc` - (Optional) determines if the policy allows the use of HostIPC in the pod spec. -* `host_network` - (Optional) determines if the policy allows the use of HostNetwork in the pod spec. -* `host_pid` - (Optional) determines if the policy allows the use of HostPID in the pod spec. -* `host_ports` - (Optional) determines which host port ranges are allowed to be exposed. -* `privileged` - (Optional) determines if a pod can request to be run as privileged. -* `read_only_root_filesystem` - (Optional) when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to. -* `required_drop_capabilities` - (Optional) the capabilities that will be dropped from the container. These are required to be dropped and cannot be added. -* [`run_as_user`](#run_as_user) - (Required) the strategy that will dictate the allowable RunAsUser values that may be set. -* [`run_as_group`](#run_as_group) - (Optional) the strategy that will dictate the allowable RunAsGroup values that may be set. If this field is omitted, the pod's RunAsGroup can take any value. This field requires the RunAsGroup feature gate to be enabled. -* [`se_linux`](#se_linux) - (Required) the strategy that will dictate the allowable labels that may be set. -* [`supplemental_groups`](#supplemental_groups) - (Required) the strategy that will dictate what supplemental groups are used by the SecurityContext. -* `volumes` - (Optional) a white list of allowed volume plugins. Empty indicates that no volumes may be used. To allow all volumes you may use '*'. - -### allowed_flex_volumes - -### Arguments - -* `driver` - (Required) the name of the Flexvolume driver. - -### allowed_host_paths - -### Arguments - -* `path_prefix` - (Required) the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path. Examples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar`. `/foo` would not allow `/food` or `/etc/foo` -* `read_only` - (Optional) when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. - -### `fs_group` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate what FSGroup is used in the SecurityContext. -* `range` - (Optional) the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end. Required for MustRunAs. - -### `run_as_user` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate the allowable RunAsUser values that may be set. -* `range` - (Optional) the allowed ranges of uids that may be used. If you would like to force a single uid then supply a single range with the same start and end. Required for MustRunAs. - -### `run_as_group` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate the allowable RunAsGroup values that may be set. -* `range` - (Optional) the allowed ranges of gids that may be used. If you would like to force a single gid then supply a single range with the same start and end. Required for MustRunAs. - -### `se_linux` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate the allowable labels that may be set. -* `se_linux_options` - (Optional) required to run as; required for MustRunAs. For more info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - -### `supplemental_groups` - -#### Arguments - -* `rule` - (Required) the strategy that will dictate what supplemental groups is used in the SecurityContext. -* `range` - (Optional) the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end. Required for MustRunAs. - - -### `range` - -#### Arguments - -* `min` - (Required) the start of the range, inclusive. -* `max` - (Required) the end of the range, inclusive. - -## Import - -Pod Security Policy can be imported using its name, e.g. - -``` -$ terraform import kubernetes_pod_security_policy_v1beta1.example terraform-example -``` diff --git a/website/docs/r/pod_v1.html.markdown b/website/docs/r/pod_v1.html.markdown deleted file mode 100644 index c45044e4c4..0000000000 --- a/website/docs/r/pod_v1.html.markdown +++ /dev/null @@ -1,977 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_pod_v1" -description: |- - A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. ---- - -# kubernetes_pod_v1 - -A pod is a group of one or more containers, the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod/) - -## Example Usage - -```hcl -resource "kubernetes_pod_v1" "test" { - metadata { - name = "terraform-example" - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - env { - name = "environment" - value = "test" - } - - port { - container_port = 80 - } - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - } - - dns_config { - nameservers = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] - searches = ["example.com"] - - option { - name = "ndots" - value = 1 - } - - option { - name = "use-vc" - } - } - - dns_policy = "None" - } -} -``` - -terraform version of the [pods/pod-with-node-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml) example. - -```hcl -resource "kubernetes_pod_v1" "with_node_affinity" { - metadata { - name = "with-node-affinity" - } - - spec { - affinity { - node_affinity { - required_during_scheduling_ignored_during_execution { - node_selector_term { - match_expressions { - key = "kubernetes.io/e2e-az-name" - operator = "In" - values = ["e2e-az1", "e2e-az2"] - } - } - } - - preferred_during_scheduling_ignored_during_execution { - weight = 1 - - preference { - match_expressions { - key = "another-node-label-key" - operator = "In" - values = ["another-node-label-value"] - } - } - } - } - } - - container { - name = "with-node-affinity" - image = "k8s.gcr.io/pause:2.0" - } - } -} -``` - -terraform version of the [pods/pod-with-pod-affinity.yaml](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-pod-affinity.yaml) example. - -```hcl -resource "kubernetes_pod_v1" "with_pod_affinity" { - metadata { - name = "with-pod-affinity" - } - - spec { - affinity { - pod_affinity { - required_during_scheduling_ignored_during_execution { - label_selector { - match_expressions { - key = "security" - operator = "In" - values = ["S1"] - } - } - - topology_key = "failure-domain.beta.kubernetes.io/zone" - } - } - - pod_anti_affinity { - preferred_during_scheduling_ignored_during_execution { - weight = 100 - - pod_affinity_term { - label_selector { - match_expressions { - key = "security" - operator = "In" - values = ["S2"] - } - } - - topology_key = "failure-domain.beta.kubernetes.io/zone" - } - } - } - } - - container { - name = "with-pod-affinity" - image = "k8s.gcr.io/pause:2.0" - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard pod's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec of the pod owned by the cluster -* `target_state` - (Optional) A list of the pod phases that indicate whether it was successfully created. Options: "Pending", "Running", "Succeeded", "Failed", "Unknown". Default: "Running". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase") - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the pod that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the pod. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the pod, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the pod must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this pod that can be used by clients to determine when pod has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `affinity` - (Optional) A group of affinity scheduling rules. If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `active_deadline_seconds` - (Optional) 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. -* `automount_service_account_token` - (Optional) Indicates whether a service account token should be automatically mounted. Defaults to `true` for Pods. -* `container` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/) -* `init_container` - (Optional) List of init containers belonging to the pod. Init containers always run to completion and each must complete successfully before the next is started. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) -* `dns_policy` - (Optional) Set DNS policy for containers within the pod. 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'. Optional: Defaults to 'ClusterFirst', see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy). -* `dns_config` - (Optional) Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Defaults to empty. See `dns_config` block definition below. -* `enable_service_links` - (Optional) Enables generating environment variables for service discovery. Optional: Defaults to true. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service). -* `host_aliases` - (Optional) List of hosts and IPs that will be injected into the pod's hosts file if specified. Optional: Defaults to empty. See `host_aliases` block definition below. -* `host_ipc` - (Optional) Use the host's ipc namespace. Optional: Defaults to false. -* `host_network` - (Optional) 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. -* `host_pid` - (Optional) Use the host's pid namespace. -* `hostname` - (Optional) Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. -* `image_pull_secrets` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `node_name` - (Optional) 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. -* `node_selector` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/). -* `os` - (Optional) Specifies the OS of the containers in the pod. -* `priority_class_name` - (Optional) 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. -* `restart_policy` - (Optional) Restart policy for all containers within the pod. One of Always, OnFailure, Never. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy). -* `runtime_class_name` - (Optional) RuntimeClassName is a feature for selecting the container runtime configuration. The container runtime configuration is used to run a Pod's containers. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class) -* `security_context` - (Optional) SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty -* `scheduler_name` - (Optional) If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -* `service_account_name` - (Optional) ServiceAccountName is the name of the ServiceAccount to use to run this pod. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/. -* `share_process_namespace` - (Optional) 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. -* `subdomain` - (Optional) If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all.. -* `termination_grace_period_seconds` - (Optional) 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 delete immediately. 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. -* `toleration` - (Optional) Optional pod node tolerations. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) -* `topology_spread_constraint` - (Optional) Describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/) -* `volume` - (Optional) List of volumes that can be mounted by containers belonging to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes) -* `readiness_gate` - (Optional) 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://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-readiness-gate) - -### `affinity` - -#### Arguments - -* `node_affinity` - (Optional) Node affinity scheduling rules for the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature) -* `pod_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) -* `pod_anti_affinity` - (Optional) Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.) For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature) - -### `node_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` - -#### Arguments - -* `node_selector_term` - (Required) A list of node selector terms. The terms are ORed. - -## `node_selector_term` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -### `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `preference` - (Required) A node selector term, associated with the corresponding weight. - -* `weight` - (Required) Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - -### `preference` - -#### Arguments - -* `match_expressions` - (Optional) A list of node selector requirements by node's labels. - -* `match_fields` - (Optional) A list of node selector requirements by node's fields. - -## `match_expressions` / `match_fields` - -#### Arguments - -* `key` - (Required) The label key that the selector applies to. - -* `operator` - (Required) Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - -* `values` - (Optional) 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. - -### `pod_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `pod_anti_affinity` - -#### Arguments - -* `required_during_scheduling_ignored_during_execution` - (Optional) 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. - -* `preferred_during_scheduling_ignored_during_execution` - (Optional) 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. - -### `required_during_scheduling_ignored_during_execution` (pod_affinity_term) - -#### Arguments - -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. -* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace" -* `topology_key` - (Optional) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed. - -### `preferred_during_scheduling_ignored_during_execution` - -#### Arguments - -* `pod_affinity_term` - (Required) A pod affinity term, associated with the corresponding weight. -* `weight` - (Required) Weight associated with matching the corresponding `pod_affinity_term`, in the range 1-100. - -### `os` - -#### Arguments - -* `name` - (Required) Name is the name of the operating system. The currently supported values are `linux` and `windows`. - -### `container` - -#### Arguments - -* `args` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `command` - (Optional) 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell) -* `env` - (Optional) Block of string name and value pairs to set in the container's environment. May be declared multiple times. Cannot be updated. -* `env_from` - (Optional) 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. -* `image` - (Optional) Docker image name. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/) -* `image_pull_policy` - (Optional) Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#updating-images) -* `lifecycle` - (Optional) Actions that the management system should take in response to container lifecycle events -* `liveness_probe` - (Optional) Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `name` - (Required) Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. -* `port` - (Optional) Block(s) of [port](#port)s to expose on 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. May be used multiple times. Cannot be updated. -* `readiness_probe` - (Optional) Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `resources` - (Optional) Compute Resources required by this container. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources) -* `security_context` - (Optional) Security options the pod should run with. For more info see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. -* `startup_probe` - (Optional) 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. For more info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.17** -* `stdin` - (Optional) 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. -* `stdin_once` - (Optional) 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. -* `termination_message_path` - (Optional) 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. Defaults to /dev/termination-log. Cannot be updated. -* `termination_message_policy` - (Optional): 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. -* `tty` - (Optional) Whether this container should allocate a TTY for itself -* `volume_mount` - (Optional) Pod volumes to mount into the container's filesystem. Cannot be updated. -* `working_dir` - (Optional) 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. - -### `aws_elastic_block_store` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `partition` - (Optional) 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). -* `read_only` - (Optional) Whether to set the read-only property in VolumeMounts to "true". If omitted, the default is "false". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `volume_id` - (Required) Unique ID of the persistent disk resource in AWS (Amazon EBS volume). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) - -### `azure_disk` - -#### Arguments - -* `caching_mode` - (Required) Host Caching mode: None, Read Only, Read Write. -* `data_disk_uri` - (Required) The URI the data disk in the blob storage -* `disk_name` - (Required) The Name of the data disk in the blob storage -* `fs_type` - (Optional) 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. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). - -### `azure_file` - -#### Arguments - -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `secret_name` - (Required) The name of secret that contains Azure Storage Account Name and Key -* `share_name` - (Required) Share Name - -### `capabilities` - -#### Arguments - -* `add` - (Optional) Added capabilities -* `drop` - (Optional) Removed capabilities - -### `ceph_fs` - -#### Arguments - -* `monitors` - (Required) Monitors is a collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `path` - (Optional) Used as the mounted root, rather than the full Ceph tree, default is /. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to `false` (read/write). For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_file` - (Optional) The path to key ring for User, default is /etc/ceph/user.secret. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `secret_ref` - (Optional) Reference to the authentication secret for User, default is empty. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. -* `user` - (Optional) User is the rados user name, default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/cephfs/#how-to-use-it. - -### `cinder` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `volume_id` - (Required) Volume ID used to identify the volume in Cinder. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. - -### `config_map` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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 '..'. -* `optional` - (Optional) Specify whether the ConfigMap or its keys must be defined. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `config_map_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the ConfigMap must be defined - -### `config_map_key_ref` - -#### Arguments - -* `key` - (Optional) The key to select. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `dns_config` - -#### Arguments - -* `nameservers` - (Optional) A list of DNS name server IP addresses specified as strings. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. Optional: Defaults to empty. -* `option` - (Optional) A list of DNS resolver options specified as blocks with `name`/`value` pairs. 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. Optional: Defaults to empty. -* `searches` - (Optional) A list of DNS search domains for host-name lookup specified as strings. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. Optional: Defaults to empty. - -The `option` block supports the following: - -* `name` - (Required) Name of the option. -* `value` - (Optional) Value of the option. Optional: Defaults to empty. - -### `downward_api` - -#### Arguments - -* `default_mode` - (Optional) Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) 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. Paths must be relative and may not contain the '..' path or start with '..'. - -### `empty_dir` - -#### Arguments - -* `medium` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `size_limit` - (Optional) Total amount of local storage required for this EmptyDir volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes) and [Kubernetes Quantity type](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource?tab=doc#Quantity). - -### `env` - -#### Arguments - -* `name` - (Required) Name of the environment variable. Must be a C_IDENTIFIER -* `value` - (Optional) Variable references $(VAR_NAME) are expanded using the previous 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. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". -* `value_from` - (Optional) Source for the environment variable's value - -### `env_from` - -#### Arguments - -* `config_map_ref` - (Optional) The ConfigMap to select from -* `prefix` - (Optional) An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.. -* `secret_ref` - (Optional) The Secret to select from - -### `exec` - -#### Arguments - -* `command` - (Optional) 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. 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. - -### `fc` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `lun` - (Required) FC target lun number -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false (read/write). -* `target_ww_ns` - (Required) FC target worldwide names (WWNs) - -### `field_ref` - -#### Arguments - -* `api_version` - (Optional) Version of the schema the FieldPath is written in terms of, defaults to "v1". -* `field_path` - (Optional) Path of the field to select in the specified API version - -### `flex_volume` - -#### Arguments - -* `driver` - (Required) Driver is the name of the driver to use for this volume. -* `fs_type` - (Optional) 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. -* `options` - (Optional) Extra command options if any. -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false (read/write). -* `secret_ref` - (Optional) 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. - -### `flocker` - -#### Arguments - -* `dataset_name` - (Optional) Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated -* `dataset_uuid` - (Optional) UUID of the dataset. This is unique identifier of a Flocker dataset - -### `gce_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `partition` - (Optional) 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). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `pd_name` - (Required) Unique name of the PD resource in GCE. Used to identify the disk in GCE. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `read_only` - (Optional) Whether to force the ReadOnly setting in VolumeMounts. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) - -### `git_repo` - -#### Arguments - -* `directory` - (Optional) 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. -* `repository` - (Optional) Repository URL -* `revision` - (Optional) Commit hash for the specified revision. - -### `glusterfs` - -#### Arguments - -* `endpoints_name` - (Required) The endpoint name that details Glusterfs topology. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `path` - (Required) The Glusterfs volume path. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. -* `read_only` - (Optional) Whether to force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#create-a-pod. - -### `grpc` - -#### Arguments - -* `port` - (Required) Number of the port to access on the container. Number must be in the range 1 to 65535. -* `service` - (Optional) Name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If this is not specified, the default behavior is defined by gRPC. - -### `host_aliases` - -#### Arguments - -* `hostnames` - (Required) Array of hostnames for the IP address. -* `ip` - (Required) IP address of the host file entry. - -### `host_path` - -#### Arguments - -* `path` - (Optional) Path of the directory on the host. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `type` - (Optional) Type for HostPath volume. Defaults to "". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) - -### `http_get` - -#### Arguments - -* `host` - (Optional) Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. -* `http_header` - (Optional) Scheme to use for connecting to the host. -* `path` - (Optional) Path to access on the HTTP server. -* `port` - (Optional) 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. -* `scheme` - (Optional) Scheme to use for connecting to the host. - -### `http_header` - -#### Arguments - -* `name` - (Optional) The header field name -* `value` - (Optional) The header field value - -### `image_pull_secrets` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `iscsi` - -#### Arguments - -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#iscsi) -* `iqn` - (Required) Target iSCSI Qualified Name. -* `iscsi_interface` - (Optional) iSCSI interface name that uses an iSCSI transport. Defaults to 'default' (tcp). -* `lun` - (Optional) iSCSI target lun number. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. -* `target_portal` - (Required) 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). - -### `items` - -#### Arguments - -* `key` - (Optional) The key to project. -* `mode` - (Optional) Optional: mode bits to use on this file, must be a value between 0 and 0777. 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. -* `path` - (Optional) 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 '..'. - -### `lifecycle` - -#### Arguments - -* `post_start` - (Optional) post_start 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) -* `pre_stop` - (Optional) pre_stop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks) - -### `liveness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before liveness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `nfs` - -#### Arguments - -* `path` - (Required) Path that is exported by the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `read_only` - (Optional) Whether to force the NFS export to be mounted with read-only permissions. Defaults to false. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `server` - (Required) Server is the hostname or IP address of the NFS server. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) - -### `persistent_volume_claim` - -#### Arguments - -* `claim_name` - (Optional) ClaimName is the name of a PersistentVolumeClaim in the same -* `read_only` - (Optional) Will force the ReadOnly setting in VolumeMounts. - -### `photon_persistent_disk` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `pd_id` - (Required) ID that identifies Photon Controller persistent disk - -### `port` - -#### Arguments - -* `container_port` - (Required) Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. -* `host_ip` - (Optional) What host IP to bind the external port to. -* `host_port` - (Optional) 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. -* `name` - (Optional) 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 -* `protocol` - (Optional) Protocol for port. Must be UDP or TCP. Defaults to "TCP". - -### `post_start` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `pre_stop` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `http_get` - (Optional) Specifies the http request to perform. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - -### `quobyte` - -#### Arguments - -* `group` - (Optional) Group to map volume access to Default is no group -* `read_only` - (Optional) Whether to force the Quobyte volume to be mounted with read-only permissions. Defaults to false. -* `registry` - (Required) 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 -* `user` - (Optional) User to map volume access to Defaults to serivceaccount user -* `volume` - (Required) Volume is a string that references an already created Quobyte volume by name. - -### `rbd` - -#### Arguments - -* `ceph_monitors` - (Required) A collection of Ceph monitors. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `fs_type` - (Optional) 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. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#rbd) -* `keyring` - (Optional) Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `rados_user` - (Optional) The rados user name. Default is admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `rbd_image` - (Required) The rados image name. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `rbd_pool` - (Optional) The rados pool name. Default is rbd. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `read_only` - (Optional) Whether to force the read-only setting in VolumeMounts. Defaults to false. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. -* `secret_ref` - (Optional) Name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. For more info see https://github.com/kubernetes/examples/tree/master/volumes/rbd/#how-to-use-it. - -### `readiness_probe` - -#### Arguments - -* `exec` - (Optional) exec specifies the action to take. -* `failure_threshold` - (Optional) Minimum consecutive failures for the probe to be considered failed after having succeeded. -* `grpc` - (Optional) GRPC specifies an action involving a GRPC port. **NOTE: This field is behind a [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) prior to v1.24** -* `http_get` - (Optional) Specifies the http request to perform. -* `initial_delay_seconds` - (Optional) Number of seconds after the container has started before readiness probes are initiated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) -* `period_seconds` - (Optional) How often (in seconds) to perform the probe -* `success_threshold` - (Optional) Minimum consecutive successes for the probe to be considered successful after having failed. -* `tcp_socket` - (Optional) TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported -* `timeout_seconds` - (Optional) Number of seconds after which the probe times out. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) - -### `resources` - -#### Arguments - -* `limits` - (Optional) Describes the maximum amount of compute resources allowed. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) -* `requests` - (Optional) Describes the minimum amount of compute resources required. - -`resources` is a computed attribute and thus if it is not configured in terraform code, the value will be computed from the returned Kubernetes object. That causes a situation when removing `resources` from terraform code does not update the Kubernetes object. In order to delete `resources` from the Kubernetes object, configure an empty attribute in your code. - -Please, look at the example below: - -```hcl -resources { - limits = {} - requests = {} -} -``` - -### `resource_field_ref` - -#### Arguments - -* `container_name` - (Optional) The name of the container -* `resource` - (Required) Resource to select -* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1". - -### `seccomp_profile` - -#### Attributes - -* `type` - Indicates which kind of seccomp profile will be applied. Valid options are: - * `Localhost` - a profile defined in a file on the node should be used. - * `RuntimeDefault` - the container runtime default profile should be used. - * `Unconfined` - (Default) no profile should be applied. -* `localhost_profile` - 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`. - -### `se_linux_options` - -#### Arguments - -* `level` - (Optional) Level is SELinux level label that applies to the container. -* `role` - (Optional) Role is a SELinux role label that applies to the container. -* `type` - (Optional) Type is a SELinux type label that applies to the container. -* `user` - (Optional) User is a SELinux user label that applies to the container. - -### `secret` - -#### Arguments - -* `default_mode` - (Optional) Mode bits to use on created files by default. Must be a value between 0 and 0777. 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. -* `items` - (Optional) List of Secret Items to project into the volume. See `items` block definition below. 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 '..'. -* `optional` - (Optional) Specify whether the Secret or its keys must be defined. -* `secret_name` - (Optional) Name of the secret in the pod's namespace to use. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) - -The `items` block supports the following: - -* `key` - (Required) The key to project. -* `mode` - (Optional) Mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. -* `path` - (Required) 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 '..'. - -### `secret_ref` - -#### Arguments - -* `name` - (Required) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret must be defined - -### `secret_key_ref` - -#### Arguments - -* `key` - (Optional) The key of the secret to select from. Must be a valid secret key. -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `optional` - (Optional) Specify whether the Secret or its key must be defined - -### `secret_ref` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### container `security_context` - -#### Arguments - -* `allow_privilege_escalation` - (Optional) 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 -* `capabilities` - (Optional) The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. -* `privileged` - (Optional) Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. -* `read_only_root_filesystem` - (Optional) Whether this container has a read-only root filesystem. Default is false. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `sysctl` - (Optional) holds a list of namespaced sysctls used for the pod. see [Sysctl](#sysctl) block. See [official docs](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - -##### Sysctl - -* `name` - (Required) Name of a property to set. -* `value` - (Required) Value of a property to set. - -### `capabilities` - -#### Arguments - -* `add` - (Optional) A list of added capabilities. -* `drop` - (Optional) A list of removed capabilities. - -### pod `security_context` - -#### Arguments - -* `fs_group` - (Optional) 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: 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---- If unset, the Kubelet will not modify the ownership and permissions of any volume. -* `run_as_group` - (Optional) 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. -* `run_as_non_root` - (Optional) 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. -* `run_as_user` - (Optional) 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. -* `seccomp_profile` - The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. -* `se_linux_options` - (Optional) 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. -* `supplemental_groups` - (Optional) 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. - -### `tcp_socket` - -#### Arguments - -* `port` - (Required) 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. - -### `toleration` - -#### Arguments - -* `effect` - (Optional) Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. -* `key` - (Optional) 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. -* `operator` - (Optional) 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. -* `toleration_seconds` - (Optional) 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. -* `value` - (Optional) Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - -### `topology_spread_constraint` - -#### Arguments - -* `match_label_keys` - (Optional) Is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both `match_label_keys` and `label_selector`. `match_label_keys` cannot be set when `label_selector` isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against `label_selector`. -* `max_skew` - (Optional) Describes the degree to which pods may be unevenly distributed. Default value is `1`. -* `min_domains` - (Optional) Indicates a minimum number of eligible domains. Must be number greater than `0`. When set, `when_unsatisfiable` must be set to `DoNotSchedule`. -* `node_affinity_policy` - (Optional) Indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Valid values are `Honor` and `Ignore`. When unset, behavior defaults to `Honor`. -* `node_taints_policy` - (Optional) Indicates how we will treat node taints when calculating pod topology spread skew. Valid values are `Honor` and `Ignore`. When unset, behavior defaults to `Ignore`. -* `topology_key` - (Optional) The key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. -* `when_unsatisfiable` - (Optional) Indicates how to deal with a pod if it doesn't satisfy the spread constraint. Valid values are `DoNotSchedule` and `ScheduleAnyway`. Default value is `DoNotSchedule`. -* `label_selector` - (Optional) A label query over a set of resources, in this case pods. - -### `value_from` - -#### Arguments - -* `config_map_key_ref` - (Optional) Selects a key of a ConfigMap. -* `field_ref` - (Optional) Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.podIP. -* `resource_field_ref` - (Optional) 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. -* `secret_key_ref` - (Optional) Selects a key of a secret in the pod's namespace. - -### `projected` - -#### Arguments - -* `default_mode` - (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. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. -* `sources` - (Required) List of volume projection sources - -### `sources` - -#### Arguments - -* `config_map` - (Optional) Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. -* `downward_api` - (Optional) Represents downward API info for projecting into a projected volume. Note that this is identical to a downward_api volume source without the default mode. -* `secret` - (Optional) Adapts a secret into a projected volume. The contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. -* `service_account_token` - (Optional) Represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). - -### `service_account_token` - -#### Arguments - -* `audience` - (Optional) 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. -* `expiration_seconds` - (Optional) 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. -* `path` - (Required) Path is the path relative to the mount point of the file to project the token into. - -### `volume` - -#### Arguments - -* `aws_elastic_block_store` - (Optional) Represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore) -* `azure_disk` - (Optional) Represents an Azure Data Disk mount on the host and bind mount to the pod. -* `azure_file` - (Optional) Represents an Azure File Service mount on the host and bind mount to the pod. -* `ceph_fs` - (Optional) Represents a Ceph FS mount on the host that shares a pod's lifetime -* `cinder` - (Optional) Represents a cinder volume attached and mounted on kubelets host machine. For more info see https://github.com/kubernetes/examples/blob/master/mysql-cinder-pd/README.md#mysql-installation-with-cinder-volume-plugin. -* `config_map` - (Optional) ConfigMap represents a configMap that should populate this volume -* `downward_api` - (Optional) DownwardAPI represents downward API about the pod that should populate this volume -* `empty_dir` - (Optional) EmptyDir represents a temporary directory that shares a pod's lifetime. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#emptydir) -* `ephemeral` - (Optional) Represents an ephemeral volume that is handled by a normal storage driver. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes) -* `fc` - (Optional) Represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. -* `flex_volume` - (Optional) Represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. -* `flocker` - (Optional) Represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running -* `gce_persistent_disk` - (Optional) Represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk) -* `git_repo` - (Optional) GitRepo represents a git repository at a particular revision. -* `glusterfs` - (Optional) Represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. For more info see https://github.com/kubernetes/examples/tree/master/volumes/glusterfs#glusterfs. -* `host_path` - (Optional) Represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#hostpath) -* `iscsi` - (Optional) Represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. -* `name` - (Optional) Volume's name. Must be a DNS_LABEL and unique within the pod. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `nfs` - (Optional) Represents an NFS mount on the host. Provisioned by an admin. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#nfs) -* `persistent_volume_claim` - (Optional) The specification of a persistent volume. -* `photon_persistent_disk` - (Optional) Represents a PhotonController persistent disk attached and mounted on kubelets host machine -* `projected` (Optional) Items for all in one resources secrets, configmaps, and downward API. -* `quobyte` - (Optional) Quobyte represents a Quobyte mount on the host that shares a pod's lifetime -* `rbd` - (Optional) Represents a Rados Block Device mount on the host that shares a pod's lifetime. For more info see https://kubernetes.io/docs/concepts/storage/volumes/#rbd. -* `secret` - (Optional) Secret represents a secret that should populate this volume. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes#secrets) -* `vsphere_volume` - (Optional) Represents a vSphere volume attached and mounted on kubelets host machine - -### `volume_mount` - -#### Arguments - -* `mount_path` - (Required) Path within the container at which the volume should be mounted. Must not contain ':'. -* `name` - (Required) This must match the Name of a Volume. -* `read_only` - (Optional) Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. -* `sub_path` - (Optional) Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). -* `mount_propagation` - (Optional) Mount propagation mode. Defaults to "None". For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation) - -### `vsphere_volume` - -#### Arguments - -* `fs_type` - (Optional) 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. -* `volume_path` - (Required) Path that identifies vSphere volume vmdk - -### `ephemeral` - -#### Arguments - -* `volume_claim_template` - (Required) 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. - -### `volume_claim_template` - -#### Arguments - -* `metadata` - (Optional) 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. -* `spec` - (Required) Please see the [persistent_volume_claim_v1 resource](persistent_volume_claim_v1.html#spec) for reference. - -### `readiness_gate` - -#### Arguments - -* `condition_type` - (Required) refers to a condition in the pod's condition list with matching type. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_pod_v1` resource: - -* `create` - (Default `5 minutes`) Used for Creating Pods. -* `delete` - (Default `5 minutes`) Used for Destroying Pods. - -## Import - -Pod can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_pod_v1.example default/terraform-example -``` diff --git a/website/docs/r/priority_class.html.markdown b/website/docs/r/priority_class.html.markdown deleted file mode 100644 index 4549fcbe9e..0000000000 --- a/website/docs/r/priority_class.html.markdown +++ /dev/null @@ -1,64 +0,0 @@ ---- -subcategory: "scheduling/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_priority_class" -description: |- - A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. ---- - -# kubernetes_priority_class - -A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. - -## Example Usage - -```hcl -resource "kubernetes_priority_class" "example" { - metadata { - name = "terraform-example" - } - - value = 100 -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource quota's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `value` - (Required, Forces new resource) The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec. -* `description` - (Optional) An arbitrary string that usually provides guidelines on when this priority class should be used. -* `global_default` - (Optional) Boolean that specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. -* `preemption_policy` - (Optional) PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the resource quota, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this resource quota. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -Priority Class can be imported using its name, e.g. - -``` -$ terraform import kubernetes_priority_class.example terraform-example -``` diff --git a/website/docs/r/priority_class_v1.html.markdown b/website/docs/r/priority_class_v1.html.markdown deleted file mode 100644 index 0172238977..0000000000 --- a/website/docs/r/priority_class_v1.html.markdown +++ /dev/null @@ -1,65 +0,0 @@ ---- -subcategory: "scheduling/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_priority_class_v1" -description: |- - A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. ---- - -# kubernetes_priority_class_v1 - -A PriorityClass is a non-namespaced object that defines a mapping from a priority class name to the integer value of the priority. - -## Example Usage - -```hcl -resource "kubernetes_priority_class_v1" "example" { - metadata { - name = "terraform-example" - } - - value = 100 -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource quota's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `value` - (Required, Forces new resource) The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec. -* `description` - (Optional) An arbitrary string that usually provides guidelines on when this priority class should be used. -* `global_default` - (Optional) Boolean that specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. -* `preemption_policy` - (Optional) PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the resource quota, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this resource quota. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) -* `preemption_policy` - PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. - -## Import - -Priority Class can be imported using its name, e.g. - -``` -$ terraform import kubernetes_priority_class_v1.example terraform-example -``` - diff --git a/website/docs/r/replication_controller.html.markdown b/website/docs/r/replication_controller.html.markdown deleted file mode 100644 index d545c6e64c..0000000000 --- a/website/docs/r/replication_controller.html.markdown +++ /dev/null @@ -1,167 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_replication_controller" -description: |- - A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. ---- - -# kubernetes_replication_controller - -A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. - -~> **WARNING:** In many cases it is recommended to create a Deployment instead of a Replication Controller. - -## Example Usage - -```hcl -resource "kubernetes_replication_controller" "example" { - metadata { - name = "terraform-example" - labels = { - test = "MyExampleApp" - } - } - - spec { - selector = { - test = "MyExampleApp" - } - template { - metadata { - labels = { - test = "MyExampleApp" - } - annotations = { - "key1" = "value1" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - - resources { - limits = { - cpu = "0.5" - memory = "512Mi" - } - requests = { - cpu = "250m" - memory = "50Mi" - } - } - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard replication controller's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the replication controller. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the replication controller that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the replication controller. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the replication controller, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the replication controller must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this replication controller that can be used by clients to determine when replication controller has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this replication controller. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `min_ready_seconds` - (Optional) 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) -* `replicas` - (Optional) The number of desired replicas. Defaults to 1. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller) -* `selector` - (Required) A label query over pods that should match the Replicas count. Label keys and values that must match in order to be controlled by this replication controller. **Should match labels (`metadata.0.labels`)**. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#label-selector-and-annotation-conventions) -* `template` - (Required) Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template) - -## Nested Blocks - -### `spec.template` - -#### Arguments - -* `metadata` - (Optional) Standard object's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). While required by the kubernetes API, this field is marked as optional to allow the usage of the deprecated pod spec fields that were mistakenly placed directly under the `template` block. - -* `spec` - (Optional) Specification of the desired behavior of the pod. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -~> **NOTE:** all the fields from the `spec.template.spec` block are also accepted at the `spec.template` level but that usage is deprecated. All existing configurations should be updated to only use the new fields under `spec.template.spec`. Mixing the usage of deprecated fields with new fields is not supported. - -## Nested Blocks - -### `spec.template.metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the replication controller that may be used to store arbitrary metadata. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the pods managed by this replication controller . **Should match `selector`**. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#label-selector-and-annotation-conventions) -* `name` - (Optional) Name of the replication controller, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the replication controller must be unique. - -## Nested Blocks - -### `spec.template.spec` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available: - -- `create` - (Default `10 minutes`) Used for creating new controller -- `update` - (Default `10 minutes`) Used for updating a controller -- `delete` - (Default `10 minutes`) Used for destroying a controller - -## Import - -Replication Controller can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_replication_controller.example default/terraform-example -``` - -~> **NOTE:** Imported `kubernetes_replication_controller` resource will only have their fields from the `spec.template.spec` block in the state. Deprecated fields at the `spec.template` level are not updated during import. Configurations using the deprecated fields should be updated to only use the new fields under `spec.template.spec`. diff --git a/website/docs/r/replication_controller_v1.html.markdown b/website/docs/r/replication_controller_v1.html.markdown deleted file mode 100644 index ab7a89d978..0000000000 --- a/website/docs/r/replication_controller_v1.html.markdown +++ /dev/null @@ -1,167 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_replication_controller_v1" -description: |- - A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. ---- - -# kubernetes_replication_controller_v1 - -A Replication Controller ensures that a specified number of pod “replicas” are running at any one time. In other words, a Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more. - -~> **WARNING:** In many cases it is recommended to create a Deployment instead of a Replication Controller. - -## Example Usage - -```hcl -resource "kubernetes_replication_controller_v1" "example" { - metadata { - name = "terraform-example" - labels = { - test = "MyExampleApp" - } - } - - spec { - selector = { - test = "MyExampleApp" - } - template { - metadata { - labels = { - test = "MyExampleApp" - } - annotations = { - "key1" = "value1" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - - liveness_probe { - http_get { - path = "/" - port = 80 - - http_header { - name = "X-Custom-Header" - value = "Awesome" - } - } - - initial_delay_seconds = 3 - period_seconds = 3 - } - - resources { - limits = { - cpu = "0.5" - memory = "512Mi" - } - requests = { - cpu = "250m" - memory = "50Mi" - } - } - } - } - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard replication controller's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the replication controller. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the replication controller that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the replication controller. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the replication controller, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the replication controller must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this replication controller that can be used by clients to determine when replication controller has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this replication controller. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `min_ready_seconds` - (Optional) 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) -* `replicas` - (Optional) The number of desired replicas. Defaults to 1. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller) -* `selector` - (Required) A label query over pods that should match the Replicas count. Label keys and values that must match in order to be controlled by this replication controller. **Should match labels (`metadata.0.labels`)**. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#label-selector-and-annotation-conventions) -* `template` - (Required) Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template) - -## Nested Blocks - -### `spec.template` - -#### Arguments - -* `metadata` - (Optional) Standard object's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). While required by the kubernetes API, this field is marked as optional to allow the usage of the deprecated pod spec fields that were mistakenly placed directly under the `template` block. - -* `spec` - (Optional) Specification of the desired behavior of the pod. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -~> **NOTE:** all the fields from the `spec.template.spec` block are also accepted at the `spec.template` level but that usage is deprecated. All existing configurations should be updated to only use the new fields under `spec.template.spec`. Mixing the usage of deprecated fields with new fields is not supported. - -## Nested Blocks - -### `spec.template.metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the replication controller that may be used to store arbitrary metadata. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the pods managed by this replication controller . **Should match `selector`**. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#label-selector-and-annotation-conventions) -* `name` - (Optional) Name of the replication controller, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the replication controller must be unique. - -## Nested Blocks - -### `spec.template.spec` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod.html#spec) for reference. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available: - -- `create` - (Default `10 minutes`) Used for creating new controller -- `update` - (Default `10 minutes`) Used for updating a controller -- `delete` - (Default `10 minutes`) Used for destroying a controller - -## Import - -Replication Controller can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_replication_controller_v1.example default/terraform-example -``` - -~> **NOTE:** Imported `kubernetes_replication_controller_v1` resource will only have their fields from the `spec.template.spec` block in the state. Deprecated fields at the `spec.template` level are not updated during import. Configurations using the deprecated fields should be updated to only use the new fields under `spec.template.spec`. diff --git a/website/docs/r/resource_quota.html.markdown b/website/docs/r/resource_quota.html.markdown deleted file mode 100644 index 1fa6a6809c..0000000000 --- a/website/docs/r/resource_quota.html.markdown +++ /dev/null @@ -1,89 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_resource_quota" -description: |- - A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. ---- - -# kubernetes_resource_quota - -A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. - - -## Example Usage - -```hcl -resource "kubernetes_resource_quota" "example" { - metadata { - name = "terraform-example" - } - spec { - hard = { - pods = 10 - } - scopes = ["BestEffort"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource quota's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Optional) Spec defines the desired quota. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the resource quota, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the resource quota must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this resource quota. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `hard` - (Optional) The set of desired hard limits for each named resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/policy/resource-quotas) -* `scopes` - (Optional) A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. -* `scope_selector` - (Optional) A collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. See `scope_selector` below for more details. - -#### `scope_selector` - -##### Arguments - -* `match_expression` - (Optional) A list of scope selector requirements by scope of the resources. See `match_expression` below for more details. - -##### `match_expression` - -###### Arguments - -* `scope_name` - (Required) The name of the scope that the selector applies to. Valid values are `Terminating`, `NotTerminating`, `BestEffort`, `NotBestEffort`, and `PriorityClass`. -* `operator` - (Required) Represents a scope's relationship to a set of values. Valid operators are `In`, `NotIn`, `Exists`, `DoesNotExist`. -* `values` - (Optional) A list of scope selector requirements by scope of the resources. - -## Import - -Resource Quota can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_resource_quota.example default/terraform-example -``` diff --git a/website/docs/r/resource_quota_v1.html.markdown b/website/docs/r/resource_quota_v1.html.markdown deleted file mode 100644 index f2898f4ea4..0000000000 --- a/website/docs/r/resource_quota_v1.html.markdown +++ /dev/null @@ -1,89 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_resource_quota_v1" -description: |- - A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. ---- - -# kubernetes_resource_quota_v1 - -A resource quota provides constraints that limit aggregate resource consumption per namespace. It can limit the quantity of objects that can be created in a namespace by type, as well as the total amount of compute resources that may be consumed by resources in that project. - - -## Example Usage - -```hcl -resource "kubernetes_resource_quota_v1" "example" { - metadata { - name = "terraform-example" - } - spec { - hard = { - pods = 10 - } - scopes = ["BestEffort"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard resource quota's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Optional) Spec defines the desired quota. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the resource quota that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the resource quota. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the resource quota, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the resource quota must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this resource quota that can be used by clients to determine when resource quota has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this resource quota. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `hard` - (Optional) The set of desired hard limits for each named resource. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/policy/resource-quotas) -* `scopes` - (Optional) A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects. -* `scope_selector` - (Optional) A collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. See `scope_selector` below for more details. - -#### `scope_selector` - -##### Arguments - -* `match_expression` - (Optional) A list of scope selector requirements by scope of the resources. See `match_expression` below for more details. - -##### `match_expression` - -###### Arguments - -* `scope_name` - (Required) The name of the scope that the selector applies to. Valid values are `Terminating`, `NotTerminating`, `BestEffort`, `NotBestEffort`, and `PriorityClass`. -* `operator` - (Required) Represents a scope's relationship to a set of values. Valid operators are `In`, `NotIn`, `Exists`, `DoesNotExist`. -* `values` - (Optional) A list of scope selector requirements by scope of the resources. - -## Import - -Resource Quota can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_resource_quota_v1.example default/terraform-example -``` diff --git a/website/docs/r/role.html.markdown b/website/docs/r/role.html.markdown deleted file mode 100644 index 2b445912e8..0000000000 --- a/website/docs/r/role.html.markdown +++ /dev/null @@ -1,85 +0,0 @@ ---- -layout: "kubernetes" -subcategory: "rbac/v1" -page_title: "Kubernetes: kubernetes_role" -description: |- - A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). ---- - -# kubernetes_role - -A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). - - -## Example Usage - -```hcl -resource "kubernetes_role" "example" { - metadata { - name = "terraform-example" - labels = { - test = "MyRole" - } - } - - rule { - api_groups = [""] - resources = ["pods"] - resource_names = ["foo"] - verbs = ["get", "list", "watch"] - } - rule { - api_groups = ["apps"] - resources = ["deployments"] - verbs = ["get", "list"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard role's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `rule` - (Required) List of rules that define the set of permissions for this role. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the role that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](hhttps://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the role. **Must match `selector`**. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the role, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the role must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this role that can be used by clients to determine when role has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this role. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `rule` - -#### Arguments - -* `api_groups` - (Required) List of APIGroups that contains the resources. -* `resources` - (Required) List of resources that the rule applies to. -* `resource_names` - (Optional) White list of names that the rule applies to. -* `verbs` - (Required) List of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. - -## Import - -Role can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_role.example default/terraform-example -``` diff --git a/website/docs/r/role_binding.html.markdown b/website/docs/r/role_binding.html.markdown deleted file mode 100644 index d68efbfe7e..0000000000 --- a/website/docs/r/role_binding.html.markdown +++ /dev/null @@ -1,100 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_role_binding" -description: |- - A RoleBinding may be used to grant permission at the namespace level. ---- - -# kubernetes_role_binding - -A RoleBinding may be used to grant permission at the namespace level - -## Example Usage - -```hcl -resource "kubernetes_role_binding" "example" { - metadata { - name = "terraform-example" - namespace = "default" - } - role_ref { - api_group = "rbac.authorization.k8s.io" - kind = "Role" - name = "admin" - } - subject { - kind = "User" - name = "admin" - api_group = "rbac.authorization.k8s.io" - } - subject { - kind = "ServiceAccount" - name = "default" - namespace = "kube-system" - } - subject { - kind = "Group" - name = "system:masters" - api_group = "rbac.authorization.k8s.io" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard kubernetes metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `role_ref` - (Required) The Role to bind Subjects to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding) -* `subject` - (Required) The Users, Groups, or ServiceAccounts to grand permissions to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-subjects) - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the role binding that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the role binding. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the role binding, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the role binding must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this object that can be used by clients to determine when the object has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this role binding. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `role_ref` - -#### Arguments - -* `name` - (Required) The name of this Role to bind Subjects to. -* `kind` - (Required) The type of binding to use. This value must be present and defaults to `Role` -* `api_group` - (Required) The API group to drive authorization decisions. This value must be and defaults to `rbac.authorization.k8s.io` - -### `subject` - -#### Arguments - -* `name` - (Required) The name of this Role to bind Subjects to. -* `namespace` - (Optional) Namespace defines the namespace of the ServiceAccount to bind to. This value only applies to kind `ServiceAccount` -* `kind` - (Required) The type of binding to use. This value must be `ServiceAccount`, `User` or `Group` -* `api_group` - (Required) The API group to drive authorization decisions. This value only applies to kind `User` and `Group`. It must be `rbac.authorization.k8s.io` - -## Import - -RoleBinding can be imported using the name, e.g. - -``` -$ terraform import kubernetes_role_binding.example default/terraform-name -``` diff --git a/website/docs/r/role_binding_v1.html.markdown b/website/docs/r/role_binding_v1.html.markdown deleted file mode 100644 index b93727f18f..0000000000 --- a/website/docs/r/role_binding_v1.html.markdown +++ /dev/null @@ -1,100 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_role_binding_v1" -description: |- - A RoleBinding may be used to grant permission at the namespace level. ---- - -# kubernetes_role_binding_v1 - -A RoleBinding may be used to grant permission at the namespace level - -## Example Usage - -```hcl -resource "kubernetes_role_binding_v1" "example" { - metadata { - name = "terraform-example" - namespace = "default" - } - role_ref { - api_group = "rbac.authorization.k8s.io" - kind = "Role" - name = "admin" - } - subject { - kind = "User" - name = "admin" - api_group = "rbac.authorization.k8s.io" - } - subject { - kind = "ServiceAccount" - name = "default" - namespace = "kube-system" - } - subject { - kind = "Group" - name = "system:masters" - api_group = "rbac.authorization.k8s.io" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard kubernetes metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `role_ref` - (Required) The Role to bind Subjects to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding) -* `subject` - (Required) The Users, Groups, or ServiceAccounts to grand permissions to. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-subjects) - - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the role binding that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the role binding. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the role binding, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the role binding must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this object that can be used by clients to determine when the object has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this role binding. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `role_ref` - -#### Arguments - -* `name` - (Required) The name of this Role to bind Subjects to. -* `kind` - (Required) The type of binding to use. This value must be present and defaults to `Role` -* `api_group` - (Required) The API group to drive authorization decisions. This value must be and defaults to `rbac.authorization.k8s.io` - -### `subject` - -#### Arguments - -* `name` - (Required) The name of this Role to bind Subjects to. -* `namespace` - (Optional) Namespace defines the namespace of the ServiceAccount to bind to. This value only applies to kind `ServiceAccount` -* `kind` - (Required) The type of binding to use. This value must be `ServiceAccount`, `User` or `Group` -* `api_group` - (Required) The API group to drive authorization decisions. This value only applies to kind `User` and `Group`. It must be `rbac.authorization.k8s.io` - -## Import - -RoleBinding can be imported using the name, e.g. - -``` -$ terraform import kubernetes_role_binding_v1.example default/terraform-name -``` diff --git a/website/docs/r/role_v1.html.markdown b/website/docs/r/role_v1.html.markdown deleted file mode 100644 index 5258563f7e..0000000000 --- a/website/docs/r/role_v1.html.markdown +++ /dev/null @@ -1,85 +0,0 @@ ---- -subcategory: "rbac/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_role_v1" -description: |- - A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). ---- - -# kubernetes_role_v1 - -A role contains rules that represent a set of permissions. Permissions are purely additive (there are no “deny” rules). - - -## Example Usage - -```hcl -resource "kubernetes_role_v1" "example" { - metadata { - name = "terraform-example" - labels = { - test = "MyRole" - } - } - - rule { - api_groups = [""] - resources = ["pods"] - resource_names = ["foo"] - verbs = ["get", "list", "watch"] - } - rule { - api_groups = ["apps"] - resources = ["deployments"] - verbs = ["get", "list"] - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard role's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `rule` - (Required) List of rules that define the set of permissions for this role. For more info see [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the role that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](hhttps://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the role. **Must match `selector`**. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the role, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the role must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this role that can be used by clients to determine when role has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this role. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `rule` - -#### Arguments - -* `api_groups` - (Required) List of APIGroups that contains the resources. -* `resources` - (Required) List of resources that the rule applies to. -* `resource_names` - (Optional) White list of names that the rule applies to. -* `verbs` - (Required) List of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. - -## Import - -Role can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_role_v1.example default/terraform-example -``` diff --git a/website/docs/r/runtime_class_v1.html.markdown b/website/docs/r/runtime_class_v1.html.markdown deleted file mode 100644 index dd34c07e2e..0000000000 --- a/website/docs/r/runtime_class_v1.html.markdown +++ /dev/null @@ -1,64 +0,0 @@ ---- -layout: "kubernetes" -subcategory: "node/v1" -page_title: "Kubernetes: kubernetes_runtime_class_v1" -description: |- - A runtime class is used to determine which container runtime is used to run all containers in a pod. ---- - -# kubernetes_runtime_class_v1 - -A runtime class is used to determine which container runtime is used to run all containers in a pod. - - -## Example usage - -```hcl -resource "kubernetes_runtime_class_v1" "example" { - metadata { - name = "myclass" - } - handler = "abcdeagh" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard role's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `handler` - (Required) Specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class -[Kubernetes reference](https://kubernetes.io/docs/concepts/containers/runtime-class/) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the role that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](hhttps://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the role. **Must match `selector`**. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the role, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this role that can be used by clients to determine when role has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this role. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -Runtime class can be imported using the name only, e.g. - -``` -$ terraform import kubernetes_runtime_class_v1.example myclass -``` - - diff --git a/website/docs/r/secret.html.markdown b/website/docs/r/secret.html.markdown deleted file mode 100644 index f50d02e9bd..0000000000 --- a/website/docs/r/secret.html.markdown +++ /dev/null @@ -1,149 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_secret" -description: |- - The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. ---- - -# kubernetes_secret - -The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. -Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. -The resource will by default create a secret which is available to any pod in the specified (or default) namespace. - -~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) - -~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). - -## Example Usage - -```hcl -resource "kubernetes_secret" "example" { - metadata { - name = "basic-auth" - } - - data = { - username = "admin" - password = "P4ssw0rd" - } - - type = "kubernetes.io/basic-auth" -} -``` - -## Example Usage (Docker config) - -### Docker config file - -```hcl -resource "kubernetes_secret" "example" { - metadata { - name = "docker-cfg" - } - - data = { - ".dockerconfigjson" = "${file("${path.module}/.docker/config.json")}" - } - - type = "kubernetes.io/dockerconfigjson" -} -``` - -### Username and password - -```hcl -resource "kubernetes_secret" "example" { - metadata { - name = "docker-cfg" - } - - type = "kubernetes.io/dockerconfigjson" - - data = { - ".dockerconfigjson" = jsonencode({ - auths = { - "${var.registry_server}" = { - "username" = var.registry_username - "password" = var.registry_password - "email" = var.registry_email - "auth" = base64encode("${var.registry_username}:${var.registry_password}") - } - } - }) - } -} -``` - -This is equivalent to the following kubectl command: - -```sh -$ kubectl create secret docker-registry docker-cfg --docker-server=${registry_server} --docker-username=${registry_username} --docker-password=${registry_password} --docker-email=${registry_email} -``` - -## Example Usage (Service account token) - -```hcl -resource "kubernetes_secret" "example" { - metadata { - annotations = { - "kubernetes.io/service-account.name" = "my-service-account" - } - - generate_name = "my-service-account-" - } - - type = "kubernetes.io/service-account-token" - wait_for_service_account_token = true -} -``` - -## Argument Reference - -The following arguments are supported: - -* `data` - (Optional) A map of the secret data. -* `binary_data` - (Optional) A map base64 encoded map of the secret data. -* `metadata` - (Required) Standard secret's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `type` - (Optional) The secret type. Defaults to `Opaque`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/c7151dd8dd7e487e96e5ce34c6a416bb3b037609/contributors/design-proposals/auth/secrets.md#proposed-design) -* `immutable` - (Optional) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. -* `wait_for_service_account_token` - (Optional) Terraform will wait for the service account token to be created. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the secret that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the secret. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the secret, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the secret must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this secret. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### Timeouts - -`kubernetes_secret` provides the following configuration options: - -- `create` - Default `1 minute` - -## Import - -Secret can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_secret.example default/my-secret -``` diff --git a/website/docs/r/secret_v1.html.markdown b/website/docs/r/secret_v1.html.markdown deleted file mode 100644 index c56e7713c6..0000000000 --- a/website/docs/r/secret_v1.html.markdown +++ /dev/null @@ -1,149 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_secret_v1" -description: |- - The resource provides mechanisms to inject containers with sensitive information while keeping containers agnostic of Kubernetes. ---- - -# kubernetes_secret_v1 - -The resource provides mechanisms to inject containers with sensitive information, such as passwords, while keeping containers agnostic of Kubernetes. -Secrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs. -The resource will by default create a secret which is available to any pod in the specified (or default) namespace. - -~> Read more about security properties and risks involved with using Kubernetes secrets: [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret/#information-security-for-secrets) - -~> **Note:** All arguments including the secret data will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). - -## Example Usage - -```hcl -resource "kubernetes_secret_v1" "example" { - metadata { - name = "basic-auth" - } - - data = { - username = "admin" - password = "P4ssw0rd" - } - - type = "kubernetes.io/basic-auth" -} -``` - -## Example Usage (Docker config) - -### Docker config file - -```hcl -resource "kubernetes_secret_v1" "example" { - metadata { - name = "docker-cfg" - } - - data = { - ".dockerconfigjson" = "${file("${path.module}/.docker/config.json")}" - } - - type = "kubernetes.io/dockerconfigjson" -} -``` - -### Username and password - -```hcl -resource "kubernetes_secret_v1" "example" { - metadata { - name = "docker-cfg" - } - - type = "kubernetes.io/dockerconfigjson" - - data = { - ".dockerconfigjson" = jsonencode({ - auths = { - "${var.registry_server}" = { - "username" = var.registry_username - "password" = var.registry_password - "email" = var.registry_email - "auth" = base64encode("${var.registry_username}:${var.registry_password}") - } - } - }) - } -} -``` - -This is equivalent to the following kubectl command: - -```sh -$ kubectl create secret docker-registry docker-cfg --docker-server=${registry_server} --docker-username=${registry_username} --docker-password=${registry_password} --docker-email=${registry_email} -``` - -## Example Usage (Service account token) - -```hcl -resource "kubernetes_secret_v1" "example" { - metadata { - annotations = { - "kubernetes.io/service-account.name" = "my-service-account" - } - - generate_name = "my-service-account-" - } - - type = "kubernetes.io/service-account-token" - wait_for_service_account_token = true -} -``` - -## Argument Reference - -The following arguments are supported: - -* `data` - (Optional) A map of the secret data. -* `binary_data` - (Optional) A map base64 encoded map of the secret data. -* `metadata` - (Required) Standard secret's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `type` - (Optional) The secret type. Defaults to `Opaque`. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/c7151dd8dd7e487e96e5ce34c6a416bb3b037609/contributors/design-proposals/auth/secrets.md#proposed-design) -* `immutable` - (Optional) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. -* `wait_for_service_account_token` - (Optional) Terraform will wait for the service account token to be created. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the secret that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the secret. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the secret, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the secret must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this secret that can be used by clients to determine when secret has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this secret. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### Timeouts - -`kubernetes_secret_v1` provides the following configuration options: - -- `create` - Default `1 minute` - -## Import - -Secret can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_secret_v1.example default/my-secret -``` diff --git a/website/docs/r/service.html.markdown b/website/docs/r/service.html.markdown deleted file mode 100644 index fedc81734f..0000000000 --- a/website/docs/r/service.html.markdown +++ /dev/null @@ -1,232 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service" -description: |- - A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. ---- - -# kubernetes_service - -A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. - - -## Example Usage - -```hcl -resource "kubernetes_service" "example" { - metadata { - name = "terraform-example" - } - spec { - selector = { - app = kubernetes_pod.example.metadata.0.labels.app - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "LoadBalancer" - } -} - -resource "kubernetes_pod" "example" { - metadata { - name = "terraform-example" - labels = { - app = "MyApp" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - } - } -} -``` - -## Example using AWS load balancer - -```hcl -variable "cluster_name" { - type = string -} - -data "aws_eks_cluster" "example" { - name = var.cluster_name -} - -data "aws_eks_cluster_auth" "example" { - name = var.cluster_name -} - -provider "aws" { - region = "us-west-1" -} - -provider "kubernetes" { - host = data.aws_eks_cluster.example.endpoint - cluster_ca_certificate = base64decode(data.aws_eks_cluster.example.certificate_authority[0].data) - exec { - api_version = "client.authentication.k8s.io/v1beta1" - args = ["eks", "get-token", "--cluster-name", var.cluster_name] - command = "aws" - } -} - -resource "kubernetes_service" "example" { - metadata { - name = "example" - } - spec { - port { - port = 8080 - target_port = 80 - } - type = "LoadBalancer" - } -} - -# Create a local variable for the load balancer name. -locals { - lb_name = split("-", split(".", kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname).0).0 -} - -# Read information about the load balancer using the AWS provider. -data "aws_elb" "example" { - name = local.lb_name -} - -output "load_balancer_name" { - value = local.lb_name -} - -output "load_balancer_hostname" { - value = kubernetes_service.example.status.0.load_balancer.0.ingress.0.hostname -} - -output "load_balancer_info" { - value = data.aws_elb.example -} -``` - - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the behavior of a service. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_load_balancer` - (Optional) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the service that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `allocate_load_balancer_node_ports` - (Optional) Defines if `NodePorts` will be automatically allocated for services with type `LoadBalancer`. It may be set to `false` if the cluster load-balancer does not rely on `NodePorts`. If the caller requests specific `NodePorts` (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type `LoadBalancer`. Default is `true`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation) -* `cluster_ip` - (Optional) The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `cluster_ips` - (Optional) List of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise creation of the service will fail. If this field is not specified, it will be initialized from the `clusterIP` field. If this field is specified, clients must ensure that `clusterIPs[0]` and `clusterIP` have the same value. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `external_ips` - (Optional) A list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. -* `external_name` - (Optional) The external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires `type` to be `ExternalName`. -* `external_traffic_policy` - (Optional) Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. For more info see [Kubernetes reference](https://kubernetes.io/docs/tutorials/services/source-ip/) -* `ip_families` - (Optional) A list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the `ip_family_policy` field. If this field is specified manually, the requested family is available in the cluster, and `ip_family_policy` allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) -* `ip_family_policy` - (Optional) Represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to `SingleStack`. Services can be `SingleStack`(a single IP family), `PreferDualStack`(two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or `RequireDualStack`(two IP families on dual-stack configured clusters, otherwise fail). The `ip_families` and `cluster_ip` fields depend on the value of this field. -* `internal_traffic_policy` - (Optional) Specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. `Cluster` routes internal traffic to a Service to all endpoints. `Local` routes traffic to node-local endpoints only, traffic is dropped if no node-local endpoints are ready. The default value is `Cluster`. -* `load_balancer_class` - (Optional) The class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix. This field can only be set when the Service type is `LoadBalancer`. If not set, the default load balancer implementation is used. This field can only be set when creating or updating a Service to type `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class) -* `load_balancer_ip` - (Optional) Only applies to `type = LoadBalancer`. LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying this field when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. -* `load_balancer_source_ranges` - (Optional) If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/). -* `port` - (Optional) The list of ports that are exposed by this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `publish_not_ready_addresses` - (Optional) When set to true, indicates that DNS implementations must publish the `notReadyAddresses` of subsets for the Endpoints associated with the Service. The default value is `false`. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate `SRV` records for its Pods without respect to their readiness for purpose of peer discovery. -* `selector` - (Optional) Route service traffic to pods with label keys and values matching this selector. Only applies to types `ClusterIP`, `NodePort`, and `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/) -* `session_affinity` - (Optional) Used to maintain session affinity. Supports `ClientIP` and `None`. Defaults to `None`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `session_affinity_config` - (Optional) Contains the configurations of session affinity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs) -* `type` - (Optional) Determines how the service is exposed. Defaults to `ClusterIP`. Valid options are `ExternalName`, `ClusterIP`, `NodePort`, and `LoadBalancer`. `ExternalName` maps to the specified `external_name`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) -* `health_check_node_port` - (Optional) Specifies the Healthcheck NodePort for the service. Only effects when type is set to `LoadBalancer` and external_traffic_policy is set to `Local`. - -### `port` - -#### Arguments - -* `app_protocol` - (Optional) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per [RFC-6335](https://datatracker.ietf.org/doc/html/rfc6335) and [IANA standard service names](https://www.iana.org/assignments/service-names)). Non-standard protocols should use prefixed names such as `mycompany.com/my-custom-protocol`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol) -* `name` - (Optional) The name of this port within the service. All ports within the service must have unique names. Optional if only one ServicePort is defined on this service. -* `node_port` - (Optional) The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) -* `port` - (Required) The port that will be exposed by this service. -* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. -* `target_port` - (Optional) Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service) - -### `session_affinity_config` - -#### Arguments - -* `client_ip` - (Optional) Contains the configurations of Client IP based session affinity. - -### `client_ip` - -#### Arguments - -* `timeout_seconds` - (Optional) Specifies the seconds of `ClientIP` type session sticky time. The value must be > 0 and <= 86400(for 1 day) if ServiceAffinity == `ClientIP`. - -## Attributes - -* `status` - Status is a list containing the most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -### `status` -#### Attributes - -* `load_balancer` - a list containing the current status of the load-balancer, if one is present. - -### `load_balancer` -#### Attributes - -* `ingress` - a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -### `ingress` -#### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). - -### Timeouts - -`kubernetes_service` provides the following -[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: - -- `create` - Default `10 minutes` - -## Import - -Service can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_service.example default/terraform-name -``` diff --git a/website/docs/r/service_account.html.markdown b/website/docs/r/service_account.html.markdown deleted file mode 100644 index 7d533f6876..0000000000 --- a/website/docs/r/service_account.html.markdown +++ /dev/null @@ -1,97 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service_account" -description: |- - A service account provides an identity for processes that run in a Pod. ---- - -# kubernetes_service_account - -A service account provides an identity for processes that run in a Pod. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) - -## Example Usage - -```hcl -resource "kubernetes_service_account" "example" { - metadata { - name = "terraform-example" - } -} - -resource "kubernetes_secret" "example" { - metadata { - annotations = { - "kubernetes.io/service-account.name" = kubernetes_service_account.example.metadata.0.name - } - - generate_name = "terraform-example-" - } - - type = "kubernetes.io/service-account-token" - wait_for_service_account_token = true -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service account's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `image_pull_secret` - (Optional) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `secret` - (Optional) A list of secrets allowed to be used by pods running using this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret) -* `automount_service_account_token` - (Optional) Boolean, `true` to enable automatic mounting of the service account token. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the service account, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service account must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `image_pull_secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -## Attributes Reference - -In addition to the arguments listed above, the following computed attributes are exported: - -* `default_secret_name` - (Deprecated) Name of the default secret, containing service account token, created & managed by the service. By default, the provider will try to find the secret containing the service account token that Kubernetes automatically created for the service account. Where there are multiple tokens and the provider cannot determine which was created by Kubernetes, this attribute will be empty. When only one token is associated with the service account, the provider will return this single token secret. - - Starting from version `1.24.0` by default Kubernetes does not automatically generate tokens for service accounts. That leads to the situation when `default_secret_name` cannot be computed and thus will be an empty string. In order to create a service account token, please [use `kubernetes_secret_v1` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret_v1#example-usage-service-account-token) - -## Import - -Service account can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_service_account.example default/terraform-example -``` diff --git a/website/docs/r/service_account_v1.html.markdown b/website/docs/r/service_account_v1.html.markdown deleted file mode 100644 index 729c5b163a..0000000000 --- a/website/docs/r/service_account_v1.html.markdown +++ /dev/null @@ -1,97 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service_account_v1" -description: |- - A service account provides an identity for processes that run in a Pod. ---- - -# kubernetes_service_account_v1 - -A service account provides an identity for processes that run in a Pod. - -Read more at [Kubernetes reference](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) - -## Example Usage - -```hcl -resource "kubernetes_service_account_v1" "example" { - metadata { - name = "terraform-example" - } -} - -resource "kubernetes_secret_v1" "example" { - metadata { - annotations = { - "kubernetes.io/service-account.name" = kubernetes_service_account_v1.example.metadata.0.name - } - - generate_name = "terraform-example-" - } - - type = "kubernetes.io/service-account-token" - wait_for_service_account_token = true -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service account's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `image_pull_secret` - (Optional) A list of references to secrets in the same namespace to use for pulling any images in pods that reference this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) -* `secret` - (Optional) A list of secrets allowed to be used by pods running using this Service Account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/secret) -* `automount_service_account_token` - (Optional) Boolean, `true` to enable automatic mounting of the service account token. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the service account that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service account. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the service account, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service account must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service account that can be used by clients to determine when service account has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service account. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `image_pull_secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `secret` - -#### Arguments - -* `name` - (Optional) Name of the referent. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -## Attributes Reference - -In addition to the arguments listed above, the following computed attributes are exported: - -* `default_secret_name` - (Deprecated) Name of the default secret, containing service account token, created & managed by the service. By default, the provider will try to find the secret containing the service account token that Kubernetes automatically created for the service account. Where there are multiple tokens and the provider cannot determine which was created by Kubernetes, this attribute will be empty. When only one token is associated with the service account, the provider will return this single token secret. - - Starting from version `1.24.0` by default Kubernetes does not automatically generate tokens for service accounts. That leads to the situation when `default_secret_name` cannot be computed and thus will be an empty string. In order to create a service account token, please [use `kubernetes_secret_v1` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret_v1#example-usage-service-account-token) - -## Import - -Service account can be imported using the namespace and name, e.g. - -``` -$ terraform import kubernetes_service_account_v1.example default/terraform-example -``` diff --git a/website/docs/r/service_v1.html.markdown b/website/docs/r/service_v1.html.markdown deleted file mode 100644 index 2bc85ed86b..0000000000 --- a/website/docs/r/service_v1.html.markdown +++ /dev/null @@ -1,232 +0,0 @@ ---- -subcategory: "core/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_service_v1" -description: |- - A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. ---- - -# kubernetes_service_v1 - -A Service is an abstraction which defines a logical set of pods and a policy by which to access them - sometimes called a micro-service. - - -## Example Usage - -```hcl -resource "kubernetes_service_v1" "example" { - metadata { - name = "terraform-example" - } - spec { - selector = { - app = kubernetes_pod.example.metadata.0.labels.app - } - session_affinity = "ClientIP" - port { - port = 8080 - target_port = 80 - } - - type = "LoadBalancer" - } -} - -resource "kubernetes_pod" "example" { - metadata { - name = "terraform-example" - labels = { - app = "MyApp" - } - } - - spec { - container { - image = "nginx:1.21.6" - name = "example" - } - } -} -``` - -## Example using AWS load balancer - -```hcl -variable "cluster_name" { - type = string -} - -data "aws_eks_cluster" "example" { - name = var.cluster_name -} - -data "aws_eks_cluster_auth" "example" { - name = var.cluster_name -} - -provider "aws" { - region = "us-west-1" -} - -provider "kubernetes" { - host = data.aws_eks_cluster.example.endpoint - cluster_ca_certificate = base64decode(data.aws_eks_cluster.example.certificate_authority[0].data) - exec { - api_version = "client.authentication.k8s.io/v1beta1" - args = ["eks", "get-token", "--cluster-name", var.cluster_name] - command = "aws" - } -} - -resource "kubernetes_service_v1" "example" { - metadata { - name = "example" - } - spec { - port { - port = 8080 - target_port = 80 - } - type = "LoadBalancer" - } -} - -# Create a local variable for the load balancer name. -locals { - lb_name = split("-", split(".", kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname).0).0 -} - -# Read information about the load balancer using the AWS provider. -data "aws_elb" "example" { - name = local.lb_name -} - -output "load_balancer_name" { - value = local.lb_name -} - -output "load_balancer_hostname" { - value = kubernetes_service_v1.example.status.0.load_balancer.0.ingress.0.hostname -} - -output "load_balancer_info" { - value = data.aws_elb.example -} -``` - - - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard service's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the behavior of a service. [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_load_balancer` - (Optional) Terraform will wait for the load balancer to have at least 1 endpoint before considering the resource created. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the service that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the service. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the service, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the service must be unique. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this service that can be used by clients to determine when service has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `allocate_load_balancer_node_ports` - (Optional) Defines if `NodePorts` will be automatically allocated for services with type `LoadBalancer`. It may be set to `false` if the cluster load-balancer does not rely on `NodePorts`. If the caller requests specific `NodePorts` (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type `LoadBalancer`. Default is `true`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation) -* `cluster_ip` - (Optional) The IP address of the service. It is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. `None` can be specified for headless services when proxying is not required. Ignored if type is `ExternalName`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `cluster_ips` - (Optional) List of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise creation of the service will fail. If this field is not specified, it will be initialized from the `clusterIP` field. If this field is specified, clients must ensure that `clusterIPs[0]` and `clusterIP` have the same value. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `external_ips` - (Optional) A list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. -* `external_name` - (Optional) The external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires `type` to be `ExternalName`. -* `external_traffic_policy` - (Optional) Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. `Local` preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. `Cluster` obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. For more info see [Kubernetes reference](https://kubernetes.io/docs/tutorials/services/source-ip/) -* `ip_families` - (Optional) A list of IP families (e.g. IPv4, IPv6) assigned to this service. This field is usually assigned automatically based on cluster configuration and the `ip_family_policy` field. If this field is specified manually, the requested family is available in the cluster, and `ip_family_policy` allows it, it will be used; otherwise creation of the service will fail. This field is conditionally mutable: it allows for adding or removing a secondary IP family, but it does not allow changing the primary IP family of the Service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) -* `ip_family_policy` - (Optional) Represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to `SingleStack`. Services can be `SingleStack`(a single IP family), `PreferDualStack`(two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or `RequireDualStack`(two IP families on dual-stack configured clusters, otherwise fail). The `ip_families` and `cluster_ip` fields depend on the value of this field. -* `internal_traffic_policy` - (Optional) Specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. `Cluster` routes internal traffic to a Service to all endpoints. `Local` routes traffic to node-local endpoints only, traffic is dropped if no node-local endpoints are ready. The default value is `Cluster`. -* `load_balancer_class` - (Optional) The class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix. This field can only be set when the Service type is `LoadBalancer`. If not set, the default load balancer implementation is used. This field can only be set when creating or updating a Service to type `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class) -* `load_balancer_ip` - (Optional) Only applies to `type = LoadBalancer`. LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying this field when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. -* `load_balancer_source_ranges` - (Optional) If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. For more info see [Kubernetes reference](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/). -* `port` - (Optional) The list of ports that are exposed by this service. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `publish_not_ready_addresses` - (Optional) When set to true, indicates that DNS implementations must publish the `notReadyAddresses` of subsets for the Endpoints associated with the Service. The default value is `false`. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate `SRV` records for its Pods without respect to their readiness for purpose of peer discovery. -* `selector` - (Optional) Route service traffic to pods with label keys and values matching this selector. Only applies to types `ClusterIP`, `NodePort`, and `LoadBalancer`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/) -* `session_affinity` - (Optional) Used to maintain session affinity. Supports `ClientIP` and `None`. Defaults to `None`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies) -* `session_affinity_config` - (Optional) Contains the configurations of session affinity. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs) -* `type` - (Optional) Determines how the service is exposed. Defaults to `ClusterIP`. Valid options are `ExternalName`, `ClusterIP`, `NodePort`, and `LoadBalancer`. `ExternalName` maps to the specified `external_name`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) -* `health_check_node_port` - (Optional) Specifies the Healthcheck NodePort for the service. Only effects when type is set to `LoadBalancer` and external_traffic_policy is set to `Local`. - -### `port` - -#### Arguments - -* `app_protocol` - (Optional) The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per [RFC-6335](https://datatracker.ietf.org/doc/html/rfc6335) and [IANA standard service names](http://www.iana.org/assignments/service-names)). Non-standard protocols should use prefixed names such as `mycompany.com/my-custom-protocol`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#application-protocol) -* `name` - (Optional) The name of this port within the service. All ports within the service must have unique names. Optional if only one ServicePort is defined on this service. -* `node_port` - (Optional) The port on each node on which this service is exposed when `type` is `NodePort` or `LoadBalancer`. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the `type` of this service requires one. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) -* `port` - (Required) The port that will be exposed by this service. -* `protocol` - (Optional) The IP protocol for this port. Supports `TCP` and `UDP`. Default is `TCP`. -* `target_port` - (Optional) Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. This field is ignored for services with `cluster_ip = "None"`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service) - -### `session_affinity_config` - -#### Arguments - -* `client_ip` - (Optional) Contains the configurations of Client IP based session affinity. - -### `client_ip` - -#### Arguments - -* `timeout_seconds` - (Optional) Specifies the seconds of `ClientIP` type session sticky time. The value must be > 0 and <= 86400(for 1 day) if ServiceAffinity == `ClientIP`. - -## Attributes - -* `status` - Status is a list containing the most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -### `status` -#### Attributes - -* `load_balancer` - a list containing the current status of the load-balancer, if one is present. - -### `load_balancer` -#### Attributes - -* `ingress` - a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. - -### `ingress` -#### Attributes - -* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers). -* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers). - -### Timeouts - -`kubernetes_service_v1` provides the following -[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: - -- `create` - Default `10 minutes` - -## Import - -Service can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_service_v1.example default/terraform-name -``` diff --git a/website/docs/r/stateful_set.html.markdown b/website/docs/r/stateful_set.html.markdown deleted file mode 100644 index 25ca03345f..0000000000 --- a/website/docs/r/stateful_set.html.markdown +++ /dev/null @@ -1,354 +0,0 @@ ---- -subcategory: "apps/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_stateful_set" -description: |- - StatefulSet is a Kubernetes resource used to manage stateful applications. ---- - -# kubernetes_stateful_set - -Manages the deployment and scaling of a set of Pods , and provides guarantees about the -ordering and uniqueness of these Pods. - -Like a Deployment , a StatefulSet manages Pods that are based on an identical container spec. -Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. -These pods are created from the same spec, but are not interchangeable: each has a persistent -identifier that it maintains across any rescheduling. - -A StatefulSet operates under the same pattern as any other Controller. -You define your desired state in a StatefulSet object, and the StatefulSet controller makes any -necessary updates to get there from the current state. - -## Example Usage - -```hcl -resource "kubernetes_stateful_set" "prometheus" { - metadata { - annotations = { - SomeAnnotation = "foobar" - } - - labels = { - k8s-app = "prometheus" - "kubernetes.io/cluster-service" = "true" - "addonmanager.kubernetes.io/mode" = "Reconcile" - version = "v2.2.1" - } - - name = "prometheus" - } - - spec { - pod_management_policy = "Parallel" - replicas = 1 - revision_history_limit = 5 - - selector { - match_labels = { - k8s-app = "prometheus" - } - } - - service_name = "prometheus" - - template { - metadata { - labels = { - k8s-app = "prometheus" - } - - annotations = {} - } - - spec { - service_account_name = "prometheus" - - init_container { - name = "init-chown-data" - image = "busybox:latest" - image_pull_policy = "IfNotPresent" - command = ["chown", "-R", "65534:65534", "/data"] - - volume_mount { - name = "prometheus-data" - mount_path = "/data" - sub_path = "" - } - } - - container { - name = "prometheus-server-configmap-reload" - image = "jimmidyson/configmap-reload:v0.1" - image_pull_policy = "IfNotPresent" - - args = [ - "--volume-dir=/etc/config", - "--webhook-url=http://localhost:9090/-/reload", - ] - - volume_mount { - name = "config-volume" - mount_path = "/etc/config" - read_only = true - } - - resources { - limits = { - cpu = "10m" - memory = "10Mi" - } - - requests = { - cpu = "10m" - memory = "10Mi" - } - } - } - - container { - name = "prometheus-server" - image = "prom/prometheus:v2.2.1" - image_pull_policy = "IfNotPresent" - - args = [ - "--config.file=/etc/config/prometheus.yml", - "--storage.tsdb.path=/data", - "--web.console.libraries=/etc/prometheus/console_libraries", - "--web.console.templates=/etc/prometheus/consoles", - "--web.enable-lifecycle", - ] - - port { - container_port = 9090 - } - - resources { - limits = { - cpu = "200m" - memory = "1000Mi" - } - - requests = { - cpu = "200m" - memory = "1000Mi" - } - } - - volume_mount { - name = "config-volume" - mount_path = "/etc/config" - } - - volume_mount { - name = "prometheus-data" - mount_path = "/data" - sub_path = "" - } - - readiness_probe { - http_get { - path = "/-/ready" - port = 9090 - } - - initial_delay_seconds = 30 - timeout_seconds = 30 - } - - liveness_probe { - http_get { - path = "/-/healthy" - port = 9090 - scheme = "HTTPS" - } - - initial_delay_seconds = 30 - timeout_seconds = 30 - } - } - - termination_grace_period_seconds = 300 - - volume { - name = "config-volume" - - config_map { - name = "prometheus-config" - } - } - } - } - - update_strategy { - type = "RollingUpdate" - - rolling_update { - partition = 1 - } - } - - volume_claim_template { - metadata { - name = "prometheus-data" - } - - spec { - access_modes = ["ReadWriteOnce"] - storage_class_name = "standard" - - resources { - requests = { - storage = "16Gi" - } - } - } - } - - persistent_volume_claim_retention_policy { - when_deleted = "Delete" - when_scaled = "Delete" - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Kubernetes object metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the stateful set. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_rollout` - (Optional) Wait for the StatefulSet to finish rolling out. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the stateful set that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the stateful set. **Must match `selector`**. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the stateful set, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the stateful set must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this stateful set. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `pod_management_policy` - (Optional) 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. *Changing this forces a new resource to be created.* - -* `replicas` - (Optional) 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. This attribute is a string to be able to distinguish between explicit zero and not specified. - -* `revision_history_limit` - (Optional) 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. *Changing this forces a new resource to be created.* - -* `selector` - (Required) A label query over pods that should match the replica count. **It must match the pod template's labels.** *Changing this forces a new resource to be created.* More info: [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) - -* `service_name` - (Required) 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. *Changing this forces a new resource to be created.* - -* `template` - (Required) 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. - -* `update_strategy` - (Optional) Indicates the StatefulSet update strategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - -* `volume_claim_template` - (Optional) A list of volume claims that pods are allowed to reference. A claim in this list takes precedence over any volumes in the template, with the same name. *Changing this forces a new resource to be created.* - -* `persistent_volume_claim_retention_policy` - (Optional) The object controls if and how PVCs are deleted during the lifecycle of a StatefulSet. - -## Nested Blocks - -### `spec.template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). - -* `spec` - (Optional) Specification of the desired behavior of the pod. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status). - -## Nested Blocks - -### `spec.template.metadata` - -#### Arguments - -These arguments are the same as the for the `metadata` block of a Pod with a few exceptions: - -* When `spec.template.metadata.namespace` does not have a default value, it is empty if not set. - -* The `spec.template.metadata.namespace` is a stub field that does not affect the namespace in which the Pod will be created. The Pod will be created in the same namespace as the main resource. However, modifying this field will force the resource recreation. - -Please see the [Pod resource](pod_v1.html#metadata) for reference. - -### `spec.template.spec` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod_v1.html#spec) for reference. - -## Nested Blocks - -### `spec.update_strategy` - -#### Arguments - -* `type` - (Optional) Indicates the type of the StatefulSetUpdateStrategy. There are two valid update strategies, RollingUpdate and OnDelete. Default is `RollingUpdate`. - -* `rolling_update` - (Optional) The RollingUpdate update strategy will update all Pods in a StatefulSet, in reverse ordinal order, while respecting the StatefulSet guarantees. - - -### `spec.update_strategy.rolling_update` - -#### Arguments - -* `partition` - (Optional) Indicates the ordinal at which the StatefulSet should be partitioned. You can perform a phased roll out (e.g. a linear, geometric, or exponential roll out) using a partitioned rolling update in a similar manner to how you rolled out a canary. To perform a phased roll out, set the partition to the ordinal at which you want the controller to pause the update. By setting the partition to 0, you allow the StatefulSet controller to continue the update process. Default value is `0`. - -## Nested Blocks - -### `spec.volume_claim_template` - -One or more `volume_claim_template` blocks can be specified. - -#### Arguments - -Each takes the same attibutes as a `kubernetes_persistent_volume_claim` resource. - -Please see its [documentation](persistent_volume_claim.html#argument-reference) for reference. - -### `spec.persistent_volume_claim_retention_policy` - -#### Arguments - -* `when_deleted` - (Optional) This field controls what happens when a Statefulset is deleted. Default is Retain. - -* `when_scaled` - (Optional) This field controls what happens when a Statefulset is scaled. Default is Retain. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_stateful_set` resource: - -* `create` - (Default `10 minutes`) Used for creating new StatefulSet -* `read` - (Default `10 minutes`) Used for reading a StatefulSet -* `update` - (Default `10 minutes`) Used for updating a StatefulSet -* `delete` - (Default `10 minutes`) Used for destroying a StatefulSet - -## Import - -kubernetes_stateful_set can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_stateful_set.example default/terraform-example -``` diff --git a/website/docs/r/stateful_set_v1.html.markdown b/website/docs/r/stateful_set_v1.html.markdown deleted file mode 100644 index 6666e0e727..0000000000 --- a/website/docs/r/stateful_set_v1.html.markdown +++ /dev/null @@ -1,354 +0,0 @@ ---- -subcategory: "apps/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_stateful_set_v1" -description: |- - StatefulSet is a Kubernetes resource used to manage stateful applications. ---- - -# kubernetes_stateful_set_v1 - -Manages the deployment and scaling of a set of Pods , and provides guarantees about the -ordering and uniqueness of these Pods. - -Like a Deployment , a StatefulSet manages Pods that are based on an identical container spec. -Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. -These pods are created from the same spec, but are not interchangeable: each has a persistent -identifier that it maintains across any rescheduling. - -A StatefulSet operates under the same pattern as any other Controller. -You define your desired state in a StatefulSet object, and the StatefulSet controller makes any -necessary updates to get there from the current state. - -## Example Usage - -```hcl -resource "kubernetes_stateful_set_v1" "prometheus" { - metadata { - annotations = { - SomeAnnotation = "foobar" - } - - labels = { - k8s-app = "prometheus" - "kubernetes.io/cluster-service" = "true" - "addonmanager.kubernetes.io/mode" = "Reconcile" - version = "v2.2.1" - } - - name = "prometheus" - } - - spec { - pod_management_policy = "Parallel" - replicas = 1 - revision_history_limit = 5 - - selector { - match_labels = { - k8s-app = "prometheus" - } - } - - service_name = "prometheus" - - template { - metadata { - labels = { - k8s-app = "prometheus" - } - - annotations = {} - } - - spec { - service_account_name = "prometheus" - - init_container { - name = "init-chown-data" - image = "busybox:latest" - image_pull_policy = "IfNotPresent" - command = ["chown", "-R", "65534:65534", "/data"] - - volume_mount { - name = "prometheus-data" - mount_path = "/data" - sub_path = "" - } - } - - container { - name = "prometheus-server-configmap-reload" - image = "jimmidyson/configmap-reload:v0.1" - image_pull_policy = "IfNotPresent" - - args = [ - "--volume-dir=/etc/config", - "--webhook-url=http://localhost:9090/-/reload", - ] - - volume_mount { - name = "config-volume" - mount_path = "/etc/config" - read_only = true - } - - resources { - limits = { - cpu = "10m" - memory = "10Mi" - } - - requests = { - cpu = "10m" - memory = "10Mi" - } - } - } - - container { - name = "prometheus-server" - image = "prom/prometheus:v2.2.1" - image_pull_policy = "IfNotPresent" - - args = [ - "--config.file=/etc/config/prometheus.yml", - "--storage.tsdb.path=/data", - "--web.console.libraries=/etc/prometheus/console_libraries", - "--web.console.templates=/etc/prometheus/consoles", - "--web.enable-lifecycle", - ] - - port { - container_port = 9090 - } - - resources { - limits = { - cpu = "200m" - memory = "1000Mi" - } - - requests = { - cpu = "200m" - memory = "1000Mi" - } - } - - volume_mount { - name = "config-volume" - mount_path = "/etc/config" - } - - volume_mount { - name = "prometheus-data" - mount_path = "/data" - sub_path = "" - } - - readiness_probe { - http_get { - path = "/-/ready" - port = 9090 - } - - initial_delay_seconds = 30 - timeout_seconds = 30 - } - - liveness_probe { - http_get { - path = "/-/healthy" - port = 9090 - scheme = "HTTPS" - } - - initial_delay_seconds = 30 - timeout_seconds = 30 - } - } - - termination_grace_period_seconds = 300 - - volume { - name = "config-volume" - - config_map { - name = "prometheus-config" - } - } - } - } - - update_strategy { - type = "RollingUpdate" - - rolling_update { - partition = 1 - } - } - - volume_claim_template { - metadata { - name = "prometheus-data" - } - - spec { - access_modes = ["ReadWriteOnce"] - storage_class_name = "standard" - - resources { - requests = { - storage = "16Gi" - } - } - } - } - - persistent_volume_claim_retention_policy { - when_deleted = "Delete" - when_scaled = "Delete" - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Kubernetes object metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec defines the specification of the desired behavior of the stateful set. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) -* `wait_for_rollout` - (Optional) Wait for the StatefulSet to finish rolling out. Defaults to `true`. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the stateful set that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the stateful set. **Must match `selector`**. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the stateful set, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the stateful set must be unique. - -#### Attributes - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this stateful set that can be used by clients to determine when stateful set has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this stateful set. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `spec` - -#### Arguments - -* `pod_management_policy` - (Optional) 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. *Changing this forces a new resource to be created.* - -* `replicas` - (Optional) 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. This attribute is a string to be able to distinguish between explicit zero and not specified. - -* `revision_history_limit` - (Optional) 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. *Changing this forces a new resource to be created.* - -* `selector` - (Required) A label query over pods that should match the replica count. **It must match the pod template's labels.** *Changing this forces a new resource to be created.* More info: [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors) - -* `service_name` - (Required) 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. *Changing this forces a new resource to be created.* - -* `template` - (Required) 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. - -* `update_strategy` - (Optional) Indicates the StatefulSet update strategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - -* `volume_claim_template` - (Optional) A list of volume claims that pods are allowed to reference. A claim in this list takes precedence over any volumes in the template, with the same name. *Changing this forces a new resource to be created.* - -* `persistent_volume_claim_retention_policy` - (Optional) The object controls if and how PVCs are deleted during the lifecycle of a StatefulSet. - -## Nested Blocks - -### `spec.template` - -#### Arguments - -* `metadata` - (Required) Standard object's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata). - -* `spec` - (Optional) Specification of the desired behavior of the pod. For more info see [Kubernetes reference](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status). - -## Nested Blocks - -### `spec.template.metadata` - -#### Arguments - -These arguments are the same as the for the `metadata` block of a Pod with a few exceptions: - -* When `spec.template.metadata.namespace` does not have a default value, it is empty if not set. - -* The `spec.template.metadata.namespace` is a stub field that does not affect the namespace in which the Pod will be created. The Pod will be created in the same namespace as the main resource. However, modifying this field will force the resource recreation. - -Please see the [Pod resource](pod_v1.html#metadata) for reference. - -### `spec.template.spec` - -#### Arguments - -These arguments are the same as the for the `spec` block of a Pod. - -Please see the [Pod resource](pod_v1.html#spec) for reference. - -## Nested Blocks - -### `spec.update_strategy` - -#### Arguments - -* `type` - (Optional) Indicates the type of the StatefulSetUpdateStrategy. There are two valid update strategies, RollingUpdate and OnDelete. Default is `RollingUpdate`. - -* `rolling_update` - (Optional) The RollingUpdate update strategy will update all Pods in a StatefulSet, in reverse ordinal order, while respecting the StatefulSet guarantees. - - -### `spec.update_strategy.rolling_update` - -#### Arguments - -* `partition` - (Optional) Indicates the ordinal at which the StatefulSet should be partitioned. You can perform a phased roll out (e.g. a linear, geometric, or exponential roll out) using a partitioned rolling update in a similar manner to how you rolled out a canary. To perform a phased roll out, set the partition to the ordinal at which you want the controller to pause the update. By setting the partition to 0, you allow the StatefulSet controller to continue the update process. Default value is `0`. - -## Nested Blocks - -### `spec.volume_claim_template` - -One or more `volume_claim_template` blocks can be specified. - -#### Arguments - -Each takes the same attibutes as a `kubernetes_persistent_volume_claim_v1` resource. - -Please see its [documentation](persistent_volume_claim_v1.html#argument-reference) for reference. - -### `spec.persistent_volume_claim_retention_policy` - -#### Arguments - -* `when_deleted` - (Optional) This field controls what happens when a Statefulset is deleted. Default is Retain. - -* `when_scaled` - (Optional) This field controls what happens when a Statefulset is scaled. Default is Retain. - -## Timeouts - -The following [Timeout](/docs/configuration/resources.html#operation-timeouts) configuration options are available for the `kubernetes_stateful_set_v1` resource: - -* `create` - (Default `10 minutes`) Used for creating new StatefulSet -* `read` - (Default `10 minutes`) Used for reading a StatefulSet -* `update` - (Default `10 minutes`) Used for updating a StatefulSet -* `delete` - (Default `10 minutes`) Used for destroying a StatefulSet - -## Import - -kubernetes_stateful_set_v1 can be imported using its namespace and name, e.g. - -``` -$ terraform import kubernetes_stateful_set_v1.example default/terraform-example -``` diff --git a/website/docs/r/storage_class.html.markdown b/website/docs/r/storage_class.html.markdown deleted file mode 100644 index 654c488d9c..0000000000 --- a/website/docs/r/storage_class.html.markdown +++ /dev/null @@ -1,88 +0,0 @@ ---- -subcategory: "storage/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_storage_class" -description: |- - Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. ---- - -# kubernetes_storage_class - -Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. - -Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ - -## Example Usage - -```hcl -resource "kubernetes_storage_class" "example" { - metadata { - name = "terraform-example" - } - storage_provisioner = "kubernetes.io/gce-pd" - reclaim_policy = "Retain" - parameters = { - type = "pd-standard" - } - mount_options = ["file_mode=0700", "dir_mode=0777", "mfsymlinks", "uid=1000", "gid=1000", "nobrl", "cache=none"] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard storage class's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `parameters` - (Optional) The parameters for the provisioner that should create volumes of this storage class. - Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/storage-classes/#parameters). -* `storage_provisioner` - (Required) Indicates the type of the provisioner -* `reclaim_policy` - (Optional) Indicates the reclaim policy to use. If no reclaimPolicy is specified when a StorageClass object is created, it will default to Delete. -* `volume_binding_mode` - (Optional) Indicates when volume binding and dynamic provisioning should occur. -* `allow_volume_expansion` - (Optional) Indicates whether the storage class allow volume expand, default true. -* `mount_options` - (Optional) Persistent Volumes that are dynamically created by a storage class will have the mount options specified. -* `allowed_topologies` - (Optional) Restrict the node topologies where volumes can be dynamically provisioned. See [allowed_topologies](#allowed_topologies) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the storage class that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the storage class. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the storage class, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `allowed_topologies` - -#### Arguments - -* `match_label_expressions` - (Optional) A list of topology selector requirements by labels. See [match_label_expressions](#match_label_expressions) - -### `match_label_expressions` - -#### Arguments - -* `key` - (Optional) The label key that the selector applies to. -* `values` - (Optional) An array of string values. One value must match the label to be selected. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -kubernetes_storage_class can be imported using its name, e.g. - -``` -$ terraform import kubernetes_storage_class.example terraform-example -``` diff --git a/website/docs/r/storage_class_v1.html.markdown b/website/docs/r/storage_class_v1.html.markdown deleted file mode 100644 index fe143f049d..0000000000 --- a/website/docs/r/storage_class_v1.html.markdown +++ /dev/null @@ -1,88 +0,0 @@ ---- -subcategory: "storage/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_storage_class_v1" -description: |- - Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. ---- - -# kubernetes_storage_class_v1 - -Storage class is the foundation of dynamic provisioning, allowing cluster administrators to define abstractions for the underlying storage platform. - -Read more at https://kubernetes.io/blog/2017/03/dynamic-provisioning-and-storage-classes-kubernetes/ - -## Example Usage - -```hcl -resource "kubernetes_storage_class_v1" "example" { - metadata { - name = "terraform-example" - } - storage_provisioner = "kubernetes.io/gce-pd" - reclaim_policy = "Retain" - parameters = { - type = "pd-standard" - } - mount_options = ["file_mode=0700", "dir_mode=0777", "mfsymlinks", "uid=1000", "gid=1000", "nobrl", "cache=none"] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard storage class's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `parameters` - (Optional) The parameters for the provisioner that should create volumes of this storage class. - Read more about [available parameters](https://kubernetes.io/docs/concepts/storage/storage-classes/#parameters). -* `storage_provisioner` - (Required) Indicates the type of the provisioner -* `reclaim_policy` - (Optional) Indicates the reclaim policy to use. If no reclaimPolicy is specified when a StorageClass object is created, it will default to Delete. -* `volume_binding_mode` - (Optional) Indicates when volume binding and dynamic provisioning should occur. -* `allow_volume_expansion` - (Optional) Indicates whether the storage class allow volume expand, default true. -* `mount_options` - (Optional) Persistent Volumes that are dynamically created by a storage class will have the mount options specified. -* `allowed_topologies` - (Optional) Restrict the node topologies where volumes can be dynamically provisioned. See [allowed_topologies](#allowed_topologies) - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the storage class that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the storage class. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the storage class, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -### `allowed_topologies` - -#### Arguments - -* `match_label_expressions` - (Optional) A list of topology selector requirements by labels. See [match_label_expressions](#match_label_expressions) - -### `match_label_expressions` - -#### Arguments - -* `key` - (Optional) The label key that the selector applies to. -* `values` - (Optional) An array of string values. One value must match the label to be selected. - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this storage class that can be used by clients to determine when storage class has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this storage class. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -## Import - -kubernetes_storage_class_v1 can be imported using its name, e.g. - -``` -$ terraform import kubernetes_storage_class_v1.example terraform-example -``` diff --git a/website/docs/r/token_request_v1.html.markdown b/website/docs/r/token_request_v1.html.markdown deleted file mode 100644 index 392c20f5d2..0000000000 --- a/website/docs/r/token_request_v1.html.markdown +++ /dev/null @@ -1,85 +0,0 @@ ---- -layout: "kubernetes" -subcategory: "authentication/v1" -page_title: "Kubernetes: kubernetes_token_request_v1" -description: |- - TokenRequest requests a token for a given service account. ---- - -# kubernetes_token_request_v1 - -TokenRequest requests a token for a given service account. - - -## Example Usage - -```hcl -resource "kubernetes_service_account_v1" "test" { - metadata { - name = "test" - } -} - -resource "kubernetes_token_request_v1" "test" { - metadata { - name = kubernetes_service_account_v1.test.metadata.0.name - } - spec { - audiences = [ - "api", - "vault", - "factors" - ] - } -} - -output "tokenValue" { - value = kubernetes_token_request_v1.test.token -} -``` - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard role's metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `spec` - (Required) Spec holds information about the request being evaluated - -### Attributes - -* `token` - Token is the opaque bearer token. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the role that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](hhttps://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the role. **Must match `selector`**. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the role, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) -* `namespace` - (Optional) Namespace defines the space within which name of the role must be unique. - -### `spec` - -#### Arguments - -* `audiences` - (Optional) Audiences are the intendend audiences of the token. A recipient of a token must identify themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences. -* `expiration_seconds` - (Optional) ExpirationSeconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response. -* `bound_object_ref` - (Optional) BoundObjectRef is a reference to an object that the token will be bound to. The token will only be valid for as long as the bound object exists. NOTE: The API server's TokenReview endpoint will validate the BoundObjectRef, but other audiences may not. Keep ExpirationSeconds small if you want prompt revocation. - -### `bound_object_ref` - -#### Arguments - -* `api_version` - (Optional) API version of the referent. -* `kind` - (Optional) Kind of the referent. Valid kinds are 'Pod' and 'Secret'. -* `name` - (Optional) Name of the referent. -* `uid` - (Optional) UID of the referent. diff --git a/website/docs/r/validating_webhook_configuration.html.markdown b/website/docs/r/validating_webhook_configuration.html.markdown deleted file mode 100644 index b2b72b85e8..0000000000 --- a/website/docs/r/validating_webhook_configuration.html.markdown +++ /dev/null @@ -1,131 +0,0 @@ ---- -subcategory: "admissionregistration/v1beta1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_validating_webhook_configuration" -description: |- - Validating Webhook Configuration configures a validating admission webhook ---- - -# kubernetes_validating_webhook_configuration - -Validating Webhook Configuration configures a [validating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). - -## Example Usage - -```hcl -resource "kubernetes_validating_webhook_configuration" "example" { - metadata { - name = "test.terraform.io" - } - - webhook { - name = "test.terraform.io" - - admission_review_versions = ["v1", "v1beta1"] - - client_config { - service { - namespace = "example-namespace" - name = "example-service" - } - } - - rule { - api_groups = ["apps"] - api_versions = ["v1"] - operations = ["CREATE"] - resources = ["deployments"] - scope = "Namespaced" - } - - side_effects = "None" - } -} -``` - - -## API version support - -The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Validating Webhook Configuration metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `webhook` - (Required) A list of webhooks and the affected resources and operations. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the Validating Webhook Configuration that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the Validating Webhook Configuration. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the Validating Webhook Configuration, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this Validating Webhook Configuration that can be used by clients to determine when Validating Webhook Configuration has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this Validating Webhook Configuration. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `webhook` - -#### Arguments - -* `admission_review_versions` - (Optional) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list are supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. -* `client_config` - (Required) ClientConfig defines how to communicate with the hook. -* `failure_policy` - (Optional) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - Allowed values are "Ignore" or "Fail". Defaults to "Fail". -* `match_policy` - (Optional) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. Defaults to "Equivalent" -* `name` - (Required) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. -* `namespace_selector` - (Optional) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "runlevel", "operator": "NotIn", "values": [ "0", "1" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "environment", "operator": "In", "values": [ "prod", "staging" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. Default to the empty LabelSelector, which matches everything. -* `object_selector` - (Optional) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. -* `rule` - (Optional) Describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. -* `side_effects` - (Required) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. -* `timeout_seconds` - (Optional) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. - - -### `client_config` - -#### Arguments - -* `ca_bundle` - (Optional) A PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. -* `service` - (Optional) A reference to the service for this webhook. Either `service` or `url` must be specified. If the webhook is running within the cluster, then you should use `service`. -* `url` - (Optional) Gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be "https"; the URL must begin with "https://". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. - -### `service` - -#### Arguments - -* `name` - (Required) The name of the service. -* `namespace` - (Required) The namespace of the service. -* `path` - (Optional) The URL path which will be sent in any request to this service. -* `port` - (Optional) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). - -### `rule` - -#### Arguments - -* `api_groups` - (Required) The API groups the resources belong to. '\*' is all groups. If '\*' is present, the length of the list must be one. -* `api_versions` - (Required) The API versions the resources belong to. '\*' is all versions. If '\*' is present, the length of the list must be one. -* `operations` - (Required) The operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '\*' is present, the length of the list must be one. -* `resources` - (Required) A list of resources this rule applies to. For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '\*' means all resources, but not subresources. 'pods/\*' means all subresources of pods. '\*/scale' means all scale subresources. '\*/\*' means all resources and their subresources. If wildcard is present, the validation rule will ensure resources do not overlap with each other. Depending on the enclosing object, subresources might not be allowed. -* `scope` - (Optional) Specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". - -## Import - -Validating Webhook Configuration can be imported using the name, e.g. - -``` -$ terraform import kubernetes_validating_webhook_configuration.example terraform-example -``` diff --git a/website/docs/r/validating_webhook_configuration_v1.html.markdown b/website/docs/r/validating_webhook_configuration_v1.html.markdown deleted file mode 100644 index 60b767997c..0000000000 --- a/website/docs/r/validating_webhook_configuration_v1.html.markdown +++ /dev/null @@ -1,131 +0,0 @@ ---- -subcategory: "admissionregistration/v1" -layout: "kubernetes" -page_title: "Kubernetes: kubernetes_validating_webhook_configuration_v1" -description: |- - Validating Webhook Configuration configures a validating admission webhook ---- - -# kubernetes_validating_webhook_configuration_v1 - -Validating Webhook Configuration configures a [validating admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks). - -## Example Usage - -```hcl -resource "kubernetes_validating_webhook_configuration_v1" "example" { - metadata { - name = "test.terraform.io" - } - - webhook { - name = "test.terraform.io" - - admission_review_versions = ["v1", "v1beta1"] - - client_config { - service { - namespace = "example-namespace" - name = "example-service" - } - } - - rule { - api_groups = ["apps"] - api_versions = ["v1"] - operations = ["CREATE"] - resources = ["deployments"] - scope = "Namespaced" - } - - side_effects = "None" - } -} -``` - - -## API version support - -The provider supports clusters running either `v1` or `v1beta1` of the Admission Registration API. - -## Argument Reference - -The following arguments are supported: - -* `metadata` - (Required) Standard Validating Webhook Configuration metadata. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata) -* `webhook` - (Required) A list of webhooks and the affected resources and operations. - -## Nested Blocks - -### `metadata` - -#### Arguments - -* `annotations` - (Optional) An unstructured key value map stored with the Validating Webhook Configuration that may be used to store arbitrary metadata. - -~> By default, the provider ignores any annotations whose key names end with *kubernetes.io*. This is necessary because such annotations can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such annotations in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) - -* `generate_name` - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency) -* `labels` - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the Validating Webhook Configuration. May match selectors of replication controllers and services. - -~> By default, the provider ignores any labels whose key names end with *kubernetes.io*. This is necessary because such labels can be mutated by server-side components and consequently cause a perpetual diff in the Terraform plan output. If you explicitly specify any such labels in the configuration template then Terraform will consider these as normal resource attributes and manage them as expected (while still avoiding the perpetual diff problem). For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) - -* `name` - (Optional) Name of the Validating Webhook Configuration, must be unique. Cannot be updated. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) - -#### Attributes - - -* `generation` - A sequence number representing a specific generation of the desired state. -* `resource_version` - An opaque value that represents the internal version of this Validating Webhook Configuration that can be used by clients to determine when Validating Webhook Configuration has changed. For more info see [Kubernetes reference](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency) -* `uid` - The unique in time and space value for this Validating Webhook Configuration. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids) - -### `webhook` - -#### Arguments - -* `admission_review_versions` - (Optional) AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list are supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. -* `client_config` - (Required) ClientConfig defines how to communicate with the hook. -* `failure_policy` - (Optional) FailurePolicy defines how unrecognized errors from the admission endpoint are handled - Allowed values are "Ignore" or "Fail". Defaults to "Fail". -* `match_policy` - (Optional) matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent". - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. Defaults to "Equivalent" -* `name` - (Required) The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. -* `namespace_selector` - (Optional) NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "runlevel", "operator": "NotIn", "values": [ "0", "1" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": { "matchExpressions": [ { "key": "environment", "operator": "In", "values": [ "prod", "staging" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors. Default to the empty LabelSelector, which matches everything. -* `object_selector` - (Optional) ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything. -* `rule` - (Optional) Describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. -* `side_effects` - (Required) SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. -* `timeout_seconds` - (Optional) TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. - - -### `client_config` - -#### Arguments - -* `ca_bundle` - (Optional) A PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. -* `service` - (Optional) A reference to the service for this webhook. Either `service` or `url` must be specified. If the webhook is running within the cluster, then you should use `service`. -* `url` - (Optional) Gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be "https"; the URL must begin with "https://". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either. - -### `service` - -#### Arguments - -* `name` - (Required) The name of the service. -* `namespace` - (Required) The namespace of the service. -* `path` - (Optional) The URL path which will be sent in any request to this service. -* `port` - (Optional) If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). - -### `rule` - -#### Arguments - -* `api_groups` - (Required) The API groups the resources belong to. '\*' is all groups. If '\*' is present, the length of the list must be one. -* `api_versions` - (Required) The API versions the resources belong to. '\*' is all versions. If '\*' is present, the length of the list must be one. -* `operations` - (Required) The operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '\*' is present, the length of the list must be one. -* `resources` - (Required) A list of resources this rule applies to. For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '\*' means all resources, but not subresources. 'pods/\*' means all subresources of pods. '\*/scale' means all scale subresources. '\*/\*' means all resources and their subresources. If wildcard is present, the validation rule will ensure resources do not overlap with each other. Depending on the enclosing object, subresources might not be allowed. -* `scope` - (Optional) Specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". - -## Import - -Validating Webhook Configuration can be imported using the name, e.g. - -``` -$ terraform import kubernetes_validating_webhook_configuration_v1.example terraform-example -``` diff --git a/website/kubernetes.erb b/website/kubernetes.erb deleted file mode 100644 index 7521e63f1e..0000000000 --- a/website/kubernetes.erb +++ /dev/null @@ -1,164 +0,0 @@ -<% wrap_layout :inner do %> - <% content_for :sidebar do %> - - <% end %> - - <%= yield %> -<% end %>