diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 00000000..a9c2c772 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,47 @@ +{ + "name": "Kubernetes-Minikube-in-Docker", + "image": "mcr.microsoft.com/devcontainers/base:bullseye", + "features": { + "ghcr.io/devcontainers/features/common-utils:1": { + "installZsh": "true", + "username": "vscode", + "uid": "1000", + "gid": "1000", + "upgradePackages": "false", + "installOhMyZsh": "true", + "nonFreePackages": "true" + }, + "ghcr.io/devcontainers/features/docker-in-docker:1": { + "enableNonRootDocker": "true", + "username": "vscode", + "moby": "true" + }, + "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { + "version": "latest", + "helm": "latest", + "minikube": "latest" + }, + "ghcr.io/KusionStack/devcontainer-features/kusion:0": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/devcontainers/features/common-utils", + "ghcr.io/devcontainers/features/docker-in-docker", + "ghcr.io/devcontainers/features/kubectl-helm-minikube", + "ghcr.io/KusionStack/devcontainer-features/kusion:0" + ], + "extensions": [ + "KusionStack.kusion", + "kcl.kcl-vscode-extension" + ], + "customizations": { + "codespaces": { + "openFiles": [ + "appops/guestbook/dev/main.k", + "appops/guestbook/base/base.k" + ] + } + }, + "containerEnv": { + "KUSION_QUICK_START": "true" + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 25470f59..00000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,67 +0,0 @@ -# This is a comment. -# Each line is a file pattern followed by one or more owners. - -# These owners will be the default owners for everything in -# the repo. Unless a later match takes precedence, -# @global-owner1 and @global-owner2 will be requested for -# review when someone opens a pull request. -# * @global-owner1 @global-owner2 -* @elliotxx @howieyuen @markliby @amyXia1994 @Peefy - -# Order is important; the last matching pattern takes the most -# precedence. When someone opens a pull request that only -# modifies JS files, only @js-owner and not the global -# owner(s) will be requested for a review. -# *.js @js-owner - -# You can also use email addresses if you prefer. They'll be -# used to look up users just like we do for commit author -# emails. -# *.go docs@example.com - -# Teams can be specified as code owners as well. Teams should -# be identified in the format @org/team-name. Teams must have -# explicit write access to the repository. In this example, -# the octocats team in the octo-org organization owns all .txt files. -# *.txt @octo-org/octocats - -# In this example, @doctocat owns any files in the build/logs -# directory at the root of the repository and any of its -# subdirectories. -# /build/logs/ @doctocat -/appops/ @elliotxx @howieyuen -/base/examples/job-example @howieyuen -/base/examples/kcl-vault-agent @howieyuen -/base/examples/kcl-vault-csi @howieyuen -/base/examples/monitoring @Peefy -/base/examples/native @elliotxx -/base/examples/provider @markliby -/base/examples/server @elliotxx -/base/pkg/kusion_kubernetes @amyXia1994 -/base/pkg/kusion_models @elliotxx -/base/pkg/kusion_prometheus @Peefy -/hack/ @elliotxx @markliby - -# The `docs/*` pattern will match files like -# `docs/getting-started.md` but not further nested files like -# `docs/build-app/troubleshooting.md`. -# docs/* docs@example.com - -# In this example, @octocat owns any file in an apps directory -# anywhere in your repository. -# apps/ @octocat - -# In this example, @doctocat owns any file in the `/docs` -# directory in the root of your repository and any of its -# subdirectories. -# /docs/ @doctocat - -# In this example, any change inside the `/scripts` directory -# will require approval from @doctocat or @octocat. -# /scripts/ @doctocat @octocat - -# In this example, @octocat owns any file in the `/apps` -# directory in the root of your repository except for the `/apps/github` -# subdirectory, as its owners are left empty. -# /apps/ @octocat -# /apps/github \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml new file mode 100644 index 00000000..ac1b798d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -0,0 +1,77 @@ +name: Bug Report +description: Report a bug encountered while operating Kusion +labels: kind/bug +body: + - type: textarea + id: problem + attributes: + label: What happened? + description: | + Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. + validations: + required: true + + - type: textarea + id: expected + attributes: + label: What did you expect to happen? + validations: + required: true + + - type: textarea + id: repro + attributes: + label: How can we reproduce it (as minimally and precisely as possible)? + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Anything else we need to know? + + - type: textarea + id: kusionVersion + attributes: + label: Kusion version + value: | +
+ + ```console + $ kusion version + # paste output here + ``` + +
+ validations: + required: true + + - type: textarea + id: osVersion + attributes: + label: OS version + value: | +
+ + ```console + # On Linux: + $ cat /etc/os-release + # paste output here + $ uname -a + # paste output here + + # On Windows: + C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture + # paste output here + ``` + +
+ + - type: textarea + id: installer + attributes: + label: Install tools + value: | +
+ +
\ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml new file mode 100644 index 00000000..84abc0e6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.yaml @@ -0,0 +1,17 @@ +name: Enhancement Tracking Issue +description: Provide supporting details for a feature in development +labels: kind/feature +body: + - type: textarea + id: feature + attributes: + label: What would you like to be added? + validations: + required: true + + - type: textarea + id: rationale + attributes: + label: Why is this needed? + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/failing-test.yaml b/.github/ISSUE_TEMPLATE/failing-test.yaml new file mode 100644 index 00000000..00290f3a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/failing-test.yaml @@ -0,0 +1,41 @@ +name: Failing Test +description: Report continuously failing tests or jobs in Konfig CI +labels: kind/failing-test +body: + - type: textarea + id: jobs + attributes: + label: Which jobs are failing? + placeholder: | + Please only use this template for submitting reports about continuously failing tests or jobs in Konfig CI. + validations: + required: true + + - type: textarea + id: tests + attributes: + label: Which tests are failing? + validations: + required: true + + - type: textarea + id: since + attributes: + label: Since when has it been failing? + validations: + required: true + + - type: input + id: testgrid + attributes: + label: Testgrid link + + - type: textarea + id: reason + attributes: + label: Reason for failure (if possible) + + - type: textarea + id: additional + attributes: + label: Anything else we need to know? \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..c9803160 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,62 @@ + + +#### What type of PR is this? + + + +#### What this PR does / why we need it: + +#### Which issue(s) this PR fixes: + +Fixes # + +#### Special notes for your reviewer: + +#### Does this PR introduce a user-facing change? + +```release-note + +``` + +#### Additional documentation e.g., design docs, usage docs, etc.: + + +```docs + +``` diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml new file mode 100644 index 00000000..23839b1a --- /dev/null +++ b/.github/workflows/apply.yml @@ -0,0 +1,142 @@ +name: Deploy Apps with Specified Workspace + +on: + workflow_dispatch: + inputs: + workspace: + required: true + type: choice + description: The specified Workspace to apply + options: + - default + - remote-test + project-stack-paths: + required: true + description: The paths of the Project and Stack in the repository to apply + +jobs: + preview: + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Kusion + run: curl https://www.kusionstack.io/scripts/install.sh | sh -s 0.12.1-rc.2 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + + - name: Setup K3d&K3s + uses: nolar/setup-k3d-k3s@v1 + with: + version: v1.25.15+k3s1 + + - name: Preview + id: preview + env: + WORKSPACE_NAME: ${{ github.event.inputs.workspace }} + CHANGED_STACKS: ${{ github.event.inputs.project-stack-paths }} + OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }} + OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }} + WORKSPACE_FILE_DIR: workspaces + run: | + # manually source kusion env file + source "$HOME/.kusion/.env" + + # setup remote backend for kusion cli + kusion config set backends.oss_test '{"type":"oss","configs":{"bucket":"kusion-test","endpoint":"oss-cn-shanghai.aliyuncs.com"}}' + kusion config set backends.current oss_test + + # switch to the specified workspace + kusion workspace switch $WORKSPACE_NAME + + # execute python script for previewing + python3 hack/preview_changed_stacks.py + + - name: Upload Report + id: upload-report + if: ${{ steps.preview.outputs.preview_success == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: preview-report + path: hack/report/preview-result.zip + + - name: Echo Preview Report URL + if: ${{ steps.preview.outputs.preview_success == 'true' }} + run: | + echo "Please check the preview result at: ${{ steps.upload-report.outputs.artifact-url }}" + + - name: Approve Preview + if: ${{ steps.preview.outputs.preview_success == 'true' }} + uses: trstringer/manual-approval@v1 + with: + secret: ${{ secrets.PACKAGE_TOKEN }} + approvers: "liu-hm19" + minimum-approvals: 1 + issue-title: "[Preview] Deploying ${{ github.event.inputs.project-stack-paths }}" + issue-body: "Please check the preview report at: ${{ steps.upload-report.outputs.artifact-url }}" + + apply: + needs: [ preview ] + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Kusion + run: curl https://www.kusionstack.io/scripts/install.sh | sh -s 0.12.1-rc.2 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + + - name: Setup K3d&K3s + uses: nolar/setup-k3d-k3s@v1 + + - name: Apply + id: apply + env: + WORKSPACE_NAME: ${{ github.event.inputs.workspace }} + CHANGED_STACKS: ${{ github.event.inputs.project-stack-paths }} + OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }} + OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }} + WORKSPACE_FILE_DIR: workspaces + run: | + # manually source kusion env file + source "$HOME/.kusion/.env" + + # setup remote backend for kusion cli + kusion config set backends.oss_test '{"type":"oss","configs":{"bucket":"kusion-test","endpoint":"oss-cn-shanghai.aliyuncs.com"}}' + kusion config set backends.current oss_test + + # switch to the specified workspace + kusion workspace switch $WORKSPACE_NAME + + # execute python script for previewing + python3 hack/apply_changed_stacks.py + + - name: Upload Report + id: upload-report + if: ${{ steps.apply.outputs.apply_success == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: apply-report + path: hack/report/apply-result.zip + - name: Echo Apply Report URL + if: ${{ steps.apply.outputs.apply_success == 'true' }} + run: | + echo "Please check the apply result at: ${{ steps.upload-report.outputs.artifact-url }}" diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index cb3ca58d..91bb13ef 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -11,8 +11,7 @@ jobs: steps: - name: "CLA Assistant" if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - # Beta Release - uses: cla-assistant/github-action@v2.1.3-beta + uses: contributor-assistant/github-action@v2.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # the below token should have repo scope and must be manually added by you in the repository's secret @@ -26,7 +25,7 @@ jobs: remote-organization-name: KusionStack remote-repository-name: cla.db branch: 'main' - allowlist: 'test' + allowlist: test,bot* #below are the optional inputs - If the optional inputs are not given, then default values will be taken #remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository) diff --git a/.github/workflows/deploy/deploy.yml b/.github/workflows/deploy/deploy.yml new file mode 100644 index 00000000..68f3c230 --- /dev/null +++ b/.github/workflows/deploy/deploy.yml @@ -0,0 +1,158 @@ +name: "Deploy" + +on: + push: + branches: + - main + +jobs: + get-changed-project-stack: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + - name: Git Diff + id: git-diff + uses: technote-space/get-diff-action@v6 + - name: Get Changed Project and Stack + id: get-changed-project-and-stack + env: + CHANGED_PATHS: ${{ steps.git-diff.outputs.diff }} + run: | + export CHANGED_PATHS="${{ steps.git-diff.outputs.diff }}" + python3 hack/get_changed_project_stack.py + - name: Print Changed Project and Stack + run: | + echo "Changed projects: ${{ steps.get-changed-project-and-stack.outputs.changed_projects }}" + echo "Changed stacks: ${{ steps.get-changed-project-and-stack.outputs.changed_stacks }}" + outputs: + changed_projects: ${{ steps.get-changed-project-and-stack.outputs.changed_projects }} + changed_stacks: ${{ steps.get-changed-project-and-stack.outputs.changed_stacks }} + + check-structure: + needs: get-changed-project-stack + runs-on: ubuntu-latest + container: + image: kusionstack/kusion:latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + - name: Check Structure + env: + CHANGED_PROJECTS: ${{ needs.get-changed-project-stack.outputs.changed_projects }} + CHANGED_STACKS: ${{ needs.get-changed-project-stack.outputs.changed_stacks }} + run: python3 -m pytest -v hack/check_structure.py --junitxml ./hack/report/check-structure.xml --html ./hack/report/check-structure.html + - name: Upload Report + if: always() + uses: actions/upload-artifact@v3 + with: + name: check-structure-report + path: | + hack/report/check-structure.xml + hack/report/check-structure.html + + test-correctness: + needs: get-changed-project-stack + runs-on: ubuntu-latest + container: + image: kusionstack/kusion:latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + - name: Test Correctness + env: + CHANGED_STACKS: ${{ needs.get-changed-project-stack.outputs.changed_stacks }} + WORKSPACE_FILE_DIR: workspaces + run: python3 -m pytest -v hack/test_correctness.py --junitxml ./hack/report/test-correctness.xml --html ./hack/report/test-correctness.html + - name: Upload Report + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-correctness-report + path: | + hack/report/test-correctness.xml + hack/report/test-correctness.html + + preview: + needs: [ get-changed-project-stack, check-structure, test-correctness ] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Kusion + run: curl https://www.kusionstack.io/scripts/install.sh | bash + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + - name: Setup K3d&K3s + uses: nolar/setup-k3d-k3s@v1 + - name: Preview + id: preview + env: + CHANGED_STACKS: ${{ needs.get-changed-project-stack.outputs.changed_stacks }} + WORKSPACE_FILE_DIR: workspaces + run: | + #edit the profile in the post step does not work, source kusion env file manually + source "$HOME/.kusion/.env" + python3 hack/preview_changed_stacks.py + - name: Upload Report + if: ${{ steps.preview.outputs.preview_success == 'true' }} + uses: actions/upload-artifact@v3 + with: + name: preview-report + path: hack/report/preview-result.zip + + apply: + needs: [get-changed-project-stack, preview] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Kusion + run: curl https://www.kusionstack.io/scripts/install.sh | bash + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + - name: Setup K3d&K3s + uses: nolar/setup-k3d-k3s@v1 + - name: Apply + id: apply + env: + CHANGED_STACKS: ${{ needs.get-changed-project-stack.outputs.changed_stacks }} + WORKSPACE_FILE_DIR: workspaces + run: | + #edit the profile in the post step does not work, source kusion env file manually + source "$HOME/.kusion/.env" + python3 hack/apply_changed_stacks.py + - name: Upload Report + if: ${{ steps.apply.outputs.apply_success == 'true' }} + uses: actions/upload-artifact@v3 + with: + name: apply-report + path: hack/report/apply-result.zip diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 1b0f979a..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,108 +0,0 @@ -on: [push, pull_request] - -jobs: - diff: - runs-on: ubuntu-latest - name: git diff - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - id: diff - uses: technote-space/get-diff-action@v6 - outputs: - CHANGED_FILE: ${{ steps.diff.outputs.diff }} - deps: - needs: diff - runs-on: ubuntu-latest - name: parse deps and get affected stacks/projecrs by diff files - container: - image: kusionstack/kusionctl:latest - env: - changePaths: ${{needs.diff.outputs.CHANGED_FILE}} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - id: deps - shell: bash - run: | - echo "changed paths from git diff action: ${changePaths}" - echo "remove single quotes from changed paths" - changePaths=${changePaths//\'/} - echo "removed paths: ${changePaths}" - - affected_stacks="" - affected_projs="" - deps_stack_exit_code=0 - deps_proj_exit_code=0 - - # 1. check if the changed paths empty - if [ -z "${changePaths}" ]; then - # got empty change paths: - echo "got empty changed paths, not deps will be tested" - else - # 2. parse and get affected stacks and projects - - # 2.1 convert change paths to --focus option - change_paths_array=$(echo "$changePaths" | tr '\n' ' ') - focus_files=$(printf -- "--focus %s " $change_paths_array) - - # 2.2 execute deps command - - # affected stacks - deps_cmd_stack="kusion deps --direct down --only stack $focus_files" - echo "get affected stacks: running cmd: $deps_cmd_stack" - affected_stacks=$($deps_cmd_stack) - deps_stack_exit_code=$? - - # affected projects - deps_cmd_proj="kusion deps --direct down $focus_files" - echo "get affected projects: running cmd: $deps_cmd_proj" - affected_projs=$($deps_cmd_proj) - deps_proj_exit_code=$? - fi - - # 3. set output - echo "affected stacks: $affected_stacks" - echo "affected projects: $affected_projs" - # escape the newline symbol in the results: - affected_stacks="${affected_stacks//$'\n'/'%0A'}" - affected_projs="${affected_projs//$'\n'/'%0A'}" - echo "::set-output name=affected_stacks::$affected_stacks" - echo "::set-output name=affected_projs::$affected_projs" - - # 4. If deps cli failed, exit with the actual exit code - [ $deps_stack_exit_code -eq 0 ] && echo "deps command --only stack was successful" || exit "deps command --only stack failed" - [ $deps_proj_exit_code -eq 0 ] && echo "deps command --only project was successful" || exit "deps command --only project failed" - - name: get output result - run: | - echo "affected stacks: ${{ steps.deps.outputs.affected_stacks }}" - echo "affected projects: ${{ steps.deps.outputs.affected_projs }}" - outputs: - affected_stacks: ${{ steps.deps.outputs.affected_stacks }} - affected_projs: ${{ steps.deps.outputs.affected_projs }} - lint-check: - needs: deps - runs-on: ubuntu-latest - container: - image: kusionstack/kusion:latest - env: - CHANGED_FILE: ${{needs.diff.outputs.CHANGED_FILE}} - AFFECTED_STACKS: ${{needs.deps.outputs.affected_stacks}} - AFFECTED_PROJECTS: ${{needs.deps.outputs.affected_projs}} - steps: - - uses: actions/checkout@v2 - - id: install-pytest-html - run: kclvm -mpip install pytest-html -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com - - id: lint-check - run: | - kclvm -mpytest -v -n 5 hack/lint_check.py --junitxml ./hack/report/lint-check.xml --html=./hack/report/lint.html - - id: upload-lint-check-report - if: always() - uses: actions/upload-artifact@v2 - with: - name: lint-check-report - path: | - hack/report/lint-check.xml - hack/report/lint.html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 6c3be394..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,153 +0,0 @@ -on: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - diff: - runs-on: ubuntu-latest - name: git diff - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - id: diff - uses: technote-space/get-diff-action@v6 - outputs: - CHANGED_FILE: ${{ steps.diff.outputs.diff }} - deps: - needs: diff - runs-on: ubuntu-latest - name: parse deps and get affected stacks/projecrs by diff files - container: - image: kusionstack/kusionctl:latest - env: - changePaths: ${{needs.diff.outputs.CHANGED_FILE}} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - id: deps - shell: bash - run: | - echo "changed paths from git diff action: ${changePaths}" - echo "remove single quotes from changed paths" - changePaths=${changePaths//\'/} - echo "removed paths: ${changePaths}" - - affected_stacks="" - affected_projs="" - deps_stack_exit_code=0 - deps_proj_exit_code=0 - - # 1. check if the changed paths empty - if [ -z "${changePaths}" ]; then - # got empty change paths: - echo "got empty changed paths, not deps will be tested" - else - # 2. parse and get affected stacks and projects - - # 2.1 convert change paths to --focus option - change_paths_array=$(echo "$changePaths" | tr '\n' ' ') - focus_files=$(printf -- "--focus %s " $change_paths_array) - - # 2.2 execute deps command - - # affected stacks - deps_cmd_stack="kusion deps --direct down --only stack $focus_files" - echo "get affected stacks: running cmd: $deps_cmd_stack" - affected_stacks=$($deps_cmd_stack) - deps_stack_exit_code=$? - - # affected projects - deps_cmd_proj="kusion deps --direct down $focus_files" - echo "get affected projects: running cmd: $deps_cmd_proj" - affected_projs=$($deps_cmd_proj) - deps_proj_exit_code=$? - fi - - # 3. set output - echo "affected stacks: $affected_stacks" - echo "affected projects: $affected_projs" - # escape the newline symbol in the results: - affected_stacks="${affected_stacks//$'\n'/'%0A'}" - affected_projs="${affected_projs//$'\n'/'%0A'}" - echo "::set-output name=affected_stacks::$affected_stacks" - echo "::set-output name=affected_projs::$affected_projs" - - # 4. If deps cli failed, exit with the actual exit code - [ $deps_stack_exit_code -eq 0 ] && echo "deps command --only stack was successful" || exit "deps command --only stack failed" - [ $deps_proj_exit_code -eq 0 ] && echo "deps command --only project was successful" || exit "deps command --only project failed" - - name: get output result - run: | - echo "affected stacks: ${{ steps.deps.outputs.affected_stacks }}" - echo "affected projects: ${{ steps.deps.outputs.affected_projs }}" - outputs: - affected_stacks: ${{ steps.deps.outputs.affected_stacks }} - affected_projs: ${{ steps.deps.outputs.affected_projs }} - structure-check: - needs: deps - runs-on: ubuntu-latest - container: - image: kusionstack/kusion:latest - env: - CHANGED_FILE: ${{needs.diff.outputs.CHANGED_FILE}} - AFFECTED_STACKS: ${{needs.deps.outputs.affected_stacks}} - AFFECTED_PROJECTS: ${{needs.deps.outputs.affected_projs}} - steps: - - uses: actions/checkout@v2 - - id: install-pytest-html - run: kclvm -mpip install pytest-html -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com - - id: structure-check - run: kclvm -mpytest -v hack/verify-project-structure.py --junitxml ./hack/report/TEST-structure.xml --html=./hack/report/structure.html - - id: upload-structure-check-report - if: always() - uses: actions/upload-artifact@v2 - with: - name: structure-check-report - path: | - hack/report/TEST-structure.xml - hack/report/structure.html - test: - needs: deps - runs-on: ubuntu-latest - container: - image: kusionstack/kusion:latest - env: - CHANGED_FILE: ${{needs.diff.outputs.CHANGED_FILE}} - AFFECTED_STACKS: ${{needs.deps.outputs.affected_stacks}} - AFFECTED_PROJECTS: ${{needs.deps.outputs.affected_projs}} - steps: - - uses: actions/checkout@v2 - - id: install-pytest-html - run: kclvm -mpip install pytest-html -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com - - id: test - run: kclvm -mpytest -v -n 5 hack/test_konfig.py --junitxml ./hack/report/TEST.xml --html=./hack/report/test.html - - id: upload-test-report - if: always() - uses: actions/upload-artifact@v2 - with: - name: test-report - path: | - hack/report/TEST.xml - hack/report/test.html - apply: - if: github.ref == 'refs/heads/main' - needs: [diff, deps, test] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - id: kusion-apply - uses: KusionStack/kusion-actions@main - env: - ALICLOUD_ACCESS_KEY: ${{ secrets.ALICLOUD_ACCESS_KEY }} - ALICLOUD_SECRET_KEY: ${{ secrets.ALICLOUD_SECRET_KEY }} - with: - subcommand: 'apply' - yes: 'true' - detail: 'true' - dryRun: 'true' - diffs: ${{needs.diff.outputs.CHANGED_FILE}} \ No newline at end of file diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..79e97663 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,109 @@ +name: Preview + +on: + pull_request: + branches: + - "main" + +jobs: + get-changed-project-stack: + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + + - name: Git Diff + id: git-diff + uses: technote-space/get-diff-action@v6 + + - name: Get Changed Projects and Stacks + id: get-changed-projects-and-stacks + env: + CHANGED_PATHS: ${{ steps.git-diff.outputs.diff }} + run: | + export CHANGED_PATHS="${{ steps.git-diff.outputs.diff }}" + python3 hack/get_changed_projects_and_stacks.py + + - name: Print Changed Projects and Stacks + run: | + echo "Changed projects: ${{ steps.get-changed-projects-and-stacks.outputs.changed_projects }}" + echo "Changed stacks: ${{ steps.get-changed-projects-and-stacks.outputs.changed_stacks }}" + outputs: + changed_projects: ${{ steps.get-changed-projects-and-stacks.outputs.changed_projects }} + changed_stacks: ${{ steps.get-changed-projects-and-stacks.outputs.changed_stacks }} + + preview: + needs: [ get-changed-project-stack ] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Kusion + run: curl https://www.kusionstack.io/scripts/install.sh | sh -s 0.12.0-rc.2 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install Pytest Html + run: python3 -m pip install pytest-html pyyaml -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com + + - name: Setup K3d&K3s + uses: nolar/setup-k3d-k3s@v1 + with: + version: v1.25.15+k3s1 + + - name: Preview + id: preview + env: + CHANGED_STACKS: ${{ needs.get-changed-project-stack.outputs.changed_stacks }} + OSS_ACCESS_KEY_ID: '${{ secrets.OSS_ACCESS_KEY_ID }}' + OSS_ACCESS_KEY_SECRET: '${{ secrets.OSS_ACCESS_KEY_SECRET }}' + WORKSPACE_FILE_DIR: workspaces + AWS_REGION: us-east-1 + run: | + # manually source kusion env file + source "$HOME/.kusion/.env" + + # setup remote backend for kusion cli + kusion config set backends.oss_test '{"type":"oss","configs":{"bucket":"kusion-test","endpoint":"oss-cn-shanghai.aliyuncs.com"}}' + kusion config set backends.current oss_test + + # execute python script for previewing + python3 hack/preview_changed_stacks.py + + - name: Upload report + id: upload-report + if: ${{ steps.preview.outputs.preview_success == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: preview-report + path: hack/report/preview-result.zip + + - name: Echo URL + if: ${{ steps.preview.outputs.preview_success == 'true' }} + run: echo "${{ steps.upload-report.outputs.artifact-url }}" + + - name: Approve preview + if: ${{ steps.preview.outputs.preview_success == 'true' }} + uses: trstringer/manual-approval@v1 + with: + secret: ${{ secrets.PACKAGE_TOKEN }} + approvers: ${{ github.event.pull_request.user.login }} + minimum-approvals: 1 + issue-title: "Deploying ${{ needs.get-changed-project-stack.outputs.changed_stacks }}" + issue-body: "Please check the preview report at: ${{ steps.upload-report.outputs.artifact-url }}" diff --git a/.gitignore b/.gitignore index df856c9b..412f0a3d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,12 @@ report/ kusion_state.json -changed_list.txt \ No newline at end of file +changed_list.txt + +*#.lock + +# kusion state +kusion_state.yaml + +# kcl mod lock files +kcl.mod.lock \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..827e8684 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# KusionStack Community Code of Conduct + +KusionStack follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index d52de40a..00000000 --- a/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -parallel-compile=kclvm hack/compile-rocket.py - -help: ## 这里是帮助文档 :) - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - -check-all: ## 校验所有 Project - @${parallel-compile} all - -check-%: ## 检验指定目录下的 Project - @${parallel-compile} $* - -# Build and run tests. -# -# Args: -# WHAT: Project directory names to test. -# -# Example: -# make check WHAT=cafeextcontroller -# make check WHAT="cafeextcontroller infraform" -# make check WHAT=samples -check: ## 校验指定目录下的 Project,比如 make check WHAT=nginx-example 或者 make check WHAT="http-echo nginx-example" - @${parallel-compile} $(WHAT) - -clean-all: ## 清理缓存 - @echo "cleaning kcl cache..." - @rm -rf ./.kclvm - @echo "cleaning test cache..." - @find . -name .pytest_cache | xargs rm -rf - @echo "clean finished." - -install-hooks: ## 安装 git hooks,目前主要有 pre-commit hook(提交时自动编译) - @rm -rf .git/hooks/pre-commit - @cd .git/hooks && ln -s ../../hooks/pre-commit pre-commit - @echo 'Successfully install pre-commit hooks!' - -uninstall-hooks: ## 卸载 git hooks - @rm -rf .git/hooks/pre-commit - @echo 'Successfully uninstall pre-commit hooks!' \ No newline at end of file diff --git a/README-zh.md b/README-zh.md deleted file mode 100644 index 2de50c37..00000000 --- a/README-zh.md +++ /dev/null @@ -1,147 +0,0 @@ -# Konfig - -[英语](README.md) | [中文](README-zh.md) - -Konfig 是 KCL(Kusion 配置语言)中基础设施配置的单一存储库。 - -Konfig,也叫做 Kusion Model,是 KusionStack 中预置的、使用 KCL 描述的配置模型,它提供给用户开箱即用、高度抽象的配置界面,模型库最初朴素的出发点就是改善 YAML 用户的效率和体验,我们希望通过将代码更繁杂的模型抽象封装到统一的模型中,从而简化用户侧配置代码的编写。 - -更多细节可参考:[《模型概览》](https://KusionStack.io/docs/reference/model/overview) - -## 目录结构概览 - -配置大库整体结构如下: - -```bash -. -├── Makefile # 通过 Makefile 封装常用命令 -├── README.md # 配置大库说明 -├── appops # 应用运维目录,用来放置所有应用的 KCL 运维配置 -│ ├── guestbook-frontend -│ ├── http-echo -│ └── nginx-example -├── base # Kusion Model 模型库 -│ ├── examples # Kusion Model 样例代码 -│ │ ├── monitoring # 监控配置样例 -│ │ ├── native # Kubernetes 资源配置样例 -│ │ ├── provider # 基础资源配置样例 -│ │ └── server # 云原生应用运维配置模型样例 -│ └── pkg -│ ├── kusion_kubernetes # Kubernetes 底层模型库 -│ ├── kusion_models # 核心模型库 -│ ├── kusion_prometheus # Prometheus 底层模型库 -│ └── kusion_provider # 基础资源 底层模型库 -├── hack # 放置一些脚本 -└── kcl.mod # 大库配置文件,通常用来标识大库根目录位置以及大库所需依赖 -``` - -更多细节可参考:[《配置大库结构概览》](https://KusionStack.io/docs/develop/design/konfig) - -## 快速开始 - -接下来向你展示的是,如何使用 KCL 语言与其相对应的 CLI 工具 Kusion,完成一个运行在 Kubernetes 中的 Long-Running 应用的部署,我们将组织配置的单位叫做应用(Application),描述应用部署和运维细节的配置集合叫做应用服务(Server),它本质上是通过 KCL 定义的运维模型,完整的 Server 模型定义可见:[Server](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k)。 - -### 前提约束 - -在开始之前,我们需要做以下准备工作: - -1、安装 Kusion 工具链 - -我们推荐使用 kusion 的官方安装工具 kusionup,可实现 kusion 多版本管理等关键能力。详情信息请参阅[下载和安装](https://kusionstack.io/docs/user_docs/getting-started/install)。 - -2、下载开源 Konfig 大库 - -在本篇指南中,需要用到部分已经抽象实现的 KCL 模型,有关 KCL 语言的介绍,可以参考 [Tour of KCL](https://kusionstack.io/docs/reference/lang/lang/tour)。 - -3、可用的 Kubernetes 集群 - -必须要有一个 Kubernetes 集群,同时 Kubernetes 集群最好带有 kubectl 命令行工具。 如果你还没有集群,你可以通过 Minikube 构建一个你自己的集群。 - -### Server 样例 - -有关 Server 模型的使用样例在 `base/examples/server` 目录下。这里,我们以 `app_service` 作为演示项目。 - -该目录的子目录分为以下几个模块: -- base:Project 级别配置,也叫基础配置,起到公共配置的作用; -- prod:Stack 级别配置,可以扩充 Project 配置,也可以覆盖; -- project.yaml:Project 基础信息 - -其中,`base/bae.k` 和 `prod/main.k` 是核心代码,直接查看源码文件即可。 - -### 配置编译 - -执行以下命令: -```shell -kusion compile -w base/examples/server/app_service/prod -``` - -编译结果输出在 `base/examples/server/app_service/prod/ci-test/stdout.golden.yaml` 文件中。 - -更多细节请参考:[《使用指南》](https://kusionstack.io/docs/reference/konfig/guide)。 - -### 配置生效 - -编译完成后,现在开始下发配置到 Minikube 集群,检验生效结果。 - -执行以下命令: - -```shell -kusion apply -w base/examples/server/app_service/prod -``` - -输出类似于: - -```shell - SUCCESS Compiling in stack prod... - -Stack: prod ID Action - * ├─ v1:Namespace:sampleapp Create - * ├─ apps/v1:Deployment:sampleapp:sampleappprod Create - * └─ v1:Service:sampleapp:frontend Create - -? Do you want to apply these diffs? [Use arrows to move, type to filter] - yes -> details - no -``` - -移动光标,选择 `yes`,开始应用配置,输出类似于: - -```shell -Start applying diffs...... - SUCCESS Creating Namespace/sampleapp - SUCCESS Creating Deployment/sampleappprod - SUCCESS Creating Service/frontend -Creating Service/frontend [3/3] ███████████████████████████████████████████ 100% | 0s - -Apply complete! Resources: 3 created, 0 updated, 0 deleted. -``` - -到此,就可以使用 [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) 工具,检查资源创建结果。 - -更多 Konfig 的使用细节请参考:[《使用指南》](https://kusionstack.io/docs/reference/konfig/guide)。 - -## 贡献指南 - -### 模型设计规范 - -- 请使用一个属性代替配置模板 -- 请使用字面值类型 Literal Type -- 请使用联合类型 Union Type -- 列表/数组属性应字典化 -- 应为模型书写校验表达式 -- 使用数值单位类型 -- 为模型添加代码注释 - -### 模型设计提案 - -1. 请提交「模型设计提案」到 Issue ,「模型设计提案」应该包含以下几部分: - - 目的:说明该模型设计提案的背景及目的 - - 内容:说明模型设计提案的内容 - - 使用方法:说明该提案的使用方法 -2. 提交 Issue 后,通过评审即可开始模型实现,原型 PR、进度都需要在 Issue 页面中评论跟踪 -3. 实现&评审完毕,关闭 Issue - -## License - -Apache License Version 2.0 \ No newline at end of file diff --git a/README.md b/README.md index 6fe7923a..eb6801a3 100644 --- a/README.md +++ b/README.md @@ -1,167 +1,16 @@ -# Konfig +# konfig -[English](README.md) | [Chinese](README-zh.md) +konfig contains various example applications code, you can use these example applications to quickly try out and learn how to use [Kusion](https://github.com/KusionStack/kusion). -Konfig is the mono repository of the infra configuration in KCL(Kusion Configuration Language). +If you're new to Kusion, it's a good idea to start by [Getting Started](https://www.kusionstack.io/docs/kusion/getting-started/install-kusion), which includes quickstart installation, guided tutorials and deployment instructions. Then you can go to [User Guides](https://www.kusionstack.io/docs) to find more Kusion practical application scenarios, and konfig holds the corresponding examples of the user guides. -Konfig, also known as Kusion Model, is a configuration model library preset in KusionStack and described by KCL. -It provides users with an out-of-the-box, highly abstract configuration interface. -The original starting point of the model library is to improve the efficiency and experience of YAML users. -We hope to simplify the writing of user-side configuration code by abstracting -and encapsulating the model with more complex code into a unified model. +## konfig examples -For more details, please refer to: [Model Overview](https://KusionStack.io/docs/reference/model/overview) - -## Directory Structure - -The overall structure of the configuration library is as follows: - -```bash -. -├── Makefile # use Makefile to encapsulate common commands -├── README.md # configuration library instructions -├── appops # application operation and maintenance directory -│ ├── guestbook-frontend -│ ├── http-echo -│ └── nginx-example -├── base # Kusion Model repository -│ ├── examples # Kusion Model example code -│ │ ├── monitoring # monitoring configuration example -│ │ ├── native # Kubernetes resource configuration example -│ │ ├── provider # infrastructure configuration example -│ │ └── server # cloud native configuration model example -│ └── pkg -│ ├── kusion_kubernetes # Kubernetes low-level model library -│ ├── kusion_models # core model library -│ ├── kusion_prometheus # Prometheus low-level model library -│ └── kusion_provider # infrastructure low-level model library -├── hack # python scripts -└── kcl.mod # core library configuration file -``` - -For more details, please refer to: [Configuration Library Structure Overview](https://KusionStack.io/docs/develop/design/konfig) - -## Quick Start - -Next, I will show you how to use the KCL language and its corresponding CLI tool Kusion to -complete the deployment of a long-running application running in Kubernetes. -We call the unit of organization configuration as *Application*, -which describes application deployment and The configuration set of -operation and maintenance details is called *Server*, -which is essentially the operation and maintenance model defined by KCL. -The complete server model definition can be seen here: -[Server](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k). - -### Prerequisites - -Before we start, we need to do the following preparations: - -1. Install the Kusion toolchain - - We strongly recommend yoy to use kusion's official installation tool kusionup, - which can implement key capabilities such as kusion multi-version management. - See [Download and Install](https://kusionstack.io/docs/user_docs/getting-started/install) for details. - -2. Download the Core Config library - - In this guide, you need to use some KCL models that have been abstractly implemented. - For an introduction to the KCL language, you can refer to - [Tour of KCL](https://kusionstack.io/docs/reference/lang/lang/tour). - -3. Available Kubernetes Cluster - - A Kubernetes cluster is required, preferably with the kubectl command line tool. - If you don't have a cluster yet, you can build your own with Minikube. - -### Server Example - -Examples of using the Server model are in the `base/examples/server` directory. -Here, we use `app_service` as a demo project. - -The subdirectories of this directory are divided into the following modules: -- base: Project-level configuration, also called basic configuration, plays the role of public configuration; -- prod: Stack-level configuration, which can expand or override the Project configuration; -- project.yaml: Project basic information - -Among them, `base/bae.k` and `prod/main.k` are the core code, you can directly view the source code file. - -### Configuration Compile - -Execute the following commands: - -```shell -kusion compile -w base/examples/server/app_service/prod -``` - -The compilation result is output in the `base/examples/server/app_service/prod/ci-test/stdout.golden.yaml` file. - -For more details, please refer to: [User Guide](https://kusionstack.io/docs/reference/konfig/guide). - -### Configuration Takes Effect - -After the compilation is completed, now start to distribute the configuration to the Minikube cluster and check the effective result. - -Execute the following commands: - -```shell -kusion apply -w base/examples/server/app_service/prod -``` - -The output is similar to: - -```shell - SUCCESS Compiling in stack prod... - -Stack: prod ID Action - * ├─ v1:Namespace:sampleapp Create - * ├─ apps/v1:Deployment:sampleapp:sampleappprod Create - * └─ v1:Service:sampleapp:frontend Create - -? Do you want to apply these diffs? [Use arrows to move, type to filter] - yes -> details - no -``` - -Move the cursor and select `yes` to start applying the configuration, the output is similar to: - -```shell -Start applying diffs...... - SUCCESS Creating Namespace/sampleapp - SUCCESS Creating Deployment/sampleappprod - SUCCESS Creating Service/frontend -Creating Service/frontend [3/3] ███████████████████████████████████████████ 100% | 0s - -Apply complete! Resources: 3 created, 0 updated, 0 deleted. -``` - -Now, you can use the [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) tool to check the resource creation result. - -For more details on the use of Konfig, please refer to: [User Guide](https://kusionstack.io/docs/reference/konfig/guide). - -## Contribution Guidelines - -### Model Design Specifications - -- Please use a property instead of the config template -- Please use Literal Type -- Please use Union Type -- List/array properties should be lexicographic -- Validation expressions should be written for the model -- Use numeric unit type -- Add code comments to models - -### Model Design Proposal - -1. Please submit "Model Design Proposal" to Issue. - The "Model Design Proposal" should include the following parts: - - Purpose: Explain the background and purpose of this mockup design proposal - - Content: Describe the content of the model design proposal - - How to use: Explain how to use the proposal -2. After submitting the issue, the model implementation can be started through the review. - Prototype PR and progress need to be tracked by comments on the Issue page -3. After the implementation & review is completed, close the Issue - -## License - -Apache License Version 2.0 \ No newline at end of file +| name | description |user guide| +|----------------------------------------------------|--------------------------------------------------------------------------------|----------| +| [nginx](example/nginx) | An exposing nginx service. |[Expose Application Service Deployed on CSP Kubernetes](https://www.kusionstack.io/docs/kusion/user-guides/cloud-resources/expose-service)| +| [simple-job](example/simple-job) | An one-off or recurring execution task. |[Schedule a Job](https://www.kusionstack.io/docs/kusion/user-guides/working-with-k8s/job)| +| [service-multi-stack](example/service-multi-stack) | A project which contains multiple stacks. |[Deploy Application Securely and Efficiently via GitHub Actions](https://www.kusionstack.io/docs/kusion/user-guides/github-actions/deploy-application-via-github-actions)| +| [simple-service](example/simple-service) | A simple service only contains workload resources. |[Deploy Application](https://www.kusionstack.io/docs/kusion/user-guides/working-with-k8s/deploy-application)| +| [wordpress-cloud-rds](example/wordpress-cloud-rds) | The wordpress application which contains workload and cloud database resource. |[Deliver the WordPress Application with Cloud RDS](https://www.kusionstack.io/docs/next/kusion/user-guides/cloud-resources/database)| +| [wordpress-local-db](example/wordpress-lcoal-db) | The wordpress application which contains workload and local database resource. |[Deliver the WordPress Application on Kubernetes](https://www.kusionstack.io/docs/kusion/getting-started/deliver-wordpress)| diff --git a/appops/clickhouse-operator/OWNERS b/appops/clickhouse-operator/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/appops/clickhouse-operator/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/appops/clickhouse-operator/README.md b/appops/clickhouse-operator/README.md deleted file mode 100644 index 9a057c50..00000000 --- a/appops/clickhouse-operator/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 prod/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd clickhouse-operator -# 查看应用配置 -cat base/base.k -# 查看环境配置 -cat prod/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd prod -kusion compile -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 测试:使用 kusion 将 prod 环境配置一键下发 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -kusion apply - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -kusion destory -``` - -## 目录和文件说明 - -```bash -. -├── OWNERS // 租户信息 -├── README.md // 说明文档 -├── base // 各环境通用配置 -│ ├── base.k // 应用配置 -│ ├── rbac.k // 应用 RBAC 配置 -│ └── templates // 应用依赖的常量配置 -│ ├── etc-clickhouse-operator-confd-files.k -│ ├── etc-clickhouse-operator-configd-files.k -│ ├── etc-clickhouse-operator-files.k -│ ├── etc-clickhouse-operator-templatesd-files.k -│ └── etc-clickhouse-operator-usersd-files.k -├── crd // CRD 配置 -│ ├── clickhouseinstallations.yaml -│ ├── clickhouseinstallationtemplates.yaml -│ └── clickhouseoperatorconfigurations.yaml -├── prod // 环境目录 -│   └── ci-test // 测试目录,放置测试脚本和数据 -│ │ ├── settings.yaml // 测试数据和编译文件配置 -│ │ └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│ ├── kcl.yaml // 编译入口文件配置 -│ ├── main.k // 应用在当前环境的配置清单 -│ └── stack.yaml // stack 标识,stack 基础信息 -└── project.yaml // project 标识,project 基础信息 -``` diff --git a/appops/clickhouse-operator/base/base.k b/appops/clickhouse-operator/base/base.k deleted file mode 100644 index 212e33bc..00000000 --- a/appops/clickhouse-operator/base/base.k +++ /dev/null @@ -1,287 +0,0 @@ -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 as corev1 -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.configmap -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.frontend.container.env as e -import base.pkg.kusion_models.kube.frontend.container.port as cp -import base.pkg.kusion_models.kube.frontend.service -import base.pkg.kusion_models.kube.frontend.serviceaccount as sa -import base.pkg.kusion_models.kube.frontend.sidecar as s -import base.pkg.kusion_models.kube.frontend.volume -import base.pkg.kusion_models.kube.metadata -import .templates - -_app_release_version = "0.19.2" - -appConfiguration: frontend.Server { - # metadata.labels - useBuiltInLabels = False - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - - # spec.selector - useBuiltInSelector = False - selector = { - "app" = metadata.__META_APP_NAME - } - - # spec.template.metadata - podMetadata = apis.ObjectMeta { - labels = { - "app" = metadata.__META_APP_NAME - } - annotations = { - "prometheus.io/port" = "8888" - "prometheus.io/scrape" = "true" - } - } - - # spec.template.spec.containers[0], main container - image = "altinity/clickhouse-operator:0.19.2" - schedulingStrategy.resource = Undefined - mainContainer = container.Main { - name = metadata.__META_APP_NAME - env = [ - e.Env { - name = "OPERATOR_POD_NODE_NAME" - valueFrom = e.EnvValueFrom { - fieldRef = e.ObjectFieldSelector { - fieldPath = "spec.nodeName" - } - } - } - e.Env { - name = "OPERATOR_POD_NAME" - valueFrom = e.EnvValueFrom { - fieldRef = e.ObjectFieldSelector { - fieldPath = "metadata.name" - } - } - } - e.Env { - name = "OPERATOR_POD_NAMESPACE" - valueFrom = e.EnvValueFrom { - fieldRef = e.ObjectFieldSelector { - fieldPath = "metadata.namespace" - } - } - } - e.Env { - name = "OPERATOR_POD_IP" - valueFrom = e.EnvValueFrom { - fieldRef = e.ObjectFieldSelector { - fieldPath = "status.podIP" - } - } - } - e.Env { - name = "OPERATOR_POD_SERVICE_ACCOUNT" - valueFrom = e.EnvValueFrom { - fieldRef = e.ObjectFieldSelector { - fieldPath = "spec.serviceAccountName" - } - } - } - e.Env { - name = "OPERATOR_CONTAINER_CPU_REQUEST" - valueFrom = e.EnvValueFrom { - resourceFieldRef = e.ResourceFieldSelector { - containerName = "clickhouse-operator" - resource = "requests.cpu" - } - } - } - e.Env { - name = "OPERATOR_CONTAINER_CPU_LIMIT" - valueFrom = e.EnvValueFrom { - resourceFieldRef = e.ResourceFieldSelector { - containerName = "clickhouse-operator" - resource = "limits.cpu" - } - } - } - e.Env { - name = "OPERATOR_CONTAINER_MEM_REQUEST" - valueFrom = e.EnvValueFrom { - resourceFieldRef = e.ResourceFieldSelector { - containerName = "clickhouse-operator" - resource = "requests.memory" - } - } - } - e.Env { - name = "OPERATOR_CONTAINER_MEM_LIMIT" - valueFrom = e.EnvValueFrom { - resourceFieldRef = e.ResourceFieldSelector { - containerName = "clickhouse-operator" - resource = "limits.memory" - } - } - } - ] - } - - # spec.template.spec.containers[1:], other containers - sidecarContainers = [ - s.Sidecar { - name = "metrics-exporter" - image = "altinity/metrics-exporter:0.19.2" - ports = [ - cp.ContainerPort { - name = "metrics" - containerPort = 8888 - } - ] - resource = "" - } - ] - - # spec.template.spec.volumes - volumes = [ - volume.Volume { - name = "etc-clickhouse-operator-folder" - volumeSource = volume.ConfigMap { - name = "etc-clickhouse-operator-files" - } - mounts = [ - volume.Mount { - path = "/etc/clickhouse-operator" - } - ] - } - volume.Volume { - name = "etc-clickhouse-operator-confd-folder" - volumeSource = volume.ConfigMap { - name = "etc-clickhouse-operator-confd-files" - } - mounts = [ - volume.Mount { - path = "/etc/clickhouse-operator/conf.d" - } - ] - } - volume.Volume { - name = "etc-clickhouse-operator-configd-folder" - volumeSource = volume.ConfigMap { - name = "etc-clickhouse-operator-configd-files" - } - mounts = [ - volume.Mount { - path = "/etc/clickhouse-operator/config.d" - } - ] - } - volume.Volume { - name = "etc-clickhouse-operator-templatesd-folder" - volumeSource = volume.ConfigMap { - name = "etc-clickhouse-operator-templatesd-files" - } - mounts = [ - volume.Mount { - path = "/etc/clickhouse-operator/templates.d" - } - ] - } - volume.Volume { - name = "etc-clickhouse-operator-usersd-folder" - volumeSource = volume.ConfigMap { - name = "etc-clickhouse-operator-usersd-files" - } - mounts = [ - volume.Mount { - path = "/etc/clickhouse-operator/users.d" - } - ] - } - ] - - # related serviceaccout - serviceAccount = sa.ServiceAccount { - name = metadata.__META_APP_NAME - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - } - } - - # related configmap - configMaps = [ - configmap.ConfigMap { - name = "etc-clickhouse-operator-files" - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - data = { - "config.yaml" = templates.config_yaml - } - } - configmap.ConfigMap { - name = "etc-clickhouse-operator-confd-files" - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - } - configmap.ConfigMap { - name = "etc-clickhouse-operator-configd-files" - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - data = { - "01-clickhouse-01-listen.xml" = templates.clickhouse_01_listen_xml - "01-clickhouse-02-logger.xml" = templates.clickhouse_02_logger_xml - "01-clickhouse-03-query_log.xml" = templates.clickhouse_03_query_log_xml - "01-clickhouse-04-part_log.xml" = templates.clickhouse_04_part_log_xml - } - } - configmap.ConfigMap { - name = "etc-clickhouse-operator-templatesd-files" - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - data = { - "001-templates.json.example" = templates.templates_json_example - "default-pod-template.yaml.example" = templates.default_pod_template_yaml_example - "default-storage-template.yaml.example" = templates.default_storage_template_yaml_example - "readme" = templates.readme - } - } - configmap.ConfigMap { - name = "etc-clickhouse-operator-usersd-files" - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - data = { - "01-clickhouse-user.xml" = templates.clickhouse_user_xml - "02-clickhouse-default-profile.xml" = templates.clickhouse_default_profile_xml - "03-database-ordinary.xml" = templates.database_ordinary_xml - } - } - ] - - # exposed service - services = [ - service.Service { - name = "clickhouse-operator-metrics" - labels = { - "clickhouse.altinity.com/chop" = _app_release_version - "app" = metadata.__META_APP_NAME - } - selector = { - "app" = metadata.__META_APP_NAME - } - ports = [ - corev1.ServicePort { - name = "clickhouse-operator-metrics" - port = 8888 - } - ] - } - ] -} diff --git a/appops/clickhouse-operator/base/rbac.k b/appops/clickhouse-operator/base/rbac.k deleted file mode 100644 index fae78e48..00000000 --- a/appops/clickhouse-operator/base/rbac.k +++ /dev/null @@ -1,107 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.rbac - -rbac.ClusterRole { - name = "clickhouse-operator-kube-system" - labels = { - "clickhouse.altinity.com/chop" = "0.19.2" - } - rules = [ - { - apiGroups = [""] - resources = ["configmaps", "services"] - verbs = ["get", "list", "patch", "update", "watch", "create", "delete"] - } - { - apiGroups = [""] - resources = ["endpoints"] - verbs = ["get", "list", "watch"] - } - { - apiGroups = [""] - resources = ["events"] - verbs = ["create"] - } - { - apiGroups = [""] - resources = ["persistentvolumeclaims"] - verbs = ["get", "list", "patch", "update", "watch", "delete"] - } - { - apiGroups = [""] - resources = ["persistentvolumes", "pods"] - verbs = ["get", "list", "patch", "update", "watch"] - } - { - apiGroups = ["apps"] - resources = ["statefulsets"] - verbs = ["get", "list", "patch", "update", "watch", "create", "delete"] - } - { - apiGroups = ["apps"] - resources = ["replicasets"] - verbs = ["get", "patch", "update", "delete"] - } - { - apiGroups = ["apps"] - resourceNames = ["clickhouse-operator"] - resources = ["deployments"] - verbs = ["get", "patch", "update", "delete"] - } - { - apiGroups = ["policy"] - resources = ["poddisruptionbudgets"] - verbs = ["get", "list", "patch", "update", "watch", "create", "delete"] - } - { - apiGroups = ["clickhouse.altinity.com"] - resources = ["clickhouseinstallations"] - verbs = ["get", "patch", "update", "delete"] - } - { - apiGroups = ["clickhouse.altinity.com"] - resources = ["clickhouseinstallations", "clickhouseinstallationtemplates", "clickhouseoperatorconfigurations"] - verbs = ["get", "list", "watch"] - } - { - apiGroups = ["clickhouse.altinity.com"] - resources = ["clickhouseinstallations/finalizers", "clickhouseinstallationtemplates/finalizers", "clickhouseoperatorconfigurations/finalizers"] - verbs = ["update"] - } - { - apiGroups = ["clickhouse.altinity.com"] - resources = ["clickhouseinstallations/status", "clickhouseinstallationtemplates/status", "clickhouseoperatorconfigurations/status"] - verbs = ["get", "update", "patch", "create", "delete"] - } - { - apiGroups = [""] - resources = ["secrets"] - verbs = ["get", "list"] - } - { - apiGroups = ["apiextensions.k8s.io"] - resources = ["customresourcedefinitions"] - verbs = ["get", "list"] - } - ] -} - -rbac.ClusterRoleBinding { - metadata = { - name = "clickhouse-operator-kube-system" - labels = { - "clickhouse.altinity.com/chop" = "0.19.2" - } - } - roleRef = { - apiGroup = "rbac.authorization.k8s.io" - kind = "ClusterRole" - name = "clickhouse-operator-kube-system" - } - subjects = [ - { - kind = "ServiceAccount" - name = "clickhouse-operator" - namespace = "kube-system" - } - ] -} diff --git a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-confd-files.k b/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-confd-files.k deleted file mode 100644 index e69de29b..00000000 diff --git a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-configd-files.k b/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-configd-files.k deleted file mode 100644 index 90cf116a..00000000 --- a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-configd-files.k +++ /dev/null @@ -1,70 +0,0 @@ -clickhouse_01_listen_xml = """\ - - - - - - - - - :: - 0.0.0.0 - 1 - -""" - -clickhouse_02_logger_xml = """\ - - - - - - - - - - debug - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log - 1000M - 10 - - 1 - - -""" - -clickhouse_03_query_log_xml = """\ - - - - - - - - - system - query_log
- Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day - 7500 -
- -
-""" - -clickhouse_04_part_log_xml = """\ - - - - - - - - - system - part_log
- Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day - 7500 -
-
-""" diff --git a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-files.k b/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-files.k deleted file mode 100644 index cbf7dca9..00000000 --- a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-files.k +++ /dev/null @@ -1,218 +0,0 @@ -config_yaml = """\ -# IMPORTANT -# This file is auto-generated -# Do not edit this file - all changes would be lost -# Edit appropriate template in the following folder: -# deploy/builder/templates-config -# IMPORTANT -# -# Template parameters available: -# watchNamespaces -# chUsername -# chPassword -# password_sha256_hex - -################################################ -## -## Watch Section -## -################################################ -watch: - # List of namespaces where clickhouse-operator watches for events. - # Concurrently running operators should watch on different namespaces - #namespaces: ["dev", "test"] - namespaces: [] - -clickhouse: - configuration: - ################################################ - ## - ## Configuration Files Section - ## - ################################################ - file: - path: - # Path to the folder where ClickHouse configuration files common for all instances within a CHI are located. - common: config.d - # Path to the folder where ClickHouse configuration files unique for each instance (host) within a CHI are located. - host: conf.d - # Path to the folder where ClickHouse configuration files with users settings are located. - # Files are common for all instances within a CHI. - user: users.d - ################################################ - ## - ## Configuration Users Section - ## - ################################################ - user: - default: - # Default values for ClickHouse user configuration - # 1. user/profile - string - # 2. user/quota - string - # 3. user/networks/ip - multiple strings - # 4. user/password - string - profile: default - quota: default - networksIP: - - "::1" - - "127.0.0.1" - password: "default" - ################################################ - ## - ## Configuration Network Section - ## - ################################################ - network: - # Default host_regexp to limit network connectivity from outside - hostRegexpTemplate: "(chi-{chi}-[^.]+\\d+-\\d+|clickhouse\\-{chi})\\.{namespace}\\.svc\\.cluster\\.local$" - ################################################ - ## - ## Access to ClickHouse instances - ## - ################################################ - access: - # ClickHouse credentials (username, password and port) to be used by operator to connect to ClickHouse instances - # for: - # 1. Metrics requests - # 2. Schema maintenance - # 3. DROP DNS CACHE - # User with such credentials can be specified in additional ClickHouse .xml config files, - # located in `chUsersConfigsPath` folder - username: "clickhouse_operator" - password: "clickhouse_operator_password" - secret: - # Location of k8s Secret with username and password to be used by operator to connect to ClickHouse instances - # Can be used instead of explicitly specified username and password - namespace: "" - name: "" - # Port where to connect to ClickHouse instances to - port: 8123 - -################################################ -## -## Templates Section -## -################################################ -template: - chi: - # Path to the folder where ClickHouseInstallation .yaml manifests are located. - # Manifests are applied in sorted alpha-numeric order. - path: templates.d - -################################################ -## -## Reconcile Section -## -################################################ -reconcile: - runtime: - # Max number of concurrent reconciles in progress - threadsNumber: 10 - - statefulSet: - create: - # What to do in case created StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds - # Possible options: - # 1. abort - do nothing, just break the process and wait for admin - # 2. delete - delete newly created problematic StatefulSet - # 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet - onFailure: ignore - - update: - # How many seconds to wait for created/updated StatefulSet to be Ready - timeout: 300 - # How many seconds to wait between checks for created/updated StatefulSet status - pollInterval: 5 - # What to do in case updated StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds - # Possible options: - # 1. abort - do nothing, just break the process and wait for admin - # 2. rollback - delete Pod and rollback StatefulSet to previous Generation. - # Pod would be recreated by StatefulSet based on rollback-ed configuration - # 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet - onFailure: rollback - - host: - # Whether reconciler should wait for host: - # to be excluded from cluster OR - # to be included into cluster - # respectfully - wait: - exclude: true - include: false - -################################################ -## -## Annotations management -## -################################################ -annotation: - # Applied when: - # 1. Propagating annotations from the CHI's `metadata.annotations` to child objects' `metadata.annotations`, - # 2. Propagating annotations from the CHI Template's `metadata.annotations` to CHI's `metadata.annotations`, - # Include annotations from the following list: - # Applied only when not empty. Empty list means "include all, no selection" - include: [] - # Exclude annotations from the following list: - exclude: [] - -################################################ -## -## Labels management -## -################################################ -label: - # Applied when: - # 1. Propagating labels from the CHI's `metadata.labels` to child objects' `metadata.labels`, - # 2. Propagating labels from the CHI Template's `metadata.labels` to CHI's `metadata.labels`, - # Include labels from the following list: - # Applied only when not empty. Empty list means "include all, no selection" - include: [] - # Exclude labels from the following list: - exclude: [] - # Whether to append *Scope* labels to StatefulSet and Pod. - # Full list of available *scope* labels check in labeler.go - # LabelShardScopeIndex - # LabelReplicaScopeIndex - # LabelCHIScopeIndex - # LabelCHIScopeCycleSize - # LabelCHIScopeCycleIndex - # LabelCHIScopeCycleOffset - # LabelClusterScopeIndex - # LabelClusterScopeCycleSize - # LabelClusterScopeCycleIndex - # LabelClusterScopeCycleOffset - appendScope: "no" - -################################################ -## -## StatefulSet management -## -################################################ -statefulSet: - revisionHistoryLimit: 0 - -################################################ -## -## Pod management -## -################################################ -pod: - # Grace period for Pod termination. - # How many seconds to wait between sending - # SIGTERM and SIGKILL during Pod termination process. - # Increase this number is case of slow shutdown. - terminationGracePeriod: 30 - -################################################ -## -## Log parameters -## -################################################ -logger: - logtostderr: "true" - alsologtostderr: "false" - v: "1" - stderrthreshold: "" - vmodule: "" - log_backtrace_at: "" -""" diff --git a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-templatesd-files.k b/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-templatesd-files.k deleted file mode 100644 index 896d8975..00000000 --- a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-templatesd-files.k +++ /dev/null @@ -1,89 +0,0 @@ -templates_json_example = """\ -{ - "apiVersion": "clickhouse.altinity.com/v1", - "kind": "ClickHouseInstallationTemplate", - "metadata": { - "name": "01-default-volumeclaimtemplate" - }, - "spec": { - "templates": { - "volumeClaimTemplates": [ - { - "name": "chi-default-volume-claim-template", - "spec": { - "accessModes": [ - "ReadWriteOnce" - ], - "resources": { - "requests": { - "storage": "2Gi" - } - } - } - } - ], - "podTemplates": [ - { - "name": "chi-default-oneperhost-pod-template", - "distribution": "OnePerHost", - "spec": { - "containers" : [ - { - "name": "clickhouse", - "image": "clickhouse/clickhouse-server:22.3", - "ports": [ - { - "name": "http", - "containerPort": 8123 - }, - { - "name": "client", - "containerPort": 9000 - }, - { - "name": "interserver", - "containerPort": 9009 - } - ] - } - ] - } - } - ] - } - } -} -""" - -default_pod_template_yaml_example = """\ -apiVersion: "clickhouse.altinity.com/v1" -kind: "ClickHouseInstallationTemplate" -metadata: - name: "default-oneperhost-pod-template" -spec: - templates: - podTemplates: - - name: default-oneperhost-pod-template - distribution: "OnePerHost" -""" - -default_storage_template_yaml_example = """\ -apiVersion: "clickhouse.altinity.com/v1" -kind: "ClickHouseInstallationTemplate" -metadata: - name: "default-storage-template-2Gi" -spec: - templates: - volumeClaimTemplates: - - name: default-storage-template-2Gi - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi -""" - -readme = """\ -Templates in this folder are packaged with an operator and available via 'useTemplate' -""" diff --git a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-usersd-files.k b/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-usersd-files.k deleted file mode 100644 index a25d1f58..00000000 --- a/appops/clickhouse-operator/base/templates/etc-clickhouse-operator-usersd-files.k +++ /dev/null @@ -1,63 +0,0 @@ -clickhouse_user_xml = """\ - - - - - - - - - - - 127.0.0.1 - - 716b36073a90c6fe1d445ac1af85f4777c5b7a155cea359961826a030513e448 - clickhouse_operator - default - - - - - 0 - 1 - 10 - - - -""" - -clickhouse_default_profile_xml = """\ - - - - - - - - - - 1 - 1000 - 1 - 1 - - - -""" - -database_ordinary_xml = """\ - - - - - - - - - - - Ordinary - - - -""" diff --git a/appops/clickhouse-operator/crd/clickhouseinstallations.yaml b/appops/clickhouse-operator/crd/clickhouseinstallations.yaml deleted file mode 100644 index a0382b67..00000000 --- a/appops/clickhouse-operator/crd/clickhouseinstallations.yaml +++ /dev/null @@ -1,1361 +0,0 @@ -# Template Parameters: -# -# KIND=ClickHouseInstallation -# SINGULAR=clickhouseinstallation -# PLURAL=clickhouseinstallations -# SHORT=chi -# -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clickhouseinstallations.clickhouse.altinity.com - labels: - clickhouse.altinity.com/chop: 0.19.2 -spec: - group: clickhouse.altinity.com - scope: Namespaced - names: - kind: ClickHouseInstallation - singular: clickhouseinstallation - plural: clickhouseinstallations - shortNames: - - chi - versions: - - name: v1 - served: true - storage: true - additionalPrinterColumns: - - name: version - type: string - description: Operator version - priority: 1 # show in wide view - jsonPath: .status.chop-version - - name: clusters - type: integer - description: Clusters count - priority: 0 # show in standard view - jsonPath: .status.clusters - - name: shards - type: integer - description: Shards count - priority: 1 # show in wide view - jsonPath: .status.shards - - name: hosts - type: integer - description: Hosts count - priority: 0 # show in standard view - jsonPath: .status.hosts - - name: taskID - type: string - description: TaskID - priority: 1 # show in wide view - jsonPath: .status.taskID - - name: status - type: string - description: CHI status - priority: 0 # show in standard view - jsonPath: .status.status - - name: updated - type: integer - description: Updated hosts count - priority: 1 # show in wide view - jsonPath: .status.updated - - name: added - type: integer - description: Added hosts count - priority: 1 # show in wide view - jsonPath: .status.added - - name: deleted - type: integer - description: Hosts deleted count - priority: 1 # show in wide view - jsonPath: .status.deleted - - name: delete - type: integer - description: Hosts to be deleted count - priority: 1 # show in wide view - jsonPath: .status.delete - - name: endpoint - type: string - description: Client access endpoint - priority: 1 # show in wide view - jsonPath: .status.endpoint - - name: age - type: date - description: Age of the resource - # Displayed in all priorities - jsonPath: .metadata.creationTimestamp - subresources: - status: {} - schema: - openAPIV3Schema: - description: "define a set of Kubernetes resources (StatefulSet, PVC, Service, ConfigMap) which describe behavior one or more ClickHouse clusters" - type: object - required: - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - type: object - description: "Current ClickHouseInstallation manifest status, contains many fields like a normalized configuration, clickhouse-operator version, current action and all applied action list, current taskID and all applied taskIDs and other" - properties: - chop-version: - type: string - description: "ClickHouse operator version" - chop-commit: - type: string - description: "ClickHouse operator git commit SHA" - chop-date: - type: string - description: "ClickHouse operator build date" - chop-ip: - type: string - description: "IP address of the operator's pod which managed this CHI" - clusters: - type: integer - minimum: 0 - description: "Clusters count" - shards: - type: integer - minimum: 0 - description: "Shards count" - replicas: - type: integer - minimum: 0 - description: "Replicas count" - hosts: - type: integer - minimum: 0 - description: "Hosts count" - status: - type: string - description: "Status" - taskID: - type: string - description: "Current task id" - taskIDsStarted: - type: array - description: "Started task ids" - items: - type: string - taskIDsCompleted: - type: array - description: "Completed task ids" - items: - type: string - action: - type: string - description: "Action" - actions: - type: array - description: "Actions" - items: - type: string - error: - type: string - description: "Last error" - errors: - type: array - description: "Errors" - items: - type: string - updated: - type: integer - minimum: 0 - description: "Updated Hosts count" - added: - type: integer - minimum: 0 - description: "Added Hosts count" - deleted: - type: integer - minimum: 0 - description: "Deleted Hosts count" - delete: - type: integer - minimum: 0 - description: "About to delete Hosts count" - pods: - type: array - description: "Pods" - items: - type: string - pod-ips: - type: array - description: "Pod IPs" - items: - type: string - fqdns: - type: array - description: "Pods FQDNs" - items: - type: string - endpoint: - type: string - description: "Endpoint" - generation: - type: integer - minimum: 0 - description: "Generation" - normalized: - type: object - description: "Normalized CHI" - x-kubernetes-preserve-unknown-fields: true - spec: - type: object - # x-kubernetes-preserve-unknown-fields: true - description: | - Specification of the desired behavior of one or more ClickHouse clusters - More info: https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md" - properties: - taskID: - type: string - description: "Allow define custom taskID for named update and watch status of this update execution in .status.taskIDs field, by default every update of chi manifest will generate random taskID" - # Need to be StringBool - stop: - type: string - description: | - Allow stop all ClickHouse clusters described in current chi. - Stop mechanism works as follows: - - When `stop` is `1` then setup `Replicas: 0` in each related to current `chi` StatefulSet resource, all `Pods` and `Service` resources will desctroy, but PVCs still live - - When `stop` is `0` then `Pods` will created again and will attach retained PVCs and `Service` also will created again - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - restart: - type: string - description: "This is a 'soft restart' button. When set to 'RollingUpdate' operator will restart ClickHouse pods in a graceful way. Remove it after the use in order to avoid unneeded restarts" - enum: - - "" - - "RollingUpdate" - # Need to be StringBool - troubleshoot: - type: string - description: "allows troubleshoot Pods during CrashLoopBack state, when you apply wrong configuration, `clickhouse-server` wouldn't startup" - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - namespaceDomainPattern: - type: string - description: "custom domain suffix which will add to end of `Service` or `Pod` name, use it when you use custom cluster domain in your Kubernetes cluster" - templating: - type: object - # nullable: true - description: "optional, define policy for auto applying ClickHouseInstallationTemplate inside ClickHouseInstallation" - properties: - policy: - type: string - description: "when defined as `auto` inside ClickhouseInstallationTemplate, it will auto add into all ClickHouseInstallation, manual value is default" - enum: - - "auto" - - "manual" - reconciling: - type: object - description: "optional, allows tuning reconciling cycle for ClickhouseInstallation from clickhouse-operator side" - # nullable: true - properties: - policy: - type: string - description: DEPRECATED - configMapPropagationTimeout: - type: integer - description: | - timeout in seconds when `clickhouse-operator` will wait when applied `ConfigMap` during reconcile `ClickhouseInstallation` pods will updated from cache - see details: https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically - minimum: 0 - maximum: 3600 - cleanup: - type: object - description: "optional, define behavior for cleanup Kubernetes resources during reconcile cycle" - # nullable: true - properties: - unknownObjects: - type: object - description: "what clickhouse-operator shall do when found Kubernetes resources which should be managed with clickhouse-operator, but not have `ownerReference` to any currently managed `ClickHouseInstallation` resource, default behavior is `Delete`" - # nullable: true - properties: - statefulSet: - type: string - description: "behavior policy for unknown StatefulSet, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - pvc: - type: string - description: "behavior policy for unknown PVC, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - configMap: - type: string - description: "behavior policy for unknown ConfigMap, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - service: - type: string - description: "behavior policy for unknown Service, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - reconcileFailedObjects: - type: object - description: "what clickhouse-operator shall do when reconciling Kubernetes resources are failed, default behavior is `Retain`" - # nullable: true - properties: - statefulSet: - type: string - description: "behavior policy for failed StatefulSet reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - pvc: - type: string - description: "behavior policy for failed PVC reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - configMap: - type: string - description: "behavior policy for failed ConfigMap reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - service: - type: string - description: "behavior policy for failed Service reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - defaults: - type: object - description: | - define default behavior for whole ClickHouseInstallation, some behavior can be re-define on cluster, shard and replica level - More info: https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specdefaults - # nullable: true - properties: - # Need to be StringBool - replicasUseFQDN: - type: string - description: | - define should replicas be specified by FQDN in ``, then "no" then will use short hostname and clickhouse-server will use kubernetes default suffixes for properly DNS lookup - "yes" by default - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - distributedDDL: - type: object - description: | - allows change `` settings - More info: https://clickhouse.tech/docs/en/operations/server-configuration-parameters/settings/#server-settings-distributed_ddl - # nullable: true - properties: - profile: - type: string - description: "Settings from this profile will be used to execute DDL queries" - templates: - type: object - description: "optional, configuration of the templates names which will use for generate Kubernetes resources according to one or more ClickHouse clusters described in current ClickHouseInstallation (chi) resource" - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure every `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod`" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters`" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters`" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters`" - serviceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for one `Service` resource which will created by `clickhouse-operator` which cover all clusters in whole `chi` resource" - clusterServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each clickhouse cluster described in `chi.spec.configuration.clusters`" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each shard inside clickhouse cluster described in `chi.spec.configuration.clusters`" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside each clickhouse cluster described in `chi.spec.configuration.clusters`" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - configuration: - type: object - description: "allows configure multiple aspects and behavior for `clickhouse-server` instance and also allows describe multiple `clickhouse-server` clusters inside one `chi` resource" - # nullable: true - properties: - zookeeper: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mounted in `/etc/clickhouse-server/config.d/` - `clickhouse-operator` itself doesn't manage Zookeeper, please install Zookeeper separatelly look examples on https://github.com/Altinity/clickhouse-operator/tree/master/deploy/zookeeper/ - currently, zookeeper (or clickhouse-keeper replacement) used for *ReplicatedMergeTree table engines and for `distributed_ddl` - More details: https://clickhouse.tech/docs/en/operations/server-configuration-parameters/settings/#server-settings_zookeeper - # nullable: true - properties: - nodes: - type: array - description: "describe every available zookeeper cluster node for interaction" - # nullable: true - items: - type: object - #required: - # - host - properties: - host: - type: string - description: "dns name or ip address for Zookeeper node" - port: - type: integer - description: "TCP port which used to connect to Zookeeper node" - minimum: 0 - maximum: 65535 - session_timeout_ms: - type: integer - description: "session timeout during connect to Zookeeper" - operation_timeout_ms: - type: integer - description: "one operation timeout during Zookeeper transactions" - root: - type: string - description: "optional root znode path inside zookeeper to store ClickHouse related data (replication queue or distributed DDL)" - identity: - type: string - description: "optional access credentials string with `user:password` format used when use digest authorization in Zookeeper" - users: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/users.d/` - you can configure password hashed, authorization restrictions, database level security row filters etc. - More details: https://clickhouse.tech/docs/en/operations/settings/settings-users/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationusers - # nullable: true - x-kubernetes-preserve-unknown-fields: true - profiles: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/users.d/` - you can configure any aspect of settings profile - More details: https://clickhouse.tech/docs/en/operations/settings/settings-profiles/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationprofiles - # nullable: true - x-kubernetes-preserve-unknown-fields: true - quotas: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/users.d/` - you can configure any aspect of resource quotas - More details: https://clickhouse.tech/docs/en/operations/quotas/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationquotas - # nullable: true - x-kubernetes-preserve-unknown-fields: true - settings: - type: object - description: | - allows configure `clickhouse-server` settings inside ... tag in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationsettings - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - allows define content of any setting file inside each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - every key in this object is the file name - every value in this object is the file content - you can use `!!binary |` and base64 for binary files, see details here https://yaml.org/type/binary.html - each key could contains prefix like USERS, COMMON, HOST or config.d, users.d, cond.d, wrong prefixes will ignored, subfolders also will ignored - More details: https://github.com/Altinity/clickhouse-operator/blob/master/docs/chi-examples/05-settings-05-files-nested.yaml - # nullable: true - x-kubernetes-preserve-unknown-fields: true - clusters: - type: array - description: | - describes ClickHouse clusters layout and allows change settings on cluster-level, shard-level and replica-level - every cluster is a set of StatefulSet, one StatefulSet contains only one Pod with `clickhouse-server` - all Pods will rendered in part of ClickHouse configs, mounted from ConfigMap as `/etc/clickhouse-server/config.d/chop-generated-remote_servers.xml` - Clusters will use for Distributed table engine, more details: https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/ - If `cluster` contains zookeeper settings (could be inherited from top `chi` level), when you can create *ReplicatedMergeTree tables - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - type: string - description: "cluster name, used to identify set of ClickHouse servers and wide used during generate names of related Kubernetes resources" - minLength: 1 - # See namePartClusterMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - zookeeper: - type: object - description: | - optional, allows configure .. section in each `Pod` only in current ClickHouse cluster, during generate `ConfigMap` which will mounted in `/etc/clickhouse-server/config.d/` - override top-level `chi.spec.configuration.zookeeper` settings - # nullable: true - properties: - nodes: - type: array - description: "describe every available zookeeper cluster node for interaction" - # nullable: true - items: - type: object - #required: - # - host - properties: - host: - type: string - description: "dns name or ip address for Zookeeper node" - port: - type: integer - description: "TCP port which used to connect to Zookeeper node" - minimum: 0 - maximum: 65535 - session_timeout_ms: - type: integer - description: "session timeout during connect to Zookeeper" - operation_timeout_ms: - type: integer - description: "one operation timeout during Zookeeper transactions" - root: - type: string - description: "optional root znode path inside zookeeper to store ClickHouse related data (replication queue or distributed DDL)" - identity: - type: string - description: "optional access credentials string with `user:password` format used when use digest authorization in Zookeeper" - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in each `Pod` only in one cluster during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` - override top-level `chi.spec.configuration.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - optional, allows define content of any setting file inside each `Pod` on current cluster during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` - # nullable: true - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected cluster - override top-level `chi.spec.configuration.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure each `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one cluster" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one cluster" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one cluster" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one cluster" - serviceTemplate: - type: string - description: "optional, fully ignores for cluster-level" - clusterServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each clickhouse cluster described in `chi.spec.configuration.clusters` only for one cluster" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one cluster" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside each clickhouse cluster described in `chi.spec.configuration.clusters` only for one cluster" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - schemaPolicy: - type: object - description: | - describes how schema is propagated within replicas and shards - properties: - replica: - type: string - description: "how schema is propagated within a replica" - enum: - # List SchemaPolicyReplicaXXX constants from model - - "None" - - "All" - shard: - type: string - description: "how schema is propagated between shards" - enum: - # List SchemaPolicyShardXXX constants from model - - "None" - - "All" - - "DistributedTablesOnly" - layout: - type: object - description: | - describe current cluster layout, how much shards in cluster, how much replica in shard - allows override settings on each shard and replica separatelly - # nullable: true - properties: - type: - type: string - description: "DEPRECATED - to be removed soon" - shardsCount: - type: integer - description: "how much shards for current ClickHouse cluster will run in Kubernetes, each shard contains shared-nothing part of data and contains set of replicas, cluster contains 1 shard by default" - replicasCount: - type: integer - description: "how much replicas in each shards for current ClickHouse cluster will run in Kubernetes, each replica is a separate `StatefulSet` which contains only one `Pod` with `clickhouse-server` instance, every shard contains 1 replica by default" - shards: - type: array - description: "optional, allows override top-level `chi.spec.configuration`, cluster-level `chi.spec.configuration.clusters` settings for each shard separately, use it only if you fully understand what you do" - # nullable: true - items: - type: object - properties: - name: - type: string - description: "optional, by default shard name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartShardMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - - definitionType: - type: string - description: "DEPRECATED - to be removed soon" - weight: - type: integer - description: | - optional, 1 by default, allows setup shard setting which will use during insert into tables with `Distributed` engine, - will apply in inside ConfigMap which will mount in /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml - More details: https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/ - # Need to be StringBool - internalReplication: - type: string - description: | - optional, `true` by default when `chi.spec.configuration.clusters[].layout.ReplicaCount` > 1 and 0 otherwise - allows setup setting which will use during insert into tables with `Distributed` engine for insert only in one live replica and other replicas will download inserted data during replication, - will apply in inside ConfigMap which will mount in /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml - More details: https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/ - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - settings: - type: object - # nullable: true - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in each `Pod` only in one shard during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` - override top-level `chi.spec.configuration.settings` and cluster-level `chi.spec.configuration.clusters.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - x-kubernetes-preserve-unknown-fields: true - files: - type: object - # nullable: true - description: | - optional, allows define content of any setting file inside each `Pod` only in one shard during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` and cluster-level `chi.spec.configuration.clusters.files` - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected shard - override top-level `chi.spec.configuration.templates` and cluster-level `chi.spec.configuration.clusters.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure each `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one shard" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for shard-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for shard-level" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - replicasCount: - type: integer - description: | - optional, how much replicas in selected shard for selected ClickHouse cluster will run in Kubernetes, each replica is a separate `StatefulSet` which contains only one `Pod` with `clickhouse-server` instance, - shard contains 1 replica by default - override cluster-level `chi.spec.configuration.clusters.layout.replicasCount` - minimum: 1 - replicas: - type: array - description: | - optional, allows override behavior for selected replicas from cluster-level `chi.spec.configuration.clusters` and shard-level `chi.spec.configuration.clusters.layout.shards` - # nullable: true - items: - # Host - type: object - properties: - name: - type: string - description: "optional, by default replica name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartReplicaMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - tcpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `tcp` for selected replica, override `chi.spec.templates.hostTemplates.spec.tcpPort` - allows connect to `clickhouse-server` via TCP Native protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - httpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `http` for selected replica, override `chi.spec.templates.hostTemplates.spec.httpPort` - allows connect to `clickhouse-server` via HTTP protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - interserverHTTPPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `interserver` for selected replica, override `chi.spec.templates.hostTemplates.spec.interserverHTTPPort` - allows connect between replicas inside same shard during fetch replicated data parts HTTP protocol - minimum: 1 - maximum: 65535 - settings: - type: object - # nullable: true - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - override top-level `chi.spec.configuration.settings`, cluster-level `chi.spec.configuration.clusters.settings` and shard-level `chi.spec.configuration.clusters.layout.shards.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - x-kubernetes-preserve-unknown-fields: true - files: - type: object - # nullable: true - description: | - optional, allows define content of any setting file inside `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files`, cluster-level `chi.spec.configuration.clusters.files` and shard-level `chi.spec.configuration.clusters.layout.shards.files` - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected replica - override top-level `chi.spec.configuration.templates`, cluster-level `chi.spec.configuration.clusters.templates` and shard-level `chi.spec.configuration.clusters.layout.shards.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one replica" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one replica" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for replica-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - shardServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one replica" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - replicas: - type: array - description: "optional, allows override top-level `chi.spec.configuration` and cluster-level `chi.spec.configuration.clusters` configuration for each replica and each shard relates to selected replica, use it only if you fully understand what you do" - # nullable: true - items: - type: object - properties: - name: - type: string - description: "optional, by default replica name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartShardMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - override top-level `chi.spec.configuration.settings`, cluster-level `chi.spec.configuration.clusters.settings` and will ignore if shard-level `chi.spec.configuration.clusters.layout.shards` present - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - # nullable: true - description: | - optional, allows define content of any setting file inside each `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` and cluster-level `chi.spec.configuration.clusters.files`, will ignore if `chi.spec.configuration.clusters.layout.shards` presents - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected replica - override top-level `chi.spec.configuration.templates`, cluster-level `chi.spec.configuration.clusters.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one replica" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one replica" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for replica-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - shardServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one replica" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - shardsCount: - type: integer - description: "optional, count of shards related to current replica, you can override each shard behavior on low-level `chi.spec.configuration.clusters.layout.replicas.shards`" - minimum: 1 - shards: - type: array - description: "optional, list of shards related to current replica, will ignore if `chi.spec.configuration.clusters.layout.shards` presents" - # nullable: true - items: - # Host - type: object - properties: - name: - type: string - description: "optional, by default shard name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartReplicaMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - tcpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `tcp` for selected shard, override `chi.spec.templates.hostTemplates.spec.tcpPort` - allows connect to `clickhouse-server` via TCP Native protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - httpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `http` for selected shard, override `chi.spec.templates.hostTemplates.spec.httpPort` - allows connect to `clickhouse-server` via HTTP protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - interserverHTTPPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `interserver` for selected shard, override `chi.spec.templates.hostTemplates.spec.interserverHTTPPort` - allows connect between replicas inside same shard during fetch replicated data parts HTTP protocol - minimum: 1 - maximum: 65535 - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in `Pod` only in one shard related to current replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - override top-level `chi.spec.configuration.settings`, cluster-level `chi.spec.configuration.clusters.settings` and replica-level `chi.spec.configuration.clusters.layout.replicas.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - optional, allows define content of any setting file inside each `Pod` only in one shard related to current replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` and cluster-level `chi.spec.configuration.clusters.files`, will ignore if `chi.spec.configuration.clusters.layout.shards` presents - # nullable: true - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected replica - override top-level `chi.spec.configuration.templates`, cluster-level `chi.spec.configuration.clusters.templates`, replica-level `chi.spec.configuration.clusters.layout.replicas.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure each `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one shard" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for shard-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for shard-level" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - templates: - type: object - description: "allows define templates which will use for render Kubernetes resources like StatefulSet, ConfigMap, Service, PVC, by default, clickhouse-operator have own templates, but you can override it" - # nullable: true - properties: - hostTemplates: - type: array - description: "hostTemplate will use during apply to generate `clickhose-server` config files" - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - description: "template name, could use to link inside top-level `chi.spec.defaults.templates.hostTemplate`, cluster-level `chi.spec.configuration.clusters.templates.hostTemplate`, shard-level `chi.spec.configuration.clusters.layout.shards.temlates.hostTemplate`, replica-level `chi.spec.configuration.clusters.layout.replicas.templates.hostTemplate`" - type: string - portDistribution: - type: array - description: "define how will distribute numeric values of named ports in `Pod.spec.containers.ports` and clickhouse-server configs" - # nullable: true - items: - type: object - #required: - # - type - properties: - type: - type: string - description: "type of distribution, when `Unspecified` (default value) then all listen ports on clickhouse-server configuration in all Pods will have the same value, when `ClusterScopeIndex` then ports will increment to offset from base value depends on shard and replica index inside cluster with combination of `chi.spec.templates.podTemlates.spec.HostNetwork` it allows setup ClickHouse cluster inside Kubernetes and provide access via external network bypass Kubernetes internal network" - enum: - # List PortDistributionXXX constants - - "" - - "Unspecified" - - "ClusterScopeIndex" - spec: - # Host - type: object - properties: - name: - type: string - description: "by default, hostname will generate, but this allows define custom name for each `clickhuse-server`" - minLength: 1 - # See namePartReplicaMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - tcpPort: - type: integer - description: | - optional, setup `tcp_port` inside `clickhouse-server` settings for each Pod where current template will apply - if specified, should have equal value with `chi.spec.templates.podTemplates.spec.containers.ports[name=tcp]` - More info: https://clickhouse.tech/docs/en/interfaces/tcp/ - minimum: 1 - maximum: 65535 - httpPort: - type: integer - description: | - optional, setup `http_port` inside `clickhouse-server` settings for each Pod where current template will apply - if specified, should have equal value with `chi.spec.templates.podTemplates.spec.containers.ports[name=http]` - More info: https://clickhouse.tech/docs/en/interfaces/http/ - minimum: 1 - maximum: 65535 - interserverHTTPPort: - type: integer - description: | - optional, setup `interserver_http_port` inside `clickhouse-server` settings for each Pod where current template will apply - if specified, should have equal value with `chi.spec.templates.podTemplates.spec.containers.ports[name=interserver]` - More info: https://clickhouse.tech/docs/en/operations/server-configuration-parameters/settings/#interserver-http-port - minimum: 1 - maximum: 65535 - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in each `Pod` where this template will apply during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - optional, allows define content of any setting file inside each `Pod` where this template will apply during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - # nullable: true - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: "be carefull, this part of CRD allows override template inside template, don't use it if you don't understand what you do" - # nullable: true - properties: - hostTemplate: - type: string - podTemplate: - type: string - dataVolumeClaimTemplate: - type: string - logVolumeClaimTemplate: - type: string - serviceTemplate: - type: string - clusterServiceTemplate: - type: string - shardServiceTemplate: - type: string - replicaServiceTemplate: - type: string - - podTemplates: - type: array - description: | - podTemplate will use during render `Pod` inside `StatefulSet.spec` and allows define rendered `Pod.spec`, pod scheduling distribution and pod zone - More information: https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#spectemplatespodtemplates - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - type: string - description: "template name, could use to link inside top-level `chi.spec.defaults.templates.podTemplate`, cluster-level `chi.spec.configuration.clusters.templates.podTemplate`, shard-level `chi.spec.configuration.clusters.layout.shards.temlates.podTemplate`, replica-level `chi.spec.configuration.clusters.layout.replicas.templates.podTemplate`" - generateName: - type: string - description: "allows define format for generated `Pod` name, look to https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#spectemplatesservicetemplates for details about aviailable template variables" - zone: - type: object - description: "allows define custom zone name and will separate ClickHouse `Pods` between nodes, shortcut for `chi.spec.templates.podTemplates.spec.affinity.podAntiAffinity`" - #required: - # - values - properties: - key: - type: string - description: "optional, if defined, allows select kubernetes nodes by label with `name` equal `key`" - values: - type: array - description: "optional, if defined, allows select kubernetes nodes by label with `value` in `values`" - # nullable: true - items: - type: string - distribution: - type: string - description: "DEPRECATED, shortcut for `chi.spec.templates.podTemplates.spec.affinity.podAntiAffinity`" - enum: - - "" - - "Unspecified" - - "OnePerHost" - podDistribution: - type: array - description: "define ClickHouse Pod distibution policy between Kubernetes Nodes inside Shard, Replica, Namespace, CHI, another ClickHouse cluster" - # nullable: true - items: - type: object - #required: - # - type - properties: - type: - type: string - description: "you can define multiple affinity policy types" - enum: - # List PodDistributionXXX constants - - "" - - "Unspecified" - - "ClickHouseAntiAffinity" - - "ShardAntiAffinity" - - "ReplicaAntiAffinity" - - "AnotherNamespaceAntiAffinity" - - "AnotherClickHouseInstallationAntiAffinity" - - "AnotherClusterAntiAffinity" - - "MaxNumberPerNode" - - "NamespaceAffinity" - - "ClickHouseInstallationAffinity" - - "ClusterAffinity" - - "ShardAffinity" - - "ReplicaAffinity" - - "PreviousTailAffinity" - - "CircularReplication" - scope: - type: string - description: "scope for apply each podDistribution" - enum: - # list PodDistributionScopeXXX constants - - "" - - "Unspecified" - - "Shard" - - "Replica" - - "Cluster" - - "ClickHouseInstallation" - - "Namespace" - number: - type: integer - description: "define, how much ClickHouse Pods could be inside selected scope with selected distribution type" - minimum: 0 - maximum: 65535 - topologyKey: - type: string - description: "use for inter-pod affinity look to `pod.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey`, More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity" - spec: - # TODO specify PodSpec - type: object - description: "allows define whole Pod.spec inside StaefulSet.spec, look to https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates for details" - # nullable: true - x-kubernetes-preserve-unknown-fields: true - metadata: - type: object - description: | - allows pass standard object's metadata from template to Pod - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - # nullable: true - x-kubernetes-preserve-unknown-fields: true - - volumeClaimTemplates: - type: array - description: "allows define template for rendering `PVC` kubernetes resource, which would use inside `Pod` for mount clickhouse `data`, clickhouse `logs` or something else" - # nullable: true - items: - type: object - #required: - # - name - # - spec - properties: - name: - description: | - template name, could use to link inside - top-level `chi.spec.defaults.templates.dataVolumeClaimTemplate` or `chi.spec.defaults.templates.logVolumeClaimTemplate`, - cluster-level `chi.spec.configuration.clusters.templates.dataVolumeClaimTemplate` or `chi.spec.configuration.clusters.templates.logVolumeClaimTemplate`, - shard-level `chi.spec.configuration.clusters.layout.shards.temlates.dataVolumeClaimTemplate` or `chi.spec.configuration.clusters.layout.shards.temlates.logVolumeClaimTemplate` - replica-level `chi.spec.configuration.clusters.layout.replicas.templates.dataVolumeClaimTemplate` or `chi.spec.configuration.clusters.layout.replicas.templates.logVolumeClaimTemplate` - type: string - reclaimPolicy: - type: string - description: "define behavior of `PVC` deletion policy during delete `Pod`, `Delete` by default, when `Retain` then `PVC` still alive even `Pod` will deleted" - enum: - - "" - - "Retain" - - "Delete" - metadata: - type: object - description: | - allows pass standard object's metadata from template to PVC - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - # nullable: true - x-kubernetes-preserve-unknown-fields: true - spec: - type: object - description: | - allows define all aspects of `PVC` resource - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims - # nullable: true - x-kubernetes-preserve-unknown-fields: true - serviceTemplates: - type: array - description: | - allows define template for rendering `Service` which would get endpoint from Pods which scoped chi-wide, cluster-wide, shard-wide, replica-wide level - # nullable: true - items: - type: object - #required: - # - name - # - spec - properties: - name: - type: string - description: | - template name, could use to link inside - chi-level `chi.spec.defaults.templates.serviceTemplate` - cluster-level `chi.spec.configuration.clusters.templates.clusterServiceTemplate` - shard-level `chi.spec.configuration.clusters.layout.shards.temlates.shardServiceTemplate` - replica-level `chi.spec.configuration.clusters.layout.replicas.templates.replicaServiceTemplate` or `chi.spec.configuration.clusters.layout.shards.replicas.replicaServiceTemplate` - generateName: - type: string - description: "allows define format for generated `Service` name, look to https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#spectemplatesservicetemplates for details about aviailable template variables" - metadata: - # TODO specify ObjectMeta - type: object - description: | - allows pass standard object's metadata from template to Service - Could be use for define specificly for Cloud Provider metadata which impact to behavior of service - More info: https://kubernetes.io/docs/concepts/services-networking/service/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - spec: - # TODO specify ServiceSpec - type: object - description: | - describe behavior of generated Service - More info: https://kubernetes.io/docs/concepts/services-networking/service/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - useTemplates: - type: array - description: "list of `ClickHouseInstallationTemplate` (chit) resource names which will merge with current `Chi` manifest during render Kubernetes resources to create related ClickHouse clusters" - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - type: string - description: "name of `ClickHouseInstallationTemplate` (chit) resource" - namespace: - type: string - description: "Kubernetes namespace where need search `chit` resource, depending on `watchNamespaces` settings in `clichouse-operator`" - useType: - type: string - description: "optional, current strategy is only merge, and current `chi` settings have more priority than merged template `chit`" - enum: - # List useTypeXXX constants from model - - "" - - "merge" diff --git a/appops/clickhouse-operator/crd/clickhouseinstallationtemplates.yaml b/appops/clickhouse-operator/crd/clickhouseinstallationtemplates.yaml deleted file mode 100644 index 9cea0567..00000000 --- a/appops/clickhouse-operator/crd/clickhouseinstallationtemplates.yaml +++ /dev/null @@ -1,1361 +0,0 @@ -# Template Parameters: -# -# KIND=ClickHouseInstallationTemplate -# SINGULAR=clickhouseinstallationtemplate -# PLURAL=clickhouseinstallationtemplates -# SHORT=chit -# -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clickhouseinstallationtemplates.clickhouse.altinity.com - labels: - clickhouse.altinity.com/chop: 0.19.2 -spec: - group: clickhouse.altinity.com - scope: Namespaced - names: - kind: ClickHouseInstallationTemplate - singular: clickhouseinstallationtemplate - plural: clickhouseinstallationtemplates - shortNames: - - chit - versions: - - name: v1 - served: true - storage: true - additionalPrinterColumns: - - name: version - type: string - description: Operator version - priority: 1 # show in wide view - jsonPath: .status.chop-version - - name: clusters - type: integer - description: Clusters count - priority: 0 # show in standard view - jsonPath: .status.clusters - - name: shards - type: integer - description: Shards count - priority: 1 # show in wide view - jsonPath: .status.shards - - name: hosts - type: integer - description: Hosts count - priority: 0 # show in standard view - jsonPath: .status.hosts - - name: taskID - type: string - description: TaskID - priority: 1 # show in wide view - jsonPath: .status.taskID - - name: status - type: string - description: CHI status - priority: 0 # show in standard view - jsonPath: .status.status - - name: updated - type: integer - description: Updated hosts count - priority: 1 # show in wide view - jsonPath: .status.updated - - name: added - type: integer - description: Added hosts count - priority: 1 # show in wide view - jsonPath: .status.added - - name: deleted - type: integer - description: Hosts deleted count - priority: 1 # show in wide view - jsonPath: .status.deleted - - name: delete - type: integer - description: Hosts to be deleted count - priority: 1 # show in wide view - jsonPath: .status.delete - - name: endpoint - type: string - description: Client access endpoint - priority: 1 # show in wide view - jsonPath: .status.endpoint - - name: age - type: date - description: Age of the resource - # Displayed in all priorities - jsonPath: .metadata.creationTimestamp - subresources: - status: {} - schema: - openAPIV3Schema: - description: "define a set of Kubernetes resources (StatefulSet, PVC, Service, ConfigMap) which describe behavior one or more ClickHouse clusters" - type: object - required: - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - type: object - description: "Current ClickHouseInstallation manifest status, contains many fields like a normalized configuration, clickhouse-operator version, current action and all applied action list, current taskID and all applied taskIDs and other" - properties: - chop-version: - type: string - description: "ClickHouse operator version" - chop-commit: - type: string - description: "ClickHouse operator git commit SHA" - chop-date: - type: string - description: "ClickHouse operator build date" - chop-ip: - type: string - description: "IP address of the operator's pod which managed this CHI" - clusters: - type: integer - minimum: 0 - description: "Clusters count" - shards: - type: integer - minimum: 0 - description: "Shards count" - replicas: - type: integer - minimum: 0 - description: "Replicas count" - hosts: - type: integer - minimum: 0 - description: "Hosts count" - status: - type: string - description: "Status" - taskID: - type: string - description: "Current task id" - taskIDsStarted: - type: array - description: "Started task ids" - items: - type: string - taskIDsCompleted: - type: array - description: "Completed task ids" - items: - type: string - action: - type: string - description: "Action" - actions: - type: array - description: "Actions" - items: - type: string - error: - type: string - description: "Last error" - errors: - type: array - description: "Errors" - items: - type: string - updated: - type: integer - minimum: 0 - description: "Updated Hosts count" - added: - type: integer - minimum: 0 - description: "Added Hosts count" - deleted: - type: integer - minimum: 0 - description: "Deleted Hosts count" - delete: - type: integer - minimum: 0 - description: "About to delete Hosts count" - pods: - type: array - description: "Pods" - items: - type: string - pod-ips: - type: array - description: "Pod IPs" - items: - type: string - fqdns: - type: array - description: "Pods FQDNs" - items: - type: string - endpoint: - type: string - description: "Endpoint" - generation: - type: integer - minimum: 0 - description: "Generation" - normalized: - type: object - description: "Normalized CHI" - x-kubernetes-preserve-unknown-fields: true - spec: - type: object - # x-kubernetes-preserve-unknown-fields: true - description: | - Specification of the desired behavior of one or more ClickHouse clusters - More info: https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md" - properties: - taskID: - type: string - description: "Allow define custom taskID for named update and watch status of this update execution in .status.taskIDs field, by default every update of chi manifest will generate random taskID" - # Need to be StringBool - stop: - type: string - description: | - Allow stop all ClickHouse clusters described in current chi. - Stop mechanism works as follows: - - When `stop` is `1` then setup `Replicas: 0` in each related to current `chi` StatefulSet resource, all `Pods` and `Service` resources will desctroy, but PVCs still live - - When `stop` is `0` then `Pods` will created again and will attach retained PVCs and `Service` also will created again - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - restart: - type: string - description: "This is a 'soft restart' button. When set to 'RollingUpdate' operator will restart ClickHouse pods in a graceful way. Remove it after the use in order to avoid unneeded restarts" - enum: - - "" - - "RollingUpdate" - # Need to be StringBool - troubleshoot: - type: string - description: "allows troubleshoot Pods during CrashLoopBack state, when you apply wrong configuration, `clickhouse-server` wouldn't startup" - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - namespaceDomainPattern: - type: string - description: "custom domain suffix which will add to end of `Service` or `Pod` name, use it when you use custom cluster domain in your Kubernetes cluster" - templating: - type: object - # nullable: true - description: "optional, define policy for auto applying ClickHouseInstallationTemplate inside ClickHouseInstallation" - properties: - policy: - type: string - description: "when defined as `auto` inside ClickhouseInstallationTemplate, it will auto add into all ClickHouseInstallation, manual value is default" - enum: - - "auto" - - "manual" - reconciling: - type: object - description: "optional, allows tuning reconciling cycle for ClickhouseInstallation from clickhouse-operator side" - # nullable: true - properties: - policy: - type: string - description: DEPRECATED - configMapPropagationTimeout: - type: integer - description: | - timeout in seconds when `clickhouse-operator` will wait when applied `ConfigMap` during reconcile `ClickhouseInstallation` pods will updated from cache - see details: https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically - minimum: 0 - maximum: 3600 - cleanup: - type: object - description: "optional, define behavior for cleanup Kubernetes resources during reconcile cycle" - # nullable: true - properties: - unknownObjects: - type: object - description: "what clickhouse-operator shall do when found Kubernetes resources which should be managed with clickhouse-operator, but not have `ownerReference` to any currently managed `ClickHouseInstallation` resource, default behavior is `Delete`" - # nullable: true - properties: - statefulSet: - type: string - description: "behavior policy for unknown StatefulSet, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - pvc: - type: string - description: "behavior policy for unknown PVC, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - configMap: - type: string - description: "behavior policy for unknown ConfigMap, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - service: - type: string - description: "behavior policy for unknown Service, Delete by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - reconcileFailedObjects: - type: object - description: "what clickhouse-operator shall do when reconciling Kubernetes resources are failed, default behavior is `Retain`" - # nullable: true - properties: - statefulSet: - type: string - description: "behavior policy for failed StatefulSet reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - pvc: - type: string - description: "behavior policy for failed PVC reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - configMap: - type: string - description: "behavior policy for failed ConfigMap reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - service: - type: string - description: "behavior policy for failed Service reconciling, Retain by default" - enum: - # List ObjectsCleanupXXX constants from model - - "Retain" - - "Delete" - defaults: - type: object - description: | - define default behavior for whole ClickHouseInstallation, some behavior can be re-define on cluster, shard and replica level - More info: https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specdefaults - # nullable: true - properties: - # Need to be StringBool - replicasUseFQDN: - type: string - description: | - define should replicas be specified by FQDN in ``, then "no" then will use short hostname and clickhouse-server will use kubernetes default suffixes for properly DNS lookup - "yes" by default - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - distributedDDL: - type: object - description: | - allows change `` settings - More info: https://clickhouse.tech/docs/en/operations/server-configuration-parameters/settings/#server-settings-distributed_ddl - # nullable: true - properties: - profile: - type: string - description: "Settings from this profile will be used to execute DDL queries" - templates: - type: object - description: "optional, configuration of the templates names which will use for generate Kubernetes resources according to one or more ClickHouse clusters described in current ClickHouseInstallation (chi) resource" - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure every `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod`" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters`" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters`" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters`" - serviceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for one `Service` resource which will created by `clickhouse-operator` which cover all clusters in whole `chi` resource" - clusterServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each clickhouse cluster described in `chi.spec.configuration.clusters`" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each shard inside clickhouse cluster described in `chi.spec.configuration.clusters`" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside each clickhouse cluster described in `chi.spec.configuration.clusters`" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - configuration: - type: object - description: "allows configure multiple aspects and behavior for `clickhouse-server` instance and also allows describe multiple `clickhouse-server` clusters inside one `chi` resource" - # nullable: true - properties: - zookeeper: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mounted in `/etc/clickhouse-server/config.d/` - `clickhouse-operator` itself doesn't manage Zookeeper, please install Zookeeper separatelly look examples on https://github.com/Altinity/clickhouse-operator/tree/master/deploy/zookeeper/ - currently, zookeeper (or clickhouse-keeper replacement) used for *ReplicatedMergeTree table engines and for `distributed_ddl` - More details: https://clickhouse.tech/docs/en/operations/server-configuration-parameters/settings/#server-settings_zookeeper - # nullable: true - properties: - nodes: - type: array - description: "describe every available zookeeper cluster node for interaction" - # nullable: true - items: - type: object - #required: - # - host - properties: - host: - type: string - description: "dns name or ip address for Zookeeper node" - port: - type: integer - description: "TCP port which used to connect to Zookeeper node" - minimum: 0 - maximum: 65535 - session_timeout_ms: - type: integer - description: "session timeout during connect to Zookeeper" - operation_timeout_ms: - type: integer - description: "one operation timeout during Zookeeper transactions" - root: - type: string - description: "optional root znode path inside zookeeper to store ClickHouse related data (replication queue or distributed DDL)" - identity: - type: string - description: "optional access credentials string with `user:password` format used when use digest authorization in Zookeeper" - users: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/users.d/` - you can configure password hashed, authorization restrictions, database level security row filters etc. - More details: https://clickhouse.tech/docs/en/operations/settings/settings-users/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationusers - # nullable: true - x-kubernetes-preserve-unknown-fields: true - profiles: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/users.d/` - you can configure any aspect of settings profile - More details: https://clickhouse.tech/docs/en/operations/settings/settings-profiles/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationprofiles - # nullable: true - x-kubernetes-preserve-unknown-fields: true - quotas: - type: object - description: | - allows configure .. section in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/users.d/` - you can configure any aspect of resource quotas - More details: https://clickhouse.tech/docs/en/operations/quotas/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationquotas - # nullable: true - x-kubernetes-preserve-unknown-fields: true - settings: - type: object - description: | - allows configure `clickhouse-server` settings inside ... tag in each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - Your yaml code will convert to XML, see examples https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#specconfigurationsettings - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - allows define content of any setting file inside each `Pod` during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - every key in this object is the file name - every value in this object is the file content - you can use `!!binary |` and base64 for binary files, see details here https://yaml.org/type/binary.html - each key could contains prefix like USERS, COMMON, HOST or config.d, users.d, cond.d, wrong prefixes will ignored, subfolders also will ignored - More details: https://github.com/Altinity/clickhouse-operator/blob/master/docs/chi-examples/05-settings-05-files-nested.yaml - # nullable: true - x-kubernetes-preserve-unknown-fields: true - clusters: - type: array - description: | - describes ClickHouse clusters layout and allows change settings on cluster-level, shard-level and replica-level - every cluster is a set of StatefulSet, one StatefulSet contains only one Pod with `clickhouse-server` - all Pods will rendered in part of ClickHouse configs, mounted from ConfigMap as `/etc/clickhouse-server/config.d/chop-generated-remote_servers.xml` - Clusters will use for Distributed table engine, more details: https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/ - If `cluster` contains zookeeper settings (could be inherited from top `chi` level), when you can create *ReplicatedMergeTree tables - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - type: string - description: "cluster name, used to identify set of ClickHouse servers and wide used during generate names of related Kubernetes resources" - minLength: 1 - # See namePartClusterMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - zookeeper: - type: object - description: | - optional, allows configure .. section in each `Pod` only in current ClickHouse cluster, during generate `ConfigMap` which will mounted in `/etc/clickhouse-server/config.d/` - override top-level `chi.spec.configuration.zookeeper` settings - # nullable: true - properties: - nodes: - type: array - description: "describe every available zookeeper cluster node for interaction" - # nullable: true - items: - type: object - #required: - # - host - properties: - host: - type: string - description: "dns name or ip address for Zookeeper node" - port: - type: integer - description: "TCP port which used to connect to Zookeeper node" - minimum: 0 - maximum: 65535 - session_timeout_ms: - type: integer - description: "session timeout during connect to Zookeeper" - operation_timeout_ms: - type: integer - description: "one operation timeout during Zookeeper transactions" - root: - type: string - description: "optional root znode path inside zookeeper to store ClickHouse related data (replication queue or distributed DDL)" - identity: - type: string - description: "optional access credentials string with `user:password` format used when use digest authorization in Zookeeper" - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in each `Pod` only in one cluster during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` - override top-level `chi.spec.configuration.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - optional, allows define content of any setting file inside each `Pod` on current cluster during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` - # nullable: true - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected cluster - override top-level `chi.spec.configuration.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure each `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one cluster" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one cluster" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one cluster" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one cluster" - serviceTemplate: - type: string - description: "optional, fully ignores for cluster-level" - clusterServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each clickhouse cluster described in `chi.spec.configuration.clusters` only for one cluster" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one cluster" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside each clickhouse cluster described in `chi.spec.configuration.clusters` only for one cluster" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - schemaPolicy: - type: object - description: | - describes how schema is propagated within replicas and shards - properties: - replica: - type: string - description: "how schema is propagated within a replica" - enum: - # List SchemaPolicyReplicaXXX constants from model - - "None" - - "All" - shard: - type: string - description: "how schema is propagated between shards" - enum: - # List SchemaPolicyShardXXX constants from model - - "None" - - "All" - - "DistributedTablesOnly" - layout: - type: object - description: | - describe current cluster layout, how much shards in cluster, how much replica in shard - allows override settings on each shard and replica separatelly - # nullable: true - properties: - type: - type: string - description: "DEPRECATED - to be removed soon" - shardsCount: - type: integer - description: "how much shards for current ClickHouse cluster will run in Kubernetes, each shard contains shared-nothing part of data and contains set of replicas, cluster contains 1 shard by default" - replicasCount: - type: integer - description: "how much replicas in each shards for current ClickHouse cluster will run in Kubernetes, each replica is a separate `StatefulSet` which contains only one `Pod` with `clickhouse-server` instance, every shard contains 1 replica by default" - shards: - type: array - description: "optional, allows override top-level `chi.spec.configuration`, cluster-level `chi.spec.configuration.clusters` settings for each shard separately, use it only if you fully understand what you do" - # nullable: true - items: - type: object - properties: - name: - type: string - description: "optional, by default shard name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartShardMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - - definitionType: - type: string - description: "DEPRECATED - to be removed soon" - weight: - type: integer - description: | - optional, 1 by default, allows setup shard setting which will use during insert into tables with `Distributed` engine, - will apply in inside ConfigMap which will mount in /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml - More details: https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/ - # Need to be StringBool - internalReplication: - type: string - description: | - optional, `true` by default when `chi.spec.configuration.clusters[].layout.ReplicaCount` > 1 and 0 otherwise - allows setup setting which will use during insert into tables with `Distributed` engine for insert only in one live replica and other replicas will download inserted data during replication, - will apply in inside ConfigMap which will mount in /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml - More details: https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/ - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - settings: - type: object - # nullable: true - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in each `Pod` only in one shard during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` - override top-level `chi.spec.configuration.settings` and cluster-level `chi.spec.configuration.clusters.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - x-kubernetes-preserve-unknown-fields: true - files: - type: object - # nullable: true - description: | - optional, allows define content of any setting file inside each `Pod` only in one shard during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` and cluster-level `chi.spec.configuration.clusters.files` - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected shard - override top-level `chi.spec.configuration.templates` and cluster-level `chi.spec.configuration.clusters.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure each `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one shard" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for shard-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for shard-level" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - replicasCount: - type: integer - description: | - optional, how much replicas in selected shard for selected ClickHouse cluster will run in Kubernetes, each replica is a separate `StatefulSet` which contains only one `Pod` with `clickhouse-server` instance, - shard contains 1 replica by default - override cluster-level `chi.spec.configuration.clusters.layout.replicasCount` - minimum: 1 - replicas: - type: array - description: | - optional, allows override behavior for selected replicas from cluster-level `chi.spec.configuration.clusters` and shard-level `chi.spec.configuration.clusters.layout.shards` - # nullable: true - items: - # Host - type: object - properties: - name: - type: string - description: "optional, by default replica name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartReplicaMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - tcpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `tcp` for selected replica, override `chi.spec.templates.hostTemplates.spec.tcpPort` - allows connect to `clickhouse-server` via TCP Native protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - httpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `http` for selected replica, override `chi.spec.templates.hostTemplates.spec.httpPort` - allows connect to `clickhouse-server` via HTTP protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - interserverHTTPPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `interserver` for selected replica, override `chi.spec.templates.hostTemplates.spec.interserverHTTPPort` - allows connect between replicas inside same shard during fetch replicated data parts HTTP protocol - minimum: 1 - maximum: 65535 - settings: - type: object - # nullable: true - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - override top-level `chi.spec.configuration.settings`, cluster-level `chi.spec.configuration.clusters.settings` and shard-level `chi.spec.configuration.clusters.layout.shards.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - x-kubernetes-preserve-unknown-fields: true - files: - type: object - # nullable: true - description: | - optional, allows define content of any setting file inside `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files`, cluster-level `chi.spec.configuration.clusters.files` and shard-level `chi.spec.configuration.clusters.layout.shards.files` - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected replica - override top-level `chi.spec.configuration.templates`, cluster-level `chi.spec.configuration.clusters.templates` and shard-level `chi.spec.configuration.clusters.layout.shards.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one replica" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one replica" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for replica-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - shardServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one replica" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - replicas: - type: array - description: "optional, allows override top-level `chi.spec.configuration` and cluster-level `chi.spec.configuration.clusters` configuration for each replica and each shard relates to selected replica, use it only if you fully understand what you do" - # nullable: true - items: - type: object - properties: - name: - type: string - description: "optional, by default replica name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartShardMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - override top-level `chi.spec.configuration.settings`, cluster-level `chi.spec.configuration.clusters.settings` and will ignore if shard-level `chi.spec.configuration.clusters.layout.shards` present - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - # nullable: true - description: | - optional, allows define content of any setting file inside each `Pod` only in one replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` and cluster-level `chi.spec.configuration.clusters.files`, will ignore if `chi.spec.configuration.clusters.layout.shards` presents - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected replica - override top-level `chi.spec.configuration.templates`, cluster-level `chi.spec.configuration.clusters.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one replica" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one replica" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for replica-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - shardServiceTemplate: - type: string - description: "optional, fully ignores for replica-level" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one replica" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - shardsCount: - type: integer - description: "optional, count of shards related to current replica, you can override each shard behavior on low-level `chi.spec.configuration.clusters.layout.replicas.shards`" - minimum: 1 - shards: - type: array - description: "optional, list of shards related to current replica, will ignore if `chi.spec.configuration.clusters.layout.shards` presents" - # nullable: true - items: - # Host - type: object - properties: - name: - type: string - description: "optional, by default shard name is generated, but you can override it and setup custom name" - minLength: 1 - # See namePartReplicaMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - tcpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `tcp` for selected shard, override `chi.spec.templates.hostTemplates.spec.tcpPort` - allows connect to `clickhouse-server` via TCP Native protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - httpPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `http` for selected shard, override `chi.spec.templates.hostTemplates.spec.httpPort` - allows connect to `clickhouse-server` via HTTP protocol via kubernetes `Service` - minimum: 1 - maximum: 65535 - interserverHTTPPort: - type: integer - description: | - optional, setup `Pod.spec.containers.ports` with name `interserver` for selected shard, override `chi.spec.templates.hostTemplates.spec.interserverHTTPPort` - allows connect between replicas inside same shard during fetch replicated data parts HTTP protocol - minimum: 1 - maximum: 65535 - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in `Pod` only in one shard related to current replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - override top-level `chi.spec.configuration.settings`, cluster-level `chi.spec.configuration.clusters.settings` and replica-level `chi.spec.configuration.clusters.layout.replicas.settings` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - optional, allows define content of any setting file inside each `Pod` only in one shard related to current replica during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - override top-level `chi.spec.configuration.files` and cluster-level `chi.spec.configuration.clusters.files`, will ignore if `chi.spec.configuration.clusters.layout.shards` presents - # nullable: true - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: | - optional, configuration of the templates names which will use for generate Kubernetes resources according to selected replica - override top-level `chi.spec.configuration.templates`, cluster-level `chi.spec.configuration.clusters.templates`, replica-level `chi.spec.configuration.clusters.layout.replicas.templates` - # nullable: true - properties: - hostTemplate: - type: string - description: "optional, template name from chi.spec.templates.hostTemplates, which will apply to configure each `clickhouse-server` instance during render ConfigMap resources which will mount into `Pod` only for one shard" - podTemplate: - type: string - description: "optional, template name from chi.spec.templates.podTemplates, allows customization each `Pod` resource during render and reconcile each StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - dataVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse data directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - logVolumeClaimTemplate: - type: string - description: "optional, template name from chi.spec.templates.volumeClaimTemplates, allows customization each `PVC` which will mount for clickhouse log directory in each `Pod` during render and reconcile every StatefulSet.spec resource described in `chi.spec.configuration.clusters` only for one shard" - serviceTemplate: - type: string - description: "optional, fully ignores for shard-level" - clusterServiceTemplate: - type: string - description: "optional, fully ignores for shard-level" - shardServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - replicaServiceTemplate: - type: string - description: "optional, template name from chi.spec.templates.serviceTemplates, allows customization for each `Service` resource which will created by `clickhouse-operator` which cover each replica inside each shard inside clickhouse cluster described in `chi.spec.configuration.clusters` only for one shard" - volumeClaimTemplate: - type: string - description: "DEPRECATED! VolumeClaimTemplate is deprecated in favor of DataVolumeClaimTemplate and LogVolumeClaimTemplate" - templates: - type: object - description: "allows define templates which will use for render Kubernetes resources like StatefulSet, ConfigMap, Service, PVC, by default, clickhouse-operator have own templates, but you can override it" - # nullable: true - properties: - hostTemplates: - type: array - description: "hostTemplate will use during apply to generate `clickhose-server` config files" - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - description: "template name, could use to link inside top-level `chi.spec.defaults.templates.hostTemplate`, cluster-level `chi.spec.configuration.clusters.templates.hostTemplate`, shard-level `chi.spec.configuration.clusters.layout.shards.temlates.hostTemplate`, replica-level `chi.spec.configuration.clusters.layout.replicas.templates.hostTemplate`" - type: string - portDistribution: - type: array - description: "define how will distribute numeric values of named ports in `Pod.spec.containers.ports` and clickhouse-server configs" - # nullable: true - items: - type: object - #required: - # - type - properties: - type: - type: string - description: "type of distribution, when `Unspecified` (default value) then all listen ports on clickhouse-server configuration in all Pods will have the same value, when `ClusterScopeIndex` then ports will increment to offset from base value depends on shard and replica index inside cluster with combination of `chi.spec.templates.podTemlates.spec.HostNetwork` it allows setup ClickHouse cluster inside Kubernetes and provide access via external network bypass Kubernetes internal network" - enum: - # List PortDistributionXXX constants - - "" - - "Unspecified" - - "ClusterScopeIndex" - spec: - # Host - type: object - properties: - name: - type: string - description: "by default, hostname will generate, but this allows define custom name for each `clickhuse-server`" - minLength: 1 - # See namePartReplicaMaxLen const - maxLength: 15 - pattern: "^[a-zA-Z0-9-]{0,15}$" - tcpPort: - type: integer - description: | - optional, setup `tcp_port` inside `clickhouse-server` settings for each Pod where current template will apply - if specified, should have equal value with `chi.spec.templates.podTemplates.spec.containers.ports[name=tcp]` - More info: https://clickhouse.tech/docs/en/interfaces/tcp/ - minimum: 1 - maximum: 65535 - httpPort: - type: integer - description: | - optional, setup `http_port` inside `clickhouse-server` settings for each Pod where current template will apply - if specified, should have equal value with `chi.spec.templates.podTemplates.spec.containers.ports[name=http]` - More info: https://clickhouse.tech/docs/en/interfaces/http/ - minimum: 1 - maximum: 65535 - interserverHTTPPort: - type: integer - description: | - optional, setup `interserver_http_port` inside `clickhouse-server` settings for each Pod where current template will apply - if specified, should have equal value with `chi.spec.templates.podTemplates.spec.containers.ports[name=interserver]` - More info: https://clickhouse.tech/docs/en/operations/server-configuration-parameters/settings/#interserver-http-port - minimum: 1 - maximum: 65535 - settings: - type: object - description: | - optional, allows configure `clickhouse-server` settings inside ... tag in each `Pod` where this template will apply during generate `ConfigMap` which will mount in `/etc/clickhouse-server/conf.d/` - More details: https://clickhouse.tech/docs/en/operations/settings/settings/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - files: - type: object - description: | - optional, allows define content of any setting file inside each `Pod` where this template will apply during generate `ConfigMap` which will mount in `/etc/clickhouse-server/config.d/` or `/etc/clickhouse-server/conf.d/` or `/etc/clickhouse-server/users.d/` - # nullable: true - x-kubernetes-preserve-unknown-fields: true - templates: - type: object - description: "be carefull, this part of CRD allows override template inside template, don't use it if you don't understand what you do" - # nullable: true - properties: - hostTemplate: - type: string - podTemplate: - type: string - dataVolumeClaimTemplate: - type: string - logVolumeClaimTemplate: - type: string - serviceTemplate: - type: string - clusterServiceTemplate: - type: string - shardServiceTemplate: - type: string - replicaServiceTemplate: - type: string - - podTemplates: - type: array - description: | - podTemplate will use during render `Pod` inside `StatefulSet.spec` and allows define rendered `Pod.spec`, pod scheduling distribution and pod zone - More information: https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#spectemplatespodtemplates - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - type: string - description: "template name, could use to link inside top-level `chi.spec.defaults.templates.podTemplate`, cluster-level `chi.spec.configuration.clusters.templates.podTemplate`, shard-level `chi.spec.configuration.clusters.layout.shards.temlates.podTemplate`, replica-level `chi.spec.configuration.clusters.layout.replicas.templates.podTemplate`" - generateName: - type: string - description: "allows define format for generated `Pod` name, look to https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#spectemplatesservicetemplates for details about aviailable template variables" - zone: - type: object - description: "allows define custom zone name and will separate ClickHouse `Pods` between nodes, shortcut for `chi.spec.templates.podTemplates.spec.affinity.podAntiAffinity`" - #required: - # - values - properties: - key: - type: string - description: "optional, if defined, allows select kubernetes nodes by label with `name` equal `key`" - values: - type: array - description: "optional, if defined, allows select kubernetes nodes by label with `value` in `values`" - # nullable: true - items: - type: string - distribution: - type: string - description: "DEPRECATED, shortcut for `chi.spec.templates.podTemplates.spec.affinity.podAntiAffinity`" - enum: - - "" - - "Unspecified" - - "OnePerHost" - podDistribution: - type: array - description: "define ClickHouse Pod distibution policy between Kubernetes Nodes inside Shard, Replica, Namespace, CHI, another ClickHouse cluster" - # nullable: true - items: - type: object - #required: - # - type - properties: - type: - type: string - description: "you can define multiple affinity policy types" - enum: - # List PodDistributionXXX constants - - "" - - "Unspecified" - - "ClickHouseAntiAffinity" - - "ShardAntiAffinity" - - "ReplicaAntiAffinity" - - "AnotherNamespaceAntiAffinity" - - "AnotherClickHouseInstallationAntiAffinity" - - "AnotherClusterAntiAffinity" - - "MaxNumberPerNode" - - "NamespaceAffinity" - - "ClickHouseInstallationAffinity" - - "ClusterAffinity" - - "ShardAffinity" - - "ReplicaAffinity" - - "PreviousTailAffinity" - - "CircularReplication" - scope: - type: string - description: "scope for apply each podDistribution" - enum: - # list PodDistributionScopeXXX constants - - "" - - "Unspecified" - - "Shard" - - "Replica" - - "Cluster" - - "ClickHouseInstallation" - - "Namespace" - number: - type: integer - description: "define, how much ClickHouse Pods could be inside selected scope with selected distribution type" - minimum: 0 - maximum: 65535 - topologyKey: - type: string - description: "use for inter-pod affinity look to `pod.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey`, More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity" - spec: - # TODO specify PodSpec - type: object - description: "allows define whole Pod.spec inside StaefulSet.spec, look to https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates for details" - # nullable: true - x-kubernetes-preserve-unknown-fields: true - metadata: - type: object - description: | - allows pass standard object's metadata from template to Pod - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - # nullable: true - x-kubernetes-preserve-unknown-fields: true - - volumeClaimTemplates: - type: array - description: "allows define template for rendering `PVC` kubernetes resource, which would use inside `Pod` for mount clickhouse `data`, clickhouse `logs` or something else" - # nullable: true - items: - type: object - #required: - # - name - # - spec - properties: - name: - description: | - template name, could use to link inside - top-level `chi.spec.defaults.templates.dataVolumeClaimTemplate` or `chi.spec.defaults.templates.logVolumeClaimTemplate`, - cluster-level `chi.spec.configuration.clusters.templates.dataVolumeClaimTemplate` or `chi.spec.configuration.clusters.templates.logVolumeClaimTemplate`, - shard-level `chi.spec.configuration.clusters.layout.shards.temlates.dataVolumeClaimTemplate` or `chi.spec.configuration.clusters.layout.shards.temlates.logVolumeClaimTemplate` - replica-level `chi.spec.configuration.clusters.layout.replicas.templates.dataVolumeClaimTemplate` or `chi.spec.configuration.clusters.layout.replicas.templates.logVolumeClaimTemplate` - type: string - reclaimPolicy: - type: string - description: "define behavior of `PVC` deletion policy during delete `Pod`, `Delete` by default, when `Retain` then `PVC` still alive even `Pod` will deleted" - enum: - - "" - - "Retain" - - "Delete" - metadata: - type: object - description: | - allows pass standard object's metadata from template to PVC - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - # nullable: true - x-kubernetes-preserve-unknown-fields: true - spec: - type: object - description: | - allows define all aspects of `PVC` resource - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims - # nullable: true - x-kubernetes-preserve-unknown-fields: true - serviceTemplates: - type: array - description: | - allows define template for rendering `Service` which would get endpoint from Pods which scoped chi-wide, cluster-wide, shard-wide, replica-wide level - # nullable: true - items: - type: object - #required: - # - name - # - spec - properties: - name: - type: string - description: | - template name, could use to link inside - chi-level `chi.spec.defaults.templates.serviceTemplate` - cluster-level `chi.spec.configuration.clusters.templates.clusterServiceTemplate` - shard-level `chi.spec.configuration.clusters.layout.shards.temlates.shardServiceTemplate` - replica-level `chi.spec.configuration.clusters.layout.replicas.templates.replicaServiceTemplate` or `chi.spec.configuration.clusters.layout.shards.replicas.replicaServiceTemplate` - generateName: - type: string - description: "allows define format for generated `Service` name, look to https://github.com/Altinity/clickhouse-operator/blob/master/docs/custom_resource_explained.md#spectemplatesservicetemplates for details about aviailable template variables" - metadata: - # TODO specify ObjectMeta - type: object - description: | - allows pass standard object's metadata from template to Service - Could be use for define specificly for Cloud Provider metadata which impact to behavior of service - More info: https://kubernetes.io/docs/concepts/services-networking/service/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - spec: - # TODO specify ServiceSpec - type: object - description: | - describe behavior of generated Service - More info: https://kubernetes.io/docs/concepts/services-networking/service/ - # nullable: true - x-kubernetes-preserve-unknown-fields: true - useTemplates: - type: array - description: "list of `ClickHouseInstallationTemplate` (chit) resource names which will merge with current `Chi` manifest during render Kubernetes resources to create related ClickHouse clusters" - # nullable: true - items: - type: object - #required: - # - name - properties: - name: - type: string - description: "name of `ClickHouseInstallationTemplate` (chit) resource" - namespace: - type: string - description: "Kubernetes namespace where need search `chit` resource, depending on `watchNamespaces` settings in `clichouse-operator`" - useType: - type: string - description: "optional, current strategy is only merge, and current `chi` settings have more priority than merged template `chit`" - enum: - # List useTypeXXX constants from model - - "" - - "merge" diff --git a/appops/clickhouse-operator/crd/clickhouseoperatorconfigurations.yaml b/appops/clickhouse-operator/crd/clickhouseoperatorconfigurations.yaml deleted file mode 100644 index 8fc32e3d..00000000 --- a/appops/clickhouse-operator/crd/clickhouseoperatorconfigurations.yaml +++ /dev/null @@ -1,295 +0,0 @@ -# Template Parameters: -# -# NONE -# -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: clickhouseoperatorconfigurations.clickhouse.altinity.com - labels: - clickhouse.altinity.com/chop: 0.19.2 -spec: - group: clickhouse.altinity.com - scope: Namespaced - names: - kind: ClickHouseOperatorConfiguration - singular: clickhouseoperatorconfiguration - plural: clickhouseoperatorconfigurations - shortNames: - - chopconf - versions: - - name: v1 - served: true - storage: true - additionalPrinterColumns: - - name: namespaces - type: string - description: Watch namespaces - priority: 0 # show in standard view - jsonPath: .status - - name: age - type: date - description: Age of the resource - # Displayed in all priorities - jsonPath: .metadata.creationTimestamp - schema: - openAPIV3Schema: - type: object - description: "allows customize `clickhouse-operator` settings, need restart clickhouse-operator pod after adding, more details https://github.com/Altinity/clickhouse-operator/blob/master/docs/operator_configuration.md" - x-kubernetes-preserve-unknown-fields: true - properties: - status: - type: object - x-kubernetes-preserve-unknown-fields: true - spec: - type: object - description: | - Allows to define settings of the clickhouse-operator. - More info: https://github.com/Altinity/clickhouse-operator/blob/master/config/config.yaml - Check into etc-clickhouse-operator* ConfigMaps if you need more control - x-kubernetes-preserve-unknown-fields: true - properties: - watch: - type: object - properties: - namespaces: - type: array - description: "List of namespaces where clickhouse-operator watches for events." - items: - type: string - clickhouse: - type: object - properties: - configuration: - type: object - properties: - file: - type: object - properties: - path: - type: object - properties: - common: - type: string - description: "Path to the folder where ClickHouse configuration files common for all instances within a CHI are located. Default - config.d" - host: - type: string - description: "Path to the folder where ClickHouse configuration files unique for each instance (host) within a CHI are located. Default - conf.d" - user: - type: string - description: "Path to the folder where ClickHouse configuration files with users settings are located. Files are common for all instances within a CHI." - user: - type: object - properties: - default: - type: object - properties: - profile: - type: string - description: "ClickHouse server configuration `...` for any " - quota: - type: string - description: "ClickHouse server configuration `...` for any " - networksIP: - type: array - description: "ClickHouse server configuration `...` for any " - items: - type: string - password: - type: string - description: "ClickHouse server configuration `...` for any " - network: - type: object - properties: - hostRegexpTemplate: - type: string - description: "ClickHouse server configuration `...` for any " - access: - type: object - properties: - scheme: - type: string - description: "The scheme to user for connecting to ClickHouse. One of http or https" - username: - type: string - description: "ClickHouse username to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName" - password: - type: string - description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName" - rootCA: - type: string - description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse" - secret: - type: object - properties: - namespace: - type: string - description: "Location of k8s Secret with username and password to be used by operator to connect to ClickHouse instances" - name: - type: string - description: "Name of k8s Secret with username and password to be used by operator to connect to ClickHouse instances" - port: - type: integer - minimum: 1 - maximum: 65535 - description: "port to be used by operator to connect to ClickHouse instances" - template: - type: object - properties: - chi: - type: object - properties: - path: - type: string - description: "Path to folder where ClickHouseInstallationTemplate .yaml manifests are located." - reconcile: - type: object - properties: - runtime: - type: object - properties: - threadsNumber: - type: integer - minimum: 1 - maximum: 65535 - description: "How many goroutines will be used to reconcile in parallel, 10 by default" - statefulSet: - type: object - properties: - create: - type: object - properties: - onFailure: - type: string - description: | - What to do in case created StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds - Possible options: - 1. abort - do nothing, just break the process and wait for admin. - 2. delete - delete newly created problematic StatefulSet. - 3. ignore (default) - ignore error, pretend nothing happened and move on to the next StatefulSet. - update: - type: object - properties: - timeout: - type: integer - description: "How many seconds to wait for created/updated StatefulSet to be Ready" - pollInterval: - type: integer - description: "How many seconds to wait between checks for created/updated StatefulSet status" - onFailure: - type: string - description: | - What to do in case updated StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds - Possible options: - 1. abort - do nothing, just break the process and wait for admin. - 2. rollback (default) - delete Pod and rollback StatefulSet to previous Generation. Pod would be recreated by StatefulSet based on rollback-ed configuration. - 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet. - host: - type: object - properties: - wait: - type: object - properties: - exclude: - type: boolean - include: - type: boolean - annotation: - type: object - properties: - include: - type: array - items: - type: string - exclude: - type: array - items: - type: string - label: - type: object - properties: - include: - type: array - items: - type: string - exclude: - type: array - items: - type: string - description: | - When propagating labels from the chi's `metadata.labels` section to child objects' `metadata.labels`, - exclude labels from the following list - appendScope: - type: string - description: | - Whether to append *Scope* labels to StatefulSet and Pod - - "LabelShardScopeIndex" - - "LabelReplicaScopeIndex" - - "LabelCHIScopeIndex" - - "LabelCHIScopeCycleSize" - - "LabelCHIScopeCycleIndex" - - "LabelCHIScopeCycleOffset" - - "LabelClusterScopeIndex" - - "LabelClusterScopeCycleSize" - - "LabelClusterScopeCycleIndex" - - "LabelClusterScopeCycleOffset" - enum: - # List StringBoolXXX constants from model - - "" - - "0" - - "1" - - "False" - - "false" - - "True" - - "true" - - "No" - - "no" - - "Yes" - - "yes" - - "Off" - - "off" - - "On" - - "on" - - "Disable" - - "disable" - - "Enable" - - "enable" - - "Disabled" - - "disabled" - - "Enabled" - - "enabled" - statefulSet: - type: object - properties: - revisionHistoryLimit: - type: integer - pod: - type: object - properties: - terminationGracePeriod: - type: integer - logger: - type: object - properties: - logtostderr: - type: string - description: "boolean, allows logs to stderr" - alsologtostderr: - type: string - description: "boolean allows logs to stderr and files both" - v: - type: string - description: "verbosity level of clickhouse-operator log, default - 1 max - 9" - stderrthreshold: - type: string - vmodule: - type: string - description: | - Comma-separated list of filename=N, where filename (can be a pattern) must have no .go ext, and N is a V level. - Ex.: file*=2 sets the 'V' to 2 in all files with names like file*. - log_backtrace_at: - type: string - description: | - It can be set to a file and line number with a logging line. - Ex.: file.go:123 - Each time when this line is being executed, a stack trace will be written to the Info log. diff --git a/appops/clickhouse-operator/prod/ci-test/settings.yaml b/appops/clickhouse-operator/prod/ci-test/settings.yaml deleted file mode 100644 index a1d83a13..00000000 --- a/appops/clickhouse-operator/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - # - key: __konfig_output_format__ - # value: raw \ No newline at end of file diff --git a/appops/clickhouse-operator/prod/ci-test/stdout.golden.yaml b/appops/clickhouse-operator/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 34580ee7..00000000 --- a/appops/clickhouse-operator/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,869 +0,0 @@ -id: apps/v1:Deployment:clickhouse-operator:clickhouse-operatorprod -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-confd-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-configd-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-templatesd-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-usersd-files -- v1:Service:clickhouse-operator:clickhouse-operator-metrics -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: clickhouse-operatorprod - namespace: clickhouse-operator - spec: - replicas: 1 - selector: - matchLabels: - app: clickhouse-operator - template: - metadata: - annotations: - prometheus.io/port: '8888' - prometheus.io/scrape: 'true' - labels: - app: clickhouse-operator - spec: - containers: - - env: - - name: OPERATOR_POD_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: OPERATOR_POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: OPERATOR_POD_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: OPERATOR_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: OPERATOR_POD_SERVICE_ACCOUNT - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.serviceAccountName - - name: OPERATOR_CONTAINER_CPU_REQUEST - valueFrom: - resourceFieldRef: - containerName: clickhouse-operator - divisor: '1' - resource: requests.cpu - - name: OPERATOR_CONTAINER_CPU_LIMIT - valueFrom: - resourceFieldRef: - containerName: clickhouse-operator - divisor: '1' - resource: limits.cpu - - name: OPERATOR_CONTAINER_MEM_REQUEST - valueFrom: - resourceFieldRef: - containerName: clickhouse-operator - divisor: '1' - resource: requests.memory - - name: OPERATOR_CONTAINER_MEM_LIMIT - valueFrom: - resourceFieldRef: - containerName: clickhouse-operator - divisor: '1' - resource: limits.memory - image: altinity/clickhouse-operator:0.19.2 - name: clickhouse-operator - volumeMounts: - - mountPath: /etc/clickhouse-operator - name: etc-clickhouse-operator-folder - - mountPath: /etc/clickhouse-operator/conf.d - name: etc-clickhouse-operator-confd-folder - - mountPath: /etc/clickhouse-operator/config.d - name: etc-clickhouse-operator-configd-folder - - mountPath: /etc/clickhouse-operator/templates.d - name: etc-clickhouse-operator-templatesd-folder - - mountPath: /etc/clickhouse-operator/users.d - name: etc-clickhouse-operator-usersd-folder - - image: altinity/metrics-exporter:0.19.2 - name: metrics-exporter - volumeMounts: - - mountPath: /etc/clickhouse-operator - name: etc-clickhouse-operator-folder - - mountPath: /etc/clickhouse-operator/conf.d - name: etc-clickhouse-operator-confd-folder - - mountPath: /etc/clickhouse-operator/config.d - name: etc-clickhouse-operator-configd-folder - - mountPath: /etc/clickhouse-operator/templates.d - name: etc-clickhouse-operator-templatesd-folder - - mountPath: /etc/clickhouse-operator/users.d - name: etc-clickhouse-operator-usersd-folder - serviceAccountName: clickhouse-operator - volumes: - - name: etc-clickhouse-operator-folder - configMap: - name: etc-clickhouse-operator-files - - name: etc-clickhouse-operator-confd-folder - configMap: - name: etc-clickhouse-operator-confd-files - - name: etc-clickhouse-operator-configd-folder - configMap: - name: etc-clickhouse-operator-configd-files - - name: etc-clickhouse-operator-templatesd-folder - configMap: - name: etc-clickhouse-operator-templatesd-files - - name: etc-clickhouse-operator-usersd-folder - configMap: - name: etc-clickhouse-operator-usersd-files ---- -id: v1:Namespace:clickhouse-operator -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: clickhouse-operator ---- -id: v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-files -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -attributes: - apiVersion: v1 - data: - config.yaml: | - # IMPORTANT - # This file is auto-generated - # Do not edit this file - all changes would be lost - # Edit appropriate template in the following folder: - # deploy/builder/templates-config - # IMPORTANT - # - # Template parameters available: - # watchNamespaces - # chUsername - # chPassword - # password_sha256_hex - - ################################################ - ## - ## Watch Section - ## - ################################################ - watch: - # List of namespaces where clickhouse-operator watches for events. - # Concurrently running operators should watch on different namespaces - #namespaces: ["dev", "test"] - namespaces: [] - - clickhouse: - configuration: - ################################################ - ## - ## Configuration Files Section - ## - ################################################ - file: - path: - # Path to the folder where ClickHouse configuration files common for all instances within a CHI are located. - common: config.d - # Path to the folder where ClickHouse configuration files unique for each instance (host) within a CHI are located. - host: conf.d - # Path to the folder where ClickHouse configuration files with users settings are located. - # Files are common for all instances within a CHI. - user: users.d - ################################################ - ## - ## Configuration Users Section - ## - ################################################ - user: - default: - # Default values for ClickHouse user configuration - # 1. user/profile - string - # 2. user/quota - string - # 3. user/networks/ip - multiple strings - # 4. user/password - string - profile: default - quota: default - networksIP: - - "::1" - - "127.0.0.1" - password: "default" - ################################################ - ## - ## Configuration Network Section - ## - ################################################ - network: - # Default host_regexp to limit network connectivity from outside - hostRegexpTemplate: "(chi-{chi}-[^.]+\d+-\d+|clickhouse\-{chi})\.{namespace}\.svc\.cluster\.local$" - ################################################ - ## - ## Access to ClickHouse instances - ## - ################################################ - access: - # ClickHouse credentials (username, password and port) to be used by operator to connect to ClickHouse instances - # for: - # 1. Metrics requests - # 2. Schema maintenance - # 3. DROP DNS CACHE - # User with such credentials can be specified in additional ClickHouse .xml config files, - # located in `chUsersConfigsPath` folder - username: "clickhouse_operator" - password: "clickhouse_operator_password" - secret: - # Location of k8s Secret with username and password to be used by operator to connect to ClickHouse instances - # Can be used instead of explicitly specified username and password - namespace: "" - name: "" - # Port where to connect to ClickHouse instances to - port: 8123 - - ################################################ - ## - ## Templates Section - ## - ################################################ - template: - chi: - # Path to the folder where ClickHouseInstallation .yaml manifests are located. - # Manifests are applied in sorted alpha-numeric order. - path: templates.d - - ################################################ - ## - ## Reconcile Section - ## - ################################################ - reconcile: - runtime: - # Max number of concurrent reconciles in progress - threadsNumber: 10 - - statefulSet: - create: - # What to do in case created StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds - # Possible options: - # 1. abort - do nothing, just break the process and wait for admin - # 2. delete - delete newly created problematic StatefulSet - # 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet - onFailure: ignore - - update: - # How many seconds to wait for created/updated StatefulSet to be Ready - timeout: 300 - # How many seconds to wait between checks for created/updated StatefulSet status - pollInterval: 5 - # What to do in case updated StatefulSet is not in Ready after `statefulSetUpdateTimeout` seconds - # Possible options: - # 1. abort - do nothing, just break the process and wait for admin - # 2. rollback - delete Pod and rollback StatefulSet to previous Generation. - # Pod would be recreated by StatefulSet based on rollback-ed configuration - # 3. ignore - ignore error, pretend nothing happened and move on to the next StatefulSet - onFailure: rollback - - host: - # Whether reconciler should wait for host: - # to be excluded from cluster OR - # to be included into cluster - # respectfully - wait: - exclude: true - include: false - - ################################################ - ## - ## Annotations management - ## - ################################################ - annotation: - # Applied when: - # 1. Propagating annotations from the CHI's `metadata.annotations` to child objects' `metadata.annotations`, - # 2. Propagating annotations from the CHI Template's `metadata.annotations` to CHI's `metadata.annotations`, - # Include annotations from the following list: - # Applied only when not empty. Empty list means "include all, no selection" - include: [] - # Exclude annotations from the following list: - exclude: [] - - ################################################ - ## - ## Labels management - ## - ################################################ - label: - # Applied when: - # 1. Propagating labels from the CHI's `metadata.labels` to child objects' `metadata.labels`, - # 2. Propagating labels from the CHI Template's `metadata.labels` to CHI's `metadata.labels`, - # Include labels from the following list: - # Applied only when not empty. Empty list means "include all, no selection" - include: [] - # Exclude labels from the following list: - exclude: [] - # Whether to append *Scope* labels to StatefulSet and Pod. - # Full list of available *scope* labels check in labeler.go - # LabelShardScopeIndex - # LabelReplicaScopeIndex - # LabelCHIScopeIndex - # LabelCHIScopeCycleSize - # LabelCHIScopeCycleIndex - # LabelCHIScopeCycleOffset - # LabelClusterScopeIndex - # LabelClusterScopeCycleSize - # LabelClusterScopeCycleIndex - # LabelClusterScopeCycleOffset - appendScope: "no" - - ################################################ - ## - ## StatefulSet management - ## - ################################################ - statefulSet: - revisionHistoryLimit: 0 - - ################################################ - ## - ## Pod management - ## - ################################################ - pod: - # Grace period for Pod termination. - # How many seconds to wait between sending - # SIGTERM and SIGKILL during Pod termination process. - # Increase this number is case of slow shutdown. - terminationGracePeriod: 30 - - ################################################ - ## - ## Log parameters - ## - ################################################ - logger: - logtostderr: "true" - alsologtostderr: "false" - v: "1" - stderrthreshold: "" - vmodule: "" - log_backtrace_at: "" - kind: ConfigMap - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: etc-clickhouse-operator-files - namespace: clickhouse-operator ---- -id: v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-confd-files -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -attributes: - apiVersion: v1 - kind: ConfigMap - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: etc-clickhouse-operator-confd-files - namespace: clickhouse-operator ---- -id: v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-configd-files -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -attributes: - apiVersion: v1 - data: - 01-clickhouse-01-listen.xml: | - - - - - - - - - :: - 0.0.0.0 - 1 - - 01-clickhouse-02-logger.xml: | - - - - - - - - - - debug - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log - 1000M - 10 - - 1 - - - 01-clickhouse-03-query_log.xml: | - - - - - - - - - system - query_log
- Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day - 7500 -
- -
- 01-clickhouse-04-part_log.xml: | - - - - - - - - - system - part_log
- Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day - 7500 -
-
- kind: ConfigMap - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: etc-clickhouse-operator-configd-files - namespace: clickhouse-operator ---- -id: v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-templatesd-files -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -attributes: - apiVersion: v1 - data: - 001-templates.json.example: | - { - "apiVersion": "clickhouse.altinity.com/v1", - "kind": "ClickHouseInstallationTemplate", - "metadata": { - "name": "01-default-volumeclaimtemplate" - }, - "spec": { - "templates": { - "volumeClaimTemplates": [ - { - "name": "chi-default-volume-claim-template", - "spec": { - "accessModes": [ - "ReadWriteOnce" - ], - "resources": { - "requests": { - "storage": "2Gi" - } - } - } - } - ], - "podTemplates": [ - { - "name": "chi-default-oneperhost-pod-template", - "distribution": "OnePerHost", - "spec": { - "containers" : [ - { - "name": "clickhouse", - "image": "clickhouse/clickhouse-server:22.3", - "ports": [ - { - "name": "http", - "containerPort": 8123 - }, - { - "name": "client", - "containerPort": 9000 - }, - { - "name": "interserver", - "containerPort": 9009 - } - ] - } - ] - } - } - ] - } - } - } - default-pod-template.yaml.example: | - apiVersion: "clickhouse.altinity.com/v1" - kind: "ClickHouseInstallationTemplate" - metadata: - name: "default-oneperhost-pod-template" - spec: - templates: - podTemplates: - - name: default-oneperhost-pod-template - distribution: "OnePerHost" - default-storage-template.yaml.example: | - apiVersion: "clickhouse.altinity.com/v1" - kind: "ClickHouseInstallationTemplate" - metadata: - name: "default-storage-template-2Gi" - spec: - templates: - volumeClaimTemplates: - - name: default-storage-template-2Gi - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - readme: | - Templates in this folder are packaged with an operator and available via 'useTemplate' - kind: ConfigMap - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: etc-clickhouse-operator-templatesd-files - namespace: clickhouse-operator ---- -id: v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-usersd-files -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -attributes: - apiVersion: v1 - data: - 01-clickhouse-user.xml: | - - - - - - - - - - - 127.0.0.1 - - 716b36073a90c6fe1d445ac1af85f4777c5b7a155cea359961826a030513e448 - clickhouse_operator - default - - - - - 0 - 1 - 10 - - - - 02-clickhouse-default-profile.xml: | - - - - - - - - - - 1 - 1000 - 1 - 1 - - - - 03-database-ordinary.xml: | - - - - - - - - - - - Ordinary - - - - kind: ConfigMap - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: etc-clickhouse-operator-usersd-files - namespace: clickhouse-operator ---- -id: v1:Service:clickhouse-operator:clickhouse-operator-metrics -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -- v1:ServiceAccount:clickhouse-operator:clickhouse-operator -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-confd-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-configd-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-templatesd-files -- v1:ConfigMap:clickhouse-operator:etc-clickhouse-operator-usersd-files -attributes: - apiVersion: v1 - kind: Service - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - app: clickhouse-operator - name: clickhouse-operator-metrics - namespace: clickhouse-operator - spec: - ports: - - name: clickhouse-operator-metrics - port: 8888 - selector: - app: clickhouse-operator ---- -id: v1:ServiceAccount:clickhouse-operator:clickhouse-operator -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -- v1:Namespace:clickhouse-operator -attributes: - apiVersion: v1 - kind: ServiceAccount - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - name: clickhouse-operator - namespace: clickhouse-operator ---- -id: rbac.authorization.k8s.io/v1:ClusterRoleBinding:clickhouse-operator-kube-system -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -attributes: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - subjects: - - kind: ServiceAccount - name: clickhouse-operator - namespace: kube-system - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - name: clickhouse-operator-kube-system - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: clickhouse-operator-kube-system ---- -id: rbac.authorization.k8s.io/v1:ClusterRole:clickhouse-operator-kube-system -type: Kubernetes -attributes: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - rules: - - apiGroups: - - '' - resources: - - configmaps - - services - verbs: - - get - - list - - patch - - update - - watch - - create - - delete - - apiGroups: - - '' - resources: - - endpoints - verbs: - - get - - list - - watch - - apiGroups: - - '' - resources: - - events - verbs: - - create - - apiGroups: - - '' - resources: - - persistentvolumeclaims - verbs: - - get - - list - - patch - - update - - watch - - delete - - apiGroups: - - '' - resources: - - persistentvolumes - - pods - verbs: - - get - - list - - patch - - update - - watch - - apiGroups: - - apps - resources: - - statefulsets - verbs: - - get - - list - - patch - - update - - watch - - create - - delete - - apiGroups: - - apps - resources: - - replicasets - verbs: - - get - - patch - - update - - delete - - apiGroups: - - apps - resourceNames: - - clickhouse-operator - resources: - - deployments - verbs: - - get - - patch - - update - - delete - - apiGroups: - - policy - resources: - - poddisruptionbudgets - verbs: - - get - - list - - patch - - update - - watch - - create - - delete - - apiGroups: - - clickhouse.altinity.com - resources: - - clickhouseinstallations - verbs: - - get - - patch - - update - - delete - - apiGroups: - - clickhouse.altinity.com - resources: - - clickhouseinstallations - - clickhouseinstallationtemplates - - clickhouseoperatorconfigurations - verbs: - - get - - list - - watch - - apiGroups: - - clickhouse.altinity.com - resources: - - clickhouseinstallations/finalizers - - clickhouseinstallationtemplates/finalizers - - clickhouseoperatorconfigurations/finalizers - verbs: - - update - - apiGroups: - - clickhouse.altinity.com - resources: - - clickhouseinstallations/status - - clickhouseinstallationtemplates/status - - clickhouseoperatorconfigurations/status - verbs: - - get - - update - - patch - - create - - delete - - apiGroups: - - '' - resources: - - secrets - verbs: - - get - - list - - apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - - get - - list - metadata: - labels: - clickhouse.altinity.com/chop: 0.19.2 - name: clickhouse-operator-kube-system diff --git a/appops/clickhouse-operator/prod/kcl.yaml b/appops/clickhouse-operator/prod/kcl.yaml deleted file mode 100644 index f044556f..00000000 --- a/appops/clickhouse-operator/prod/kcl.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - ../base/rbac.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/appops/clickhouse-operator/prod/main.k b/appops/clickhouse-operator/prod/main.k deleted file mode 100644 index 9d16dda1..00000000 --- a/appops/clickhouse-operator/prod/main.k +++ /dev/null @@ -1,17 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - # spec.template.spec.containers[0], main container - image = "altinity/clickhouse-operator:0.19.2" - - # spec.template.spec.containers[1:], sidecars - sidecarContainers = [ - s.Sidecar { - name = "metrics-exporter" - image = "altinity/metrics-exporter:0.19.2" - resource = "" - } - ] -} diff --git a/appops/clickhouse-operator/project.yaml b/appops/clickhouse-operator/project.yaml deleted file mode 100644 index 1dc7b709..00000000 --- a/appops/clickhouse-operator/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: clickhouse-operator -tenant: howieyuen diff --git a/appops/guestbook-frontend/OWNERS b/appops/guestbook-frontend/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/appops/guestbook-frontend/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/appops/guestbook-frontend/README.md b/appops/guestbook-frontend/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/appops/guestbook-frontend/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/appops/guestbook-frontend/base/base.k b/appops/guestbook-frontend/base/base.k deleted file mode 100644 index fdc69b75..00000000 --- a/appops/guestbook-frontend/base/base.k +++ /dev/null @@ -1,25 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main { - name = "php-redis" - env = [ - { - name = "GET_HOSTS_FROM" - value = "dns" - } - ] - ports = [{containerPort = 80}] - } - selector = { - "tier" = "frontend" - } - podMetadata.labels: { - "tier" = "frontend" - } - schedulingStrategy.resource = res_tpl.medium -} diff --git a/appops/guestbook-frontend/pre/ci-test/settings.yaml b/appops/guestbook-frontend/pre/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/appops/guestbook-frontend/pre/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/appops/guestbook-frontend/pre/ci-test/stdout.golden.yaml b/appops/guestbook-frontend/pre/ci-test/stdout.golden.yaml deleted file mode 100644 index 0f1d556b..00000000 --- a/appops/guestbook-frontend/pre/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,54 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: guestbook-frontendpre - namespace: guestbook-frontend - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: pre - app.kubernetes.io/instance: guestbook-frontend-pre - app.kubernetes.io/name: guestbook-frontend - cluster.x-k8s.io/cluster-name: demo-cluster-name - tier: frontend - template: - metadata: - labels: - app.kubernetes.io/env: pre - app.kubernetes.io/instance: guestbook-frontend-pre - app.kubernetes.io/name: guestbook-frontend - cluster.x-k8s.io/cluster-name: demo-cluster-name - tier: frontend - spec: - containers: - - env: - - name: GET_HOSTS_FROM - value: dns - image: gcr.io/google-samples/gb-frontend:v4-pre - name: php-redis - ports: - - containerPort: 80 - protocol: TCP - resources: - limits: - cpu: '2' - memory: 4Gi - ephemeral-storage: 35Gi - requests: - cpu: '2' - memory: 4Gi - ephemeral-storage: 35Gi -dependsOn: -- v1:Namespace:guestbook-frontend -id: apps/v1:Deployment:guestbook-frontend:guestbook-frontendpre -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: guestbook-frontend -id: v1:Namespace:guestbook-frontend -type: Kubernetes diff --git a/appops/guestbook-frontend/pre/kcl.yaml b/appops/guestbook-frontend/pre/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/appops/guestbook-frontend/pre/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/appops/guestbook-frontend/pre/main.k b/appops/guestbook-frontend/pre/main.k deleted file mode 100644 index 08aeabe2..00000000 --- a/appops/guestbook-frontend/pre/main.k +++ /dev/null @@ -1,7 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - image = "gcr.io/google-samples/gb-frontend:v4-pre" -} diff --git a/appops/guestbook-frontend/prod/ci-test/settings.yaml b/appops/guestbook-frontend/prod/ci-test/settings.yaml deleted file mode 100644 index c69f3b7d..00000000 --- a/appops/guestbook-frontend/prod/ci-test/settings.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name - - key: __konfig_output_format__ - value: raw \ No newline at end of file diff --git a/appops/guestbook-frontend/prod/ci-test/stdout.golden.yaml b/appops/guestbook-frontend/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 45175369..00000000 --- a/appops/guestbook-frontend/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: guestbook-frontendprod - namespace: guestbook-frontend -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: guestbook-frontend-prod - app.kubernetes.io/name: guestbook-frontend - cluster.x-k8s.io/cluster-name: demo-cluster-name - tier: frontend - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: guestbook-frontend-prod - app.kubernetes.io/name: guestbook-frontend - cluster.x-k8s.io/cluster-name: demo-cluster-name - tier: frontend - spec: - containers: - - env: - - name: GET_HOSTS_FROM - value: dns - image: gcr.io/google-samples/gb-frontend:v5 - name: php-redis - ports: - - containerPort: 80 - protocol: TCP - resources: - limits: - cpu: '2' - memory: 4Gi - ephemeral-storage: 35Gi - requests: - cpu: '2' - memory: 4Gi - ephemeral-storage: 35Gi ---- -apiVersion: v1 -kind: Namespace -metadata: - name: guestbook-frontend diff --git a/appops/guestbook-frontend/prod/kcl.yaml b/appops/guestbook-frontend/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/appops/guestbook-frontend/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/appops/guestbook-frontend/prod/main.k b/appops/guestbook-frontend/prod/main.k deleted file mode 100644 index 69a60eab..00000000 --- a/appops/guestbook-frontend/prod/main.k +++ /dev/null @@ -1,7 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - image = "gcr.io/google-samples/gb-frontend:v5" -} diff --git a/appops/guestbook-frontend/project.yaml b/appops/guestbook-frontend/project.yaml deleted file mode 100644 index 5d29a2fe..00000000 --- a/appops/guestbook-frontend/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: guestbook-frontend -tenant: howieyuen diff --git a/appops/guestbook-frontend/test/ci-test/settings.yaml b/appops/guestbook-frontend/test/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/appops/guestbook-frontend/test/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/appops/guestbook-frontend/test/ci-test/stdout.golden.yaml b/appops/guestbook-frontend/test/ci-test/stdout.golden.yaml deleted file mode 100644 index e95ad70c..00000000 --- a/appops/guestbook-frontend/test/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,54 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: guestbook-frontendtest - namespace: guestbook-frontend - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: test - app.kubernetes.io/instance: guestbook-frontend-test - app.kubernetes.io/name: guestbook-frontend - cluster.x-k8s.io/cluster-name: demo-cluster-name - tier: frontend - template: - metadata: - labels: - app.kubernetes.io/env: test - app.kubernetes.io/instance: guestbook-frontend-test - app.kubernetes.io/name: guestbook-frontend - cluster.x-k8s.io/cluster-name: demo-cluster-name - tier: frontend - spec: - containers: - - env: - - name: GET_HOSTS_FROM - value: dns - image: gcr.io/google-samples/gb-frontend:v4-test - name: php-redis - ports: - - containerPort: 80 - protocol: TCP - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:guestbook-frontend -id: apps/v1:Deployment:guestbook-frontend:guestbook-frontendtest -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: guestbook-frontend -id: v1:Namespace:guestbook-frontend -type: Kubernetes diff --git a/appops/guestbook-frontend/test/kcl.yaml b/appops/guestbook-frontend/test/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/appops/guestbook-frontend/test/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/appops/guestbook-frontend/test/main.k b/appops/guestbook-frontend/test/main.k deleted file mode 100644 index 838bd482..00000000 --- a/appops/guestbook-frontend/test/main.k +++ /dev/null @@ -1,9 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - image = "gcr.io/google-samples/gb-frontend:v4-test" - schedulingStrategy.resource = res_tpl.tiny -} diff --git a/appops/guestbook-frontend/test/stack.yaml b/appops/guestbook-frontend/test/stack.yaml deleted file mode 100644 index 5f4f18b7..00000000 --- a/appops/guestbook-frontend/test/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: test diff --git a/appops/http-echo/README.md b/appops/http-echo/README.md deleted file mode 100644 index 9469bf88..00000000 --- a/appops/http-echo/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -```bash -$ cd dev -$ kusion apply -SUCCESS Compiling in stack dev... - -Stack: dev Provider Type Name Plan - * ├─ kubernetes v1:Namespace http-echo Create - * ├─ kubernetes apps/v1:Deployment http-echodev Create - * ├─ kubernetes v1:Service apple-service Create - * └─ kubernetes networking.k8s.io/v1:Ingress example-ingress Create - -✔ yes -Start applying diffs...... -SUCCESS Creating Namespace/http-echo -SUCCESS Creating Deployment/http-echodev -SUCCESS Creating Service/apple-service -SUCCESS Creating Ingress/example-ingress - -Creating Ingress/example-ingress [4/4] ████████████████████████████████ 100% | 0s - -$ minikube service apple-service -n http-echo --url -http://192.168.99.102:30206 - -$ curl http://192.168.99.102:30206/apple -apple - -$ kusion destroy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│ ├── base.k // 应用的环境通用配置 -├── prod // 环境目录 -│ └── ci-test // ci 测试目录,放置测试脚本和数据 -│ └── settings.yaml // 测试数据和编译文件配置 -│ └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│ └── kcl.yaml // 当前 Stack 的多文件编译配置 -│ └── main.k // 应用在当前环境的配置清单 -│ └── stack.yaml // Stack 元信息 -└── project.yaml // Project 元信息 -└── README.md // 说明文档 -``` diff --git a/appops/http-echo/base/base.k b/appops/http-echo/base/base.k deleted file mode 100644 index 49e1de80..00000000 --- a/appops/http-echo/base/base.k +++ /dev/null @@ -1,42 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl -import base.pkg.kusion_models.kube.frontend.service -import base.pkg.kusion_models.kube.frontend.ingress - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main { - name = "apple-app" - args = ["-text=apple"] - } - image = "hashicorp/http-echo" - schedulingStrategy.resource = res_tpl.medium - services = [ - service.Service { - name = "apple-service" - type = "NodePort" - ports = [{port = 5678}] - } - ] - ingresses = [ - ingress.Ingress { - name = "example-ingress" - rules = [ - { - http.paths = [ - { - path = "/apple" - pathType = "Prefix" - backend.service = { - name = "app-service" - port = {number = 5678} - } - } - ] - } - ] - } - ] -} diff --git a/appops/http-echo/dev/ci-test/settings.yaml b/appops/http-echo/dev/ci-test/settings.yaml deleted file mode 100644 index c3c9d406..00000000 --- a/appops/http-echo/dev/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: default diff --git a/appops/http-echo/dev/ci-test/stdout.golden.yaml b/appops/http-echo/dev/ci-test/stdout.golden.yaml deleted file mode 100644 index 0e9bc038..00000000 --- a/appops/http-echo/dev/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,93 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: http-echodev - namespace: http-echo - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: http-echo-dev - app.kubernetes.io/name: http-echo - cluster.x-k8s.io/cluster-name: default - template: - metadata: - labels: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: http-echo-dev - app.kubernetes.io/name: http-echo - cluster.x-k8s.io/cluster-name: default - spec: - containers: - - args: - - -text=apple - image: hashicorp/http-echo - name: apple-app - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:http-echo -- v1:Service:http-echo:apple-service -id: apps/v1:Deployment:http-echo:http-echodev -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: http-echo -id: v1:Namespace:http-echo -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Service - metadata: - name: apple-service - namespace: http-echo - spec: - ports: - - port: 5678 - selector: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: http-echo-dev - app.kubernetes.io/name: http-echo - cluster.x-k8s.io/cluster-name: default - type: NodePort -dependsOn: -- v1:Namespace:http-echo -id: v1:Service:http-echo:apple-service -type: Kubernetes ---- -attributes: - apiVersion: networking.k8s.io/v1 - kind: Ingress - metadata: - name: example-ingress - namespace: http-echo - spec: - rules: - - http: - paths: - - path: /apple - pathType: Prefix - backend: - service: - name: app-service - port: - number: 5678 -dependsOn: -- v1:Namespace:http-echo -- v1:Service:http-echo:apple-service -- apps/v1:Deployment:http-echo:http-echodev -id: networking.k8s.io/v1:Ingress:http-echo:example-ingress -type: Kubernetes diff --git a/appops/http-echo/dev/kcl.yaml b/appops/http-echo/dev/kcl.yaml deleted file mode 100644 index 2aad4599..00000000 --- a/appops/http-echo/dev/kcl.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# 当前文件记录编译出最终 YAML 所需要的文件,给平台侧使用,不建议修改和重命名,未来会和 ci-test 中的 settings.yaml 部分合并 -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/appops/http-echo/dev/main.k b/appops/http-echo/dev/main.k deleted file mode 100644 index 18c1f91c..00000000 --- a/appops/http-echo/dev/main.k +++ /dev/null @@ -1,8 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - schedulingStrategy.resource = res_tpl.tiny -} diff --git a/appops/nginx-example/README.md b/appops/nginx-example/README.md deleted file mode 100644 index eed78aaf..00000000 --- a/appops/nginx-example/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -```bash -$ cd dev -$ kusion apply -SUCCESS Compiling in stack dev... - -Stack: dev Provider Type Name Plan - * ├─ kubernetes v1:Namespace nginx-example Create - * ├─ kubernetes v1:Service nginx-example Create - * └─ kubernetes apps/v1:Deployment nginx-exampledev Create - -✔ yes -Start applying diffs...... -SUCCESS Creating Namespace/nginx-example -SUCCESS Creating Service/nginx-example -SUCCESS Creating Deployment/nginx-exampledev - -Creating Deployment/nginx-exampledev [3/3] ████████████████████████████████ 100% | 0s - -$ minikube service nginx-example -n nginx-example --url -http://192.168.99.102:30201 - -$ curl -s http://192.168.99.102:30201 | grep '' # Or visit http://192.168.99.102:30201 in browser -<title>Welcome to nginx! - -$ kusion destroy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│ ├── base.k // 应用的环境通用配置 -├── prod // 环境目录 -│ └── ci-test // ci 测试目录,放置测试脚本和数据 -│ └── settings.yaml // 测试数据和编译文件配置 -│ └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│ └── kcl.yaml // 当前 Stack 的多文件编译配置 -│ └── main.k // 应用在当前环境的配置清单 -│ └── stack.yaml // Stack 元信息 -└── project.yaml // Project 元信息 -└── README.md // 说明文档 -``` diff --git a/appops/nginx-example/base/base.k b/appops/nginx-example/base/base.k deleted file mode 100644 index 44cb0546..00000000 --- a/appops/nginx-example/base/base.k +++ /dev/null @@ -1,28 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.service -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main { - ports = [ - {containerPort = 80} - ] - } - image = "nginx:1.7.8" - services = [ - service.Service { - name = __META_APP_NAME - type = "NodePort" - ports = [ - { - nodePort = 30201 - port = 80 - targetPort = 80 - } - ] - } - ] -} diff --git a/appops/nginx-example/dev/ci-test/settings.yaml b/appops/nginx-example/dev/ci-test/settings.yaml deleted file mode 100644 index c3c9d406..00000000 --- a/appops/nginx-example/dev/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: default diff --git a/appops/nginx-example/dev/ci-test/stdout.golden.yaml b/appops/nginx-example/dev/ci-test/stdout.golden.yaml deleted file mode 100644 index f637b354..00000000 --- a/appops/nginx-example/dev/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,72 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: nginx-exampledev - namespace: nginx-example - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: nginx-example-dev - app.kubernetes.io/name: nginx-example - cluster.x-k8s.io/cluster-name: default - template: - metadata: - labels: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: nginx-example-dev - app.kubernetes.io/name: nginx-example - cluster.x-k8s.io/cluster-name: default - spec: - containers: - - image: nginx:1.7.8 - name: main - ports: - - containerPort: 80 - protocol: TCP - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:nginx-example -- v1:Service:nginx-example:nginx-example -id: apps/v1:Deployment:nginx-example:nginx-exampledev -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: nginx-example -id: v1:Namespace:nginx-example -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Service - metadata: - name: nginx-example - namespace: nginx-example - spec: - ports: - - nodePort: 30201 - port: 80 - targetPort: 80 - selector: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: nginx-example-dev - app.kubernetes.io/name: nginx-example - cluster.x-k8s.io/cluster-name: default - type: NodePort -dependsOn: -- v1:Namespace:nginx-example -id: v1:Service:nginx-example:nginx-example -type: Kubernetes diff --git a/appops/nginx-example/dev/kcl.yaml b/appops/nginx-example/dev/kcl.yaml deleted file mode 100644 index 1adacb45..00000000 --- a/appops/nginx-example/dev/kcl.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# 当前文件记录编译出最终 YAML 所需要的文件,给平台侧使用,不建议修改和重命名,未来会和 ci-test 中的 settings.yaml 部分合并 -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - ./main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/appops/nginx-example/dev/main.k b/appops/nginx-example/dev/main.k deleted file mode 100644 index 18c1f91c..00000000 --- a/appops/nginx-example/dev/main.k +++ /dev/null @@ -1,8 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - schedulingStrategy.resource = res_tpl.tiny -} diff --git a/appops/nginx-example/project.yaml b/appops/nginx-example/project.yaml deleted file mode 100644 index 53489598..00000000 --- a/appops/nginx-example/project.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The project basic info -name: nginx-example diff --git a/base/examples/job-example/base/base.k b/base/examples/job-example/base/base.k deleted file mode 100644 index d1df22a8..00000000 --- a/base/examples/job-example/base/base.k +++ /dev/null @@ -1,16 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -jobConfiguration: frontend.Job { - activeDeadlineSeconds = 100 - backoffLimit = 5 - completions = 5 - parallelism = 1 - ttlSecondsAfterFinished = 100 - manualSelector = True - selector = { - "foo": "bar" - } - podMetadata.labels: { - "foo" = "bar" - } -} \ No newline at end of file diff --git a/base/examples/job-example/dev/ci-test/settings.yaml b/base/examples/job-example/dev/ci-test/settings.yaml deleted file mode 100644 index 4cafb256..00000000 --- a/base/examples/job-example/dev/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: minikube diff --git a/base/examples/job-example/dev/ci-test/stdout.golden.yaml b/base/examples/job-example/dev/ci-test/stdout.golden.yaml deleted file mode 100644 index 2733cfd9..00000000 --- a/base/examples/job-example/dev/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,89 +0,0 @@ -attributes: - apiVersion: batch/v1 - kind: Job - metadata: - name: job-example-dev - namespace: job-example - spec: - activeDeadlineSeconds: 100 - backoffLimit: 5 - completionMode: NonIndexed - completions: 5 - manualSelector: true - parallelism: 1 - selector: - matchLabels: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: job-example-dev - app.kubernetes.io/name: job-example - cluster.x-k8s.io/cluster-name: minikube - foo: bar - template: - metadata: - labels: - app.kubernetes.io/env: dev - app.kubernetes.io/instance: job-example-dev - app.kubernetes.io/name: job-example - cluster.x-k8s.io/cluster-name: minikube - foo: bar - spec: - containers: - - command: - - perl - - -Mbignum=bpi - - -wle - - print bpi(2000) - image: perl - name: pi - volumeMounts: - - mountPath: /etc/config - name: config-vol - restartPolicy: Never - serviceAccountName: job-example-sa - volumes: - - name: config-vol - configMap: - name: job-log-config - items: - - key: log_level - path: log_level - ttlSecondsAfterFinished: 100 -dependsOn: -- v1:Namespace:job-example -- v1:ServiceAccount:job-example:job-example-sa -- v1:ConfigMap:job-example:job-log-config -id: batch/v1:Job:job-example:job-example-dev -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: job-example -id: v1:Namespace:job-example -type: Kubernetes ---- -attributes: - apiVersion: v1 - data: - log_level: INFO - kind: ConfigMap - metadata: - name: job-log-config - namespace: job-example -dependsOn: -- v1:Namespace:job-example -- v1:ServiceAccount:job-example:job-example-sa -id: v1:ConfigMap:job-example:job-log-config -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: ServiceAccount - metadata: - name: job-example-sa - namespace: job-example -dependsOn: -- v1:Namespace:job-example -id: v1:ServiceAccount:job-example:job-example-sa -type: Kubernetes diff --git a/base/examples/job-example/dev/kcl.yaml b/base/examples/job-example/dev/kcl.yaml deleted file mode 100644 index 2aad4599..00000000 --- a/base/examples/job-example/dev/kcl.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# 当前文件记录编译出最终 YAML 所需要的文件,给平台侧使用,不建议修改和重命名,未来会和 ci-test 中的 settings.yaml 部分合并 -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/job-example/dev/main.k b/base/examples/job-example/dev/main.k deleted file mode 100644 index 1b7e792d..00000000 --- a/base/examples/job-example/dev/main.k +++ /dev/null @@ -1,49 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.frontend.serviceaccount as sa -import base.pkg.kusion_models.kube.frontend.volume - -jobConfiguration: frontend.Job { - # main container - mainContainer = container.Main { - name = "pi" - command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] - } - image = "perl" - - # configmap - configMaps: [ - { - name = "job-log-config" - data = { - log_level = "INFO" - } - } - ] - - # volumes - volumes: [ - { - name = "config-vol" - volumeSource = volume.ConfigMap { - name = "job-log-config" - items = [ - { - key = "log_level" - path = "log_level" - } - ] - } - mounts = [ - volume.Mount { - path = "/etc/config" - } - ] - } - ] - - # service account - serviceAccount: sa.ServiceAccount { - name = "job-example-sa" - } -} \ No newline at end of file diff --git a/base/examples/kcl-vault-agent/README.md b/base/examples/kcl-vault-agent/README.md deleted file mode 100644 index e67caae8..00000000 --- a/base/examples/kcl-vault-agent/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -```bash -$ cd dev -$ kusion apply --yes=true - SUCCESS Compiling in stack dev... - -Stack: dev Provider Type Name Plan - * ├─ kubernetes v1:Namespace kcl-vault-csi[0] Create - * ├─ kubernetes v1:ServiceAccount kcl-vault-csi-sa[0] Create - * ├─ kubernetes secrets-store.csi.x-k8s.io/v1:SecretProviderClass kcl-vault-csi-database[0] Create - * └─ kubernetes apps/v1:Deployment kcl-vault-csi-dev[0] Create - -Start applying diffs...... - SUCCESS Creating Namespace/kcl-vault-csi - SUCCESS Creating ServiceAccount/kcl-vault-csi-sa - SUCCESS Creating SecretProviderClass/kcl-vault-csi-database - SUCCESS Creating Deployment/kcl-vault-csi-dev -Creating Deployment/kcl-vault-csi-dev [4/4] ██████████████████████████████████████████████████████ 100% | 0s - -Apply complete! Resources: 4 created, 0 updated, 0 deleted. - -$ kubectl exec -n kcl-vault \ - $(kubectl get pod -n kcl-vault -l app=kcl-vault-test -o jsonpath="{.items[0].metadata.name}") \ - --container kcl-vault-test -- cat /vault/secrets/database-config.txt - -data: map[password:db-secret-password username:db-readonly-username] -metadata: map[created_time:2022-03-13T08:40:02.1133715Z custom_metadata: deletion_time: destroyed:false version:1] - -$ kusion destroy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│ ├── base.k // 应用的环境通用配置 -├── dev // 环境目录 -│ └── ci-test // ci 测试目录,放置测试脚本和数据 -│ └── settings.yaml // 测试数据和编译文件配置 -│ └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│ └── kcl.yaml // 当前 Stack 的多文件编译配置 -│ └── main.k // 应用在当前环境的配置清单 -│ └── stack.yaml // Stack 元信息 -└── project.yaml // Project 元信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/kcl-vault-agent/base/base.k b/base/examples/kcl-vault-agent/base/base.k deleted file mode 100644 index 8118c6a6..00000000 --- a/base/examples/kcl-vault-agent/base/base.k +++ /dev/null @@ -1,13 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container - -# application configuration -appConfiguration: frontend.Server { - useBuiltInLabels = False - useBuiltInSelector = False - # main container configuration - mainContainer = container.Main { - name = "kcl-vault-test" - } - image = "jweissig/app:0.0.1" -} diff --git a/base/examples/kcl-vault-agent/dev/ci-test/settings.yaml b/base/examples/kcl-vault-agent/dev/ci-test/settings.yaml deleted file mode 100644 index c3c9d406..00000000 --- a/base/examples/kcl-vault-agent/dev/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: default diff --git a/base/examples/kcl-vault-agent/dev/ci-test/stdout.golden.yaml b/base/examples/kcl-vault-agent/dev/ci-test/stdout.golden.yaml deleted file mode 100644 index 3aaa1dc7..00000000 --- a/base/examples/kcl-vault-agent/dev/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,48 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: kcl-vault-agentdev - namespace: kcl-vault-agent - spec: - replicas: 1 - selector: - matchLabels: - app: kcl-vault-agent-test - template: - metadata: - annotations: - vault.hashicorp.com/agent-inject: 'true' - vault.hashicorp.com/agent-inject-secret-database-config.txt: internal/data/database/config - vault.hashicorp.com/role: kcl-vault-agent-role - labels: - app: kcl-vault-agent-test - spec: - containers: - - image: jweissig/app:0.0.1 - name: kcl-vault-test - serviceAccountName: kcl-vault-agent-sa -dependsOn: -- v1:Namespace:kcl-vault-agent -- v1:ServiceAccount:kcl-vault-agent:kcl-vault-agent-sa -id: apps/v1:Deployment:kcl-vault-agent:kcl-vault-agentdev -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: kcl-vault-agent -id: v1:Namespace:kcl-vault-agent -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: ServiceAccount - metadata: - name: kcl-vault-agent-sa - namespace: kcl-vault-agent -dependsOn: -- v1:Namespace:kcl-vault-agent -id: v1:ServiceAccount:kcl-vault-agent:kcl-vault-agent-sa -type: Kubernetes diff --git a/base/examples/kcl-vault-agent/dev/kcl.yaml b/base/examples/kcl-vault-agent/dev/kcl.yaml deleted file mode 100644 index 2aad4599..00000000 --- a/base/examples/kcl-vault-agent/dev/kcl.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# 当前文件记录编译出最终 YAML 所需要的文件,给平台侧使用,不建议修改和重命名,未来会和 ci-test 中的 settings.yaml 部分合并 -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/kcl-vault-agent/dev/main.k b/base/examples/kcl-vault-agent/dev/main.k deleted file mode 100644 index d65cc581..00000000 --- a/base/examples/kcl-vault-agent/dev/main.k +++ /dev/null @@ -1,30 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.serviceaccount as sa -import base.pkg.kusion_kubernetes.apimachinery.apis - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - selector = { - "app" = "kcl-vault-agent-test" - } - serviceAccount: sa.ServiceAccount { - name = "kcl-vault-agent-sa" - } - podMetadata = apis.ObjectMeta { - annotations = { - "vault.hashicorp.com/agent-inject" = "true" - "vault.hashicorp.com/role" = "kcl-vault-agent-role" - "vault.hashicorp.com/agent-inject-secret-database-config.txt" = "internal/data/database/config" -# following annotations are used to format output, please uncommemt those on second call of `kusion apply` -# "vault.hashicorp.com/agent-inject-status" = "update" -# "vault.hashicorp.com/agent-inject-template-database-config.txt" = """\ -# {{- with secret "internal/data/database/config" -}} -# postgresql://{{ .Data.data.username }}:{{ .Data.data.password }}@postgres:5432/wizard -# {{- end -}}""" - } - labels = { - "app" = "kcl-vault-agent-test" - } - } -} diff --git a/base/examples/kcl-vault-csi/README.md b/base/examples/kcl-vault-csi/README.md deleted file mode 100644 index 7d59da44..00000000 --- a/base/examples/kcl-vault-csi/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -```bash -$ cd dev -$ kusion apply --yes=true -SUCCESS Compiling in stack dev... -Stack: dev Provider Type Name Plan - * ├─ kubernetes v1:Namespace kcl-vault[0] Create - * ├─ kubernetes apps/v1:Deployment kcl-vault-dev[0] Create - * └─ kubernetes v1:ServiceAccount kcl-vault-sa[0] Create - -Start applying diffs...... - SUCCESS Creating Namespace/kcl-vault - SUCCESS Creating Deployment/kcl-vault-dev - SUCCESS Creating ServiceAccount/kcl-vault-sa -Creating ServiceAccount/kcl-vault-sa [3/3] ███████████████████████████████████████████ 100% | 0s - -Apply complete! Resources: 3 created, 0 updated, 0 deleted. - -$ kubectl exec -n kcl-vault \ - $(kubectl get pod -n kcl-vault -l app=kcl-vault-test -o jsonpath="{.items[0].metadata.name}") \ - --container kcl-vault-test -- cat /vault/secrets/database-config.txt - -data: map[password:db-secret-password username:db-readonly-username] -metadata: map[created_time:2022-03-13T08:40:02.1133715Z custom_metadata: deletion_time: destroyed:false version:1] - -$ kusion destroy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│ ├── base.k // 应用的环境通用配置 -├── dev // 环境目录 -│ └── ci-test // ci 测试目录,放置测试脚本和数据 -│ └── settings.yaml // 测试数据和编译文件配置 -│ └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│ └── kcl.yaml // 当前 Stack 的多文件编译配置 -│ └── main.k // 应用在当前环境的配置清单 -│ └── stack.yaml // Stack 元信息 -└── project.yaml // Project 元信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/kcl-vault-csi/base/base.k b/base/examples/kcl-vault-csi/base/base.k deleted file mode 100644 index 5279f704..00000000 --- a/base/examples/kcl-vault-csi/base/base.k +++ /dev/null @@ -1,12 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_kubernetes.apimachinery.apis - -# application configuration -appConfiguration: frontend.Server { - # main container configuration - mainContainer = container.Main { - name = "kcl-vault-csi" - } - image = "jweissig/app:0.0.1" -} diff --git a/base/examples/kcl-vault-csi/base/secretproviderclass.k b/base/examples/kcl-vault-csi/base/secretproviderclass.k deleted file mode 100644 index 26858f60..00000000 --- a/base/examples/kcl-vault-csi/base/secretproviderclass.k +++ /dev/null @@ -1,71 +0,0 @@ -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema SecretProviderClass: - """ SecretProviderClass is the Schema for the secretproviderclasses API - - Attributes - ---------- - apiVersion: "secrets-store.csi.x-k8s.io/v1", default is "secrets-store.csi.x-k8s.io/v1", required - 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 - kind: "SecretProviderClass", default is "SecretProviderClass", required - 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 - metadata: apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec: SecretProviderClassSpec, default is Undefined, optional - Spec defines the desired state of SecretProviderClass - """ - apiVersion: "secrets-store.csi.x-k8s.io/v1" = "secrets-store.csi.x-k8s.io/v1" - kind: "SecretProviderClass" = "SecretProviderClass" - metadata?: apis.ObjectMeta - spec?: SecretProviderClassSpec - -schema SecretProviderClassSpec: - """ SecretProviderClassSpec defines the desired state of SecretProviderClass - - Attributes - ---------- - provider: str, default is Undefined, Optional - Provider is configuration for provider name - parameters: {str:str}, default is Undefined, Optional - Parameters is configuration for specific provider - secretObjects: [SecretObject], default is Undefined, Optional - SecretObjects are the desired state of synced K8s secret objects - """ - provider?: str - parameters?: {str:str} - secretObjects?: [SecretObject] - -schema SecretObject: - """ SecretObject defines the desired state of synced K8s secret objects - - Attributes - ---------- - secretName: str, default is Undefined, Optional - SecretName is name of the K8s secret object - type: str, default is Undefined, Optional - Type is K8s secret object - labels: {str:str}, default is Undefined, Optional - Labels are labels of K8s secret object - annotations: {str:str}, default is Undefined, Optional - Annotations are annotations of k8s secret object - data: [SecretObjectData], default is Undefined, Optional - data defines the desired state of synced K8s secret object data - """ - secretName?: str - type?: str - labels?: {str:str} - annotations?: {str:str} - data?: [SecretObjectData] - -schema SecretObjectData: - """ SecretObjectData defines the desired state of synced K8s secret object data - - Attributes - ---------- - objectName: str, default is Undefined, Optional - SecretName is name of the object to sync - key: str, default is Undefined, Optional - Type is data field to populate - """ - objectName?: str - key?: str \ No newline at end of file diff --git a/base/examples/kcl-vault-csi/dev/ci-test/settings.yaml b/base/examples/kcl-vault-csi/dev/ci-test/settings.yaml deleted file mode 100644 index c3c9d406..00000000 --- a/base/examples/kcl-vault-csi/dev/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: default diff --git a/base/examples/kcl-vault-csi/dev/ci-test/stdout.golden.yaml b/base/examples/kcl-vault-csi/dev/ci-test/stdout.golden.yaml deleted file mode 100644 index 85c05f79..00000000 --- a/base/examples/kcl-vault-csi/dev/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,70 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: kcl-vault-csidev - namespace: kcl-vault-csi - spec: - replicas: 1 - selector: - matchLabels: - app: kcl-vault-csi - template: - metadata: - labels: - app: kcl-vault-csi - spec: - containers: - - image: jweissig/app:0.0.1 - name: kcl-vault-csi - volumeMounts: - - mountPath: /mnt/secrets-store - name: secrets-store-inline - readOnly: true - serviceAccountName: kcl-vault-csi-sa - volumes: - - name: secrets-store-inline - csi: - driver: secrets-store.csi.k8s.io - readOnly: true - volumeAttributes: - secretProviderClass: kcl-vault-csi-database -dependsOn: -- v1:Namespace:kcl-vault-csi -- v1:ServiceAccount:kcl-vault-csi:kcl-vault-csi-sa -id: apps/v1:Deployment:kcl-vault-csi:kcl-vault-csidev -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: kcl-vault-csi -id: v1:Namespace:kcl-vault-csi -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: ServiceAccount - metadata: - name: kcl-vault-csi-sa - namespace: kcl-vault-csi -dependsOn: -- v1:Namespace:kcl-vault-csi -id: v1:ServiceAccount:kcl-vault-csi:kcl-vault-csi-sa -type: Kubernetes ---- -apiVersion: secrets-store.csi.x-k8s.io/v1 -kind: SecretProviderClass -metadata: - name: kcl-vault-csi-database - namespace: kcl-vault-csi -spec: - parameters: - objects: | - - objectName: "db-password" - secretPath: "secret/data/db-pass" - secretKey: "password" - roleName: kcl-vault-csi-role - vaultAddress: http://vault.default:8200 - provider: vault diff --git a/base/examples/kcl-vault-csi/dev/kcl.yaml b/base/examples/kcl-vault-csi/dev/kcl.yaml deleted file mode 100644 index c7a9d441..00000000 --- a/base/examples/kcl-vault-csi/dev/kcl.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# 当前文件记录编译出最终 YAML 所需要的文件,给平台侧使用,不建议修改和重命名,未来会和 ci-test 中的 settings.yaml 部分合并 -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - ../base/secretproviderclass.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/kcl-vault-csi/dev/main.k b/base/examples/kcl-vault-csi/dev/main.k deleted file mode 100644 index 284e59a7..00000000 --- a/base/examples/kcl-vault-csi/dev/main.k +++ /dev/null @@ -1,65 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_models.kube.frontend.serviceaccount as sa -import base.pkg.kusion_models.kube.frontend.volume -import base.pkg.kusion_models.kube.metadata - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - useBuiltInLabels = False - useBuiltInSelector = False - selector = { - "app" = "kcl-vault-csi" - } - serviceAccount: sa.ServiceAccount { - name = "kcl-vault-csi-sa" - } - volumes: [ - { - name = "secrets-store-inline" - volumeSource = volume.CSI { - driver: "secrets-store.csi.k8s.io" - readOnly: True - volumeAttributes: { - "secretProviderClass": "kcl-vault-csi-database" - } - } - mounts = [ - volume.Mount { - path = "/mnt/secrets-store" - readOnly = True - } - ] - } - ] - podMetadata = apis.ObjectMeta { - labels: { - "app" = "kcl-vault-csi" - } - } -} - -# SecretProviderClass -vaultDatabase: SecretProviderClass { - __settings__: { - "output_type": "STANDALONE" - } - metadata = apis.ObjectMeta { - name = "kcl-vault-csi-database" - namespace = metadata.__META_APP_NAME - } - spec = SecretProviderClassSpec{ - provider = "vault" - parameters = { - "vaultAddress": "http://vault.default:8200" - "roleName": "kcl-vault-csi-role" - "objects": """\ -- objectName: "db-password" - secretPath: "secret/data/db-pass" - secretKey: "password" -""" - } - } - -} diff --git a/base/examples/kcl-vault-csi/dev/stack.yaml b/base/examples/kcl-vault-csi/dev/stack.yaml deleted file mode 100644 index 1be7264f..00000000 --- a/base/examples/kcl-vault-csi/dev/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: dev diff --git a/base/examples/kcl-vault-csi/project.yaml b/base/examples/kcl-vault-csi/project.yaml deleted file mode 100644 index baa00854..00000000 --- a/base/examples/kcl-vault-csi/project.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The project basic info -name: kcl-vault-csi diff --git a/base/examples/monitoring/prometheus-example-app/README.md b/base/examples/monitoring/prometheus-example-app/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/monitoring/prometheus-example-app/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/monitoring/prometheus-example-app/base/base.k b/base/examples/monitoring/prometheus-example-app/base/base.k deleted file mode 100644 index a3ab0fc3..00000000 --- a/base/examples/monitoring/prometheus-example-app/base/base.k +++ /dev/null @@ -1,10 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - schedulingStrategy.resource = res_tpl.tiny - # Ref: https://github.com/brancz/prometheus-example-app/blob/master/main.go - image = "quay.io/brancz/prometheus-example-app:v0.3.0" -} diff --git a/base/examples/monitoring/prometheus-example-app/prod/ci-test/settings.yaml b/base/examples/monitoring/prometheus-example-app/prod/ci-test/settings.yaml deleted file mode 100644 index 4e71a293..00000000 --- a/base/examples/monitoring/prometheus-example-app/prod/ci-test/settings.yaml +++ /dev/null @@ -1 +0,0 @@ -kcl_options: diff --git a/base/examples/monitoring/prometheus-example-app/prod/ci-test/stdout.golden.yaml b/base/examples/monitoring/prometheus-example-app/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 3d1146db..00000000 --- a/base/examples/monitoring/prometheus-example-app/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,69 +0,0 @@ -id: apps/v1:Deployment:prometheus-example-app:prometheus-example-appprod -type: Kubernetes -dependsOn: -- v1:Namespace:prometheus-example-app -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: prometheus-example-appprod - namespace: prometheus-example-app - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: prometheus-example-app - app.kubernetes.io/env: prod - app.kubernetes.io/instance: prometheus-example-app-prod - template: - metadata: - labels: - app.kubernetes.io/name: prometheus-example-app - app.kubernetes.io/env: prod - app.kubernetes.io/instance: prometheus-example-app-prod - spec: - containers: - - image: quay.io/brancz/prometheus-example-app:v0.3.0 - name: prometheus-example-app - ports: - - containerPort: 8080 - name: web - protocol: TCP - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi ---- -id: v1:Namespace:prometheus-example-app -type: Kubernetes -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: prometheus-example-app ---- -id: monitoring.coreos.com/v1:PodMonitor:prometheus-example-app:prometheus-example-appprod -type: Kubernetes -attributes: - apiVersion: monitoring.coreos.com/v1 - kind: PodMonitor - metadata: - labels: - app.kubernetes.io/name: prometheus-example-app - app.kubernetes.io/env: prod - app.kubernetes.io/instance: prometheus-example-app-prod - name: prometheus-example-appprod - namespace: prometheus-example-app - spec: - podMetricsEndpoints: - - port: web - selector: - matchLabels: - app.kubernetes.io/name: prometheus-example-app - app.kubernetes.io/env: prod - app.kubernetes.io/instance: prometheus-example-app-prod diff --git a/base/examples/monitoring/prometheus-example-app/prod/kcl.yaml b/base/examples/monitoring/prometheus-example-app/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/monitoring/prometheus-example-app/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/monitoring/prometheus-example-app/prod/main.k b/base/examples/monitoring/prometheus-example-app/prod/main.k deleted file mode 100644 index 09ab112a..00000000 --- a/base/examples/monitoring/prometheus-example-app/prod/main.k +++ /dev/null @@ -1,19 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.frontend.container.port as cp - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - # Main container configuration - mainContainer: container.Main { - name = "prometheus-example-app" - ports = [ - cp.ContainerPort { - name = "web" - containerPort = 8080 - } - ] - } - enableMonitoring = True -} diff --git a/base/examples/monitoring/prometheus-example-app/prod/stack.yaml b/base/examples/monitoring/prometheus-example-app/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/monitoring/prometheus-example-app/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/monitoring/prometheus-example-app/project.yaml b/base/examples/monitoring/prometheus-example-app/project.yaml deleted file mode 100644 index b01b351d..00000000 --- a/base/examples/monitoring/prometheus-example-app/project.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The project basic info -name: prometheus-example-app diff --git a/base/examples/monitoring/prometheus-install/base/base.k b/base/examples/monitoring/prometheus-install/base/base.k deleted file mode 100644 index cc9f8036..00000000 --- a/base/examples/monitoring/prometheus-install/base/base.k +++ /dev/null @@ -1,63 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.rbac -import base.pkg.kusion_kubernetes.api.core.v1 as corev1 - - -_rbac_name = "prometheus" -_common_namespace = "default" - -# 1. create a service account -_prometheus_sa: corev1.ServiceAccount { - metadata = { - name = _rbac_name - namespace = _common_namespace - } -} - -# 2. prepare required permissions with api groups and resources -_prometheus_clusterrole: rbac.ClusterRole { - metadata = { - name = _rbac_name - namespace = _common_namespace - } - rules = [ - { - apiGroups = [""] - resources = ["nodes", "nodes/metrics", "services", "endpoints", "pods"] - verbs = ["get", "list", "watch"] - } - { - apiGroups = [""] - resources = ["configmaps"] - verbs = ["get"] - } - { - apiGroups = ["networking.k8s.io"] - resources = ["ingresses"] - verbs = ["get", "list", "watch"] - } - { - nonResourceURLs = ["/metrics"] - verbs = ["get"] - } - ] -} - -# 3. bind service account and cluster role -rbac.ClusterRoleBinding{ - metadata = { - name = _rbac_name - namespace = _common_namespace - } - roleRef = { - apiGroup = "rbac.authorization.k8s.io" - kind = "ClusterRole" - name = _prometheus_clusterrole.metadata.name - } - subjects = [ - { - kind = "ServiceAccount" - name = _prometheus_sa.metadata.name - namespace = _prometheus_sa.metadata.namespace - } - ] -} \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-install/prod/ci-test/settings.yaml b/base/examples/monitoring/prometheus-install/prod/ci-test/settings.yaml deleted file mode 100644 index 4e71a293..00000000 --- a/base/examples/monitoring/prometheus-install/prod/ci-test/settings.yaml +++ /dev/null @@ -1 +0,0 @@ -kcl_options: diff --git a/base/examples/monitoring/prometheus-install/prod/ci-test/stdout.golden.yaml b/base/examples/monitoring/prometheus-install/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 5af71223..00000000 --- a/base/examples/monitoring/prometheus-install/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,181 +0,0 @@ -id: rbac.authorization.k8s.io/v1:ClusterRoleBinding:default:prometheus -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:default:prometheus -attributes: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - subjects: - - kind: ServiceAccount - name: prometheus - namespace: default - metadata: - name: prometheus - namespace: default - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus ---- -id: rbac.authorization.k8s.io/v1:ClusterRole:default:prometheus -type: Kubernetes -attributes: - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - rules: - - apiGroups: - - '' - resources: - - nodes - - nodes/metrics - - services - - endpoints - - pods - verbs: - - get - - list - - watch - - apiGroups: - - '' - resources: - - configmaps - verbs: - - get - - apiGroups: - - networking.k8s.io - resources: - - ingresses - verbs: - - get - - list - - watch - - nonResourceURLs: - - /metrics - verbs: - - get - metadata: - name: prometheus - namespace: default ---- -id: monitoring.coreos.com/v1alpha1:AlertmanagerConfig:default:main -type: Kubernetes -attributes: - apiVersion: monitoring.coreos.com/v1alpha1 - kind: AlertmanagerConfig - metadata: - labels: - alertmanagerConfig: main - name: main - namespace: default - spec: - receivers: - - name: webhook - webhookConfigs: - - url: http://example.com/ - route: - groupBy: - - job - groupInterval: 5m - groupWait: 30s - receiver: webhook - repeatInterval: 12h ---- -id: monitoring.coreos.com/v1:Prometheus:default:main -type: Kubernetes -attributes: - apiVersion: monitoring.coreos.com/v1 - kind: Prometheus - metadata: - name: main - namespace: default - spec: - serviceMonitorSelector: - matchLabels: - prometheus: main - replicas: 2 - scrapeInterval: 30s - serviceAccountName: prometheus - evaluationInterval: 30s - alerting: - alertmanagers: - - name: alertmanager - namespace: default - port: web - ruleSelector: - matchLabels: - role: alert-rules - prometheus: main ---- -id: monitoring.coreos.com/v1:Alertmanager:default:main -type: Kubernetes -attributes: - apiVersion: monitoring.coreos.com/v1 - kind: Alertmanager - metadata: - name: main - namespace: default - spec: - replicas: 3 - retention: 120h - alertmanagerConfiguration: - name: main ---- -id: v1:Service:default:alertmanager -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:default:prometheus -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:default:prometheus -- v1:ServiceAccount:default:prometheus -attributes: - apiVersion: v1 - kind: Service - metadata: - name: alertmanager - namespace: default - spec: - ports: - - name: web - port: 9093 - targetPort: web - - name: reloader-web - port: 8080 - targetPort: reloader-web - selector: - alertmanager: main - sessionAffinity: ClientIP ---- -id: v1:Service:default:prometheus -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:default:prometheus -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:default:prometheus -- v1:ServiceAccount:default:prometheus -attributes: - apiVersion: v1 - kind: Service - metadata: - name: prometheus - namespace: default - spec: - ports: - - name: web - port: 9090 - targetPort: web - - name: reloader-web - port: 8080 - targetPort: reloader-web - selector: - prometheus: main - sessionAffinity: ClientIP ---- -id: v1:ServiceAccount:default:prometheus -type: Kubernetes -dependsOn: -- rbac.authorization.k8s.io/v1:ClusterRole:default:prometheus -- rbac.authorization.k8s.io/v1:ClusterRoleBinding:default:prometheus -attributes: - apiVersion: v1 - kind: ServiceAccount - metadata: - name: prometheus - namespace: default diff --git a/base/examples/monitoring/prometheus-install/prod/kcl.yaml b/base/examples/monitoring/prometheus-install/prod/kcl.yaml deleted file mode 100644 index cb77dc2d..00000000 --- a/base/examples/monitoring/prometheus-install/prod/kcl.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kcl_cli_configs: - file: - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/monitoring/prometheus-install/prod/main.k b/base/examples/monitoring/prometheus-install/prod/main.k deleted file mode 100644 index e52161d0..00000000 --- a/base/examples/monitoring/prometheus-install/prod/main.k +++ /dev/null @@ -1,136 +0,0 @@ -import base.pkg.kusion_kubernetes.api.core.v1 as corev1 -import base.pkg.kusion_prometheus.monitoring.v1 as monitoringv1 -import base.pkg.kusion_prometheus.monitoring.v1alpha1 as monitoringv1alpha1 - - -# 1. creates an AlertmanagerConfig that sends notifications to a fictitious webhook service. -_alertmanager_config: monitoringv1alpha1.AlertmanagerConfig{ - metadata = { - name = "main" - namespace = _common_namespace - labels = { - "alertmanagerConfig" = "main" - } - } - spec = { - route = { - groupBy = ["job"] - groupWait = "30s" - groupInterval = "5m" - repeatInterval = "12h" - receiver = "webhook" - } - receivers = [ - { - name = "webhook" - webhookConfigs = [ - { - url = "http://example.com/" - } - ] - } - ] - } -} - -# 2. create an alertmanager cluster with 3 replicas and configured with alertmanager config -_alertmanager: monitoringv1.Alertmanager{ - metadata = { - name = "main" - namespace = _common_namespace - } - spec = { - replicas = 3 - # using AlertmanagerConfig for global configuration - alertmanagerConfiguration = { - name = _alertmanager_config.metadata.name - } - } -} - -# 3. expose alertmanager service -_alertmanager_svc: corev1.Service{ - metadata = { - name = "alertmanager" - namespace = _common_namespace - } - spec = { - selector = { - "alertmanager" = _alertmanager.metadata.name - } - ports = [ - { - name = "web" - port = 9093 - targetPort = "web" - } - { - name = "reloader-web" - port = 8080 - targetPort = "reloader-web" - } - ] - sessionAffinity = "ClientIP" - } -} - -# 4. create a prometheus cluster with 2 replicas, intergated with alertmanager cluster -_prometheus: monitoringv1.Prometheus{ - metadata = { - name = "main" - namespace = _common_namespace - } - spec = { - # specify service account, default sa has no permissions - serviceAccountName = _rbac_name - replicas = 2 - # ruleSelector is nil meaning that the operator picks up no rule - ruleSelector = { - matchLabels = { - "role" = "alert-rules" - "prometheus" = "main" - } - } - serviceMonitorSelector = { - matchLabels = { - "prometheus" = "main" - } - } - # intergating with alert manager by its service - alerting = { - alertmanagers = [ - { - name = _alertmanager_svc.metadata.name - namespace = _alertmanager_svc.metadata.namespace - port = _alertmanager_svc.spec.ports[0].name - } - ] - } - } -} - -# 5. expose prometheus service -_prometheus_svc: corev1.Service{ - metadata = { - name = "prometheus" - namespace = _common_namespace - } - spec = { - selector = { - "prometheus" = _prometheus.metadata.name - } - ports = [ - { - name = "web" - port = 9090 - targetPort = "web" - } - { - name = "reloader-web" - port = 8080 - targetPort = "reloader-web" - } - ] - sessionAffinity = "ClientIP" - } -} \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-install/prod/stack.yaml b/base/examples/monitoring/prometheus-install/prod/stack.yaml deleted file mode 100644 index d2ab0669..00000000 --- a/base/examples/monitoring/prometheus-install/prod/stack.yaml +++ /dev/null @@ -1 +0,0 @@ -name: prod \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-install/project.yaml b/base/examples/monitoring/prometheus-install/project.yaml deleted file mode 100644 index 4b085201..00000000 --- a/base/examples/monitoring/prometheus-install/project.yaml +++ /dev/null @@ -1 +0,0 @@ -name: prometheus-install \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-rules/alert/ci-test/settings.yaml b/base/examples/monitoring/prometheus-rules/alert/ci-test/settings.yaml deleted file mode 100644 index 2beb8a49..00000000 --- a/base/examples/monitoring/prometheus-rules/alert/ci-test/settings.yaml +++ /dev/null @@ -1 +0,0 @@ -kcl_options: \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-rules/alert/ci-test/stdout.golden.yaml b/base/examples/monitoring/prometheus-rules/alert/ci-test/stdout.golden.yaml deleted file mode 100644 index 65767f10..00000000 --- a/base/examples/monitoring/prometheus-rules/alert/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,17 +0,0 @@ -id: monitoring.coreos.com/v1:PrometheusRule:default:alert -type: Kubernetes -attributes: - apiVersion: monitoring.coreos.com/v1 - kind: PrometheusRule - metadata: - labels: - prometheus: main - role: alert-rules - name: alert - namespace: default - spec: - groups: - - name: alert.rules - rules: - - alert: WebhookAlert - expr: vector(1) diff --git a/base/examples/monitoring/prometheus-rules/alert/kcl.yaml b/base/examples/monitoring/prometheus-rules/alert/kcl.yaml deleted file mode 100644 index 7a3a1166..00000000 --- a/base/examples/monitoring/prometheus-rules/alert/kcl.yaml +++ /dev/null @@ -1,4 +0,0 @@ -kcl_cli_configs: - file: - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/monitoring/prometheus-rules/alert/main.k b/base/examples/monitoring/prometheus-rules/alert/main.k deleted file mode 100644 index d2f2eb61..00000000 --- a/base/examples/monitoring/prometheus-rules/alert/main.k +++ /dev/null @@ -1,24 +0,0 @@ -import base.pkg.kusion_prometheus.monitoring.v1 as monitoringv1 - -monitoringv1.PrometheusRule { - metadata = { - name = "alert" - namespace = "default" - labels: { - "prometheus": "main" - "role": "alert-rules" - } - } - spec.groups = [ - { - name = "alert.rules" - rules = [ - { - alert: "WebhookAlert" - # vector(s scalar) returns the scalar s as a vector with no labels. - expr: "vector(1)" - } - ] - } - ] -} \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-rules/alert/stack.yaml b/base/examples/monitoring/prometheus-rules/alert/stack.yaml deleted file mode 100644 index 8b64a308..00000000 --- a/base/examples/monitoring/prometheus-rules/alert/stack.yaml +++ /dev/null @@ -1 +0,0 @@ -name: alert \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-rules/project.yaml b/base/examples/monitoring/prometheus-rules/project.yaml deleted file mode 100644 index 56c9c651..00000000 --- a/base/examples/monitoring/prometheus-rules/project.yaml +++ /dev/null @@ -1 +0,0 @@ -name: prometheus-rules \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-rules/record/ci-test/settings.yaml b/base/examples/monitoring/prometheus-rules/record/ci-test/settings.yaml deleted file mode 100644 index 2beb8a49..00000000 --- a/base/examples/monitoring/prometheus-rules/record/ci-test/settings.yaml +++ /dev/null @@ -1 +0,0 @@ -kcl_options: \ No newline at end of file diff --git a/base/examples/monitoring/prometheus-rules/record/ci-test/stdout.golden.yaml b/base/examples/monitoring/prometheus-rules/record/ci-test/stdout.golden.yaml deleted file mode 100644 index 0cd17a2c..00000000 --- a/base/examples/monitoring/prometheus-rules/record/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,30 +0,0 @@ -id: monitoring.coreos.com/v1:PrometheusRule:default:k8s-rules -type: Kubernetes -attributes: - apiVersion: monitoring.coreos.com/v1 - kind: PrometheusRule - metadata: - labels: - prometheus: main - role: alert-rules - name: k8s-rules - namespace: default - spec: - groups: - - name: node.rules - rules: - - expr: | - sum( - node_memory_MemAvailable_bytes{job="node-exporter"} or - ( - node_memory_Buffers_bytes{job="node-exporter"} + - node_memory_Cached_bytes{job="node-exporter"} + - node_memory_MemFree_bytes{job="node-exporter"} + - node_memory_Slab_bytes{job="node-exporter"} - ) - ) by (cluster) - record: :node_memory_MemAvailable_bytes:sum - - expr: | - sum(rate(node_cpu_seconds_total{job="node-exporter",mode!="idle",mode!="iowait",mode!="steal"}[5m])) / - count(sum(node_cpu_seconds_total{job="node-exporter"}) by (cluster, instance, cpu)) - record: cluster:node_cpu:ratio_rate5m diff --git a/base/examples/monitoring/prometheus-rules/record/kcl.yaml b/base/examples/monitoring/prometheus-rules/record/kcl.yaml deleted file mode 100644 index 7a3a1166..00000000 --- a/base/examples/monitoring/prometheus-rules/record/kcl.yaml +++ /dev/null @@ -1,4 +0,0 @@ -kcl_cli_configs: - file: - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/monitoring/prometheus-rules/record/main.k b/base/examples/monitoring/prometheus-rules/record/main.k deleted file mode 100644 index 900b66d4..00000000 --- a/base/examples/monitoring/prometheus-rules/record/main.k +++ /dev/null @@ -1,46 +0,0 @@ -import base.pkg.kusion_prometheus.monitoring.v1 as monitoringv1 - -# expr: sum of node available memory in bytes -_sum_of_node_memory = """\ -sum( - node_memory_MemAvailable_bytes{job="node-exporter"} or - ( - node_memory_Buffers_bytes{job="node-exporter"} + - node_memory_Cached_bytes{job="node-exporter"} + - node_memory_MemFree_bytes{job="node-exporter"} + - node_memory_Slab_bytes{job="node-exporter"} - ) -) by (cluster) -""" - -# expr: calculates the average rate of increase of node cpu every 5 minutes -_node_cpu = """\ -sum(rate(node_cpu_seconds_total{job="node-exporter",mode!="idle",mode!="iowait",mode!="steal"}[5m])) / -count(sum(node_cpu_seconds_total{job="node-exporter"}) by (cluster, instance, cpu)) -""" - -monitoringv1.PrometheusRule { - metadata = { - name = "k8s-rules" - namespace = "default" - labels: { - "prometheus": "main" - "role": "alert-rules" - } - } - spec.groups = [ - { - name = "node.rules" - rules = [ - { - expr = _sum_of_node_memory - record = ":node_memory_MemAvailable_bytes:sum" - } - { - expr = _node_cpu - record = "cluster:node_cpu:ratio_rate5m" - } - ] - } - ] -} diff --git a/base/examples/monitoring/prometheus-rules/record/stack.yaml b/base/examples/monitoring/prometheus-rules/record/stack.yaml deleted file mode 100644 index e7a0797f..00000000 --- a/base/examples/monitoring/prometheus-rules/record/stack.yaml +++ /dev/null @@ -1 +0,0 @@ -name: record \ No newline at end of file diff --git a/base/examples/native/nginx_deployment/nginx_deployment.k b/base/examples/native/nginx_deployment/nginx_deployment.k deleted file mode 100644 index 13268a29..00000000 --- a/base/examples/native/nginx_deployment/nginx_deployment.k +++ /dev/null @@ -1,23 +0,0 @@ -import base.pkg.kusion_kubernetes.api.apps.v1 as apps - -demo = apps.Deployment { - metadata.name = "nginx-deployment" - spec = { - replicas = 3 - selector.matchLabels = { - app = "nginx" - } - template.metadata.labels = { - app = "nginx" - } - template.spec.containers = [ - { - name = "nginx" - image = "nginx:1.14.2" - ports = [ - {containerPort = 80} - ] - } - ] - } -} diff --git a/base/examples/native/nginx_deployment/nginx_deployment.yaml b/base/examples/native/nginx_deployment/nginx_deployment.yaml deleted file mode 100644 index c17f0bb9..00000000 --- a/base/examples/native/nginx_deployment/nginx_deployment.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment -spec: - replicas: 3 - selector: - matchLabels: - app: nginx - template: - metadata: - labels: - app: nginx - spec: - containers: - - image: nginx:1.14.2 - name: nginx - ports: - - containerPort: 80 diff --git a/base/examples/server/app_config_map/OWNERS b/base/examples/server/app_config_map/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_config_map/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_config_map/README.md b/base/examples/server/app_config_map/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_config_map/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_config_map/base/base.k b/base/examples/server/app_config_map/base/base.k deleted file mode 100644 index 4b6d86b2..00000000 --- a/base/examples/server/app_config_map/base/base.k +++ /dev/null @@ -1,13 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy = { - resource = res_tpl.tiny - } - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_config_map/prod/ci-test/settings.yaml b/base/examples/server/app_config_map/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_config_map/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_config_map/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_config_map/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index eeaa4f71..00000000 --- a/base/examples/server/app_config_map/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,74 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:sampleapp -- v1:ConfigMap:sampleapp:sampleappprod0 -- v1:ConfigMap:sampleapp:sampleappprod1 -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes ---- -attributes: - apiVersion: v1 - data: - app.name: sampleapp - kind: ConfigMap - metadata: - name: sampleappprod0 - namespace: sampleapp -dependsOn: -- v1:Namespace:sampleapp -id: v1:ConfigMap:sampleapp:sampleappprod0 -type: Kubernetes ---- -attributes: - apiVersion: v1 - data: - nginx.conf: configuration_content - kind: ConfigMap - metadata: - name: sampleappprod1 - namespace: sampleapp -dependsOn: -- v1:Namespace:sampleapp -id: v1:ConfigMap:sampleapp:sampleappprod1 -type: Kubernetes diff --git a/base/examples/server/app_config_map/prod/kcl.yaml b/base/examples/server/app_config_map/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_config_map/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_config_map/prod/main.k b/base/examples/server/app_config_map/prod/main.k deleted file mode 100644 index 80249c75..00000000 --- a/base/examples/server/app_config_map/prod/main.k +++ /dev/null @@ -1,19 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.configmap - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - configMaps = [ - configmap.ConfigMap { - data = { - "app.name" = __META_APP_NAME - } - } - configmap.ConfigMap { - data = { - "nginx.conf" = "configuration_content" - } - } - ] -} diff --git a/base/examples/server/app_config_map/prod/stack.yaml b/base/examples/server/app_config_map/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_config_map/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_config_map/project.yaml b/base/examples/server/app_config_map/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_config_map/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_label_selector/OWNERS b/base/examples/server/app_label_selector/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_label_selector/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_label_selector/README.md b/base/examples/server/app_label_selector/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_label_selector/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_label_selector/base/base.k b/base/examples/server/app_label_selector/base/base.k deleted file mode 100644 index 4b6d86b2..00000000 --- a/base/examples/server/app_label_selector/base/base.k +++ /dev/null @@ -1,13 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy = { - resource = res_tpl.tiny - } - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_label_selector/prod/ci-test/settings.yaml b/base/examples/server/app_label_selector/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_label_selector/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_label_selector/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_label_selector/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 2a5e1685..00000000 --- a/base/examples/server/app_label_selector/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,50 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - app.kubernetes.io/version: v1.0.0 - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - annotations: - owner: team-iac - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - app.kubernetes.io/version: v1.0.0 - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:sampleapp -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_label_selector/prod/kcl.yaml b/base/examples/server/app_label_selector/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_label_selector/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_label_selector/prod/main.k b/base/examples/server/app_label_selector/prod/main.k deleted file mode 100644 index 83399084..00000000 --- a/base/examples/server/app_label_selector/prod/main.k +++ /dev/null @@ -1,19 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - # Custom workload selector - selector: { - "app.kubernetes.io/version" = "v1.0.0" - } - # Custom workload pod metadata - podMetadata: { - labels: { - "app.kubernetes.io/version" = "v1.0.0" - } - annotations: { - "owner" = "team-iac" - } - } -} diff --git a/base/examples/server/app_label_selector/prod/stack.yaml b/base/examples/server/app_label_selector/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_label_selector/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_label_selector/project.yaml b/base/examples/server/app_label_selector/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_label_selector/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_main_container/OWNERS b/base/examples/server/app_main_container/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_main_container/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_main_container/README.md b/base/examples/server/app_main_container/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_main_container/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_main_container/base/base.k b/base/examples/server/app_main_container/base/base.k deleted file mode 100644 index da348d40..00000000 --- a/base/examples/server/app_main_container/base/base.k +++ /dev/null @@ -1,9 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - schedulingStrategy.resource = res_tpl.tiny - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_main_container/prod/ci-test/settings.yaml b/base/examples/server/app_main_container/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_main_container/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_main_container/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_main_container/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index e838fb60..00000000 --- a/base/examples/server/app_main_container/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,99 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - args: - - start - command: - - /home/admin/server.sh - env: - - name: app.version - value: v1.0.0 - envFrom: - - configMapRef: - name: my-configmap - image: gcr.io/google-samples/gb-frontend:v4 - name: main - ports: - - containerPort: 12201 - protocol: TCP - lifecycle: - preStop: - exec: - command: - - /bin/sh - - -c - - echo 1 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 5 - successThreshold: 1 - timeoutSeconds: 10 - exec: - command: - - /bin/sh - - -c - - echo livenessProbe - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 5 - successThreshold: 2 - timeoutSeconds: 10 - exec: - command: - - /bin/sh - - -c - - echo readinessProbe - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - startupProbe: - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 5 - successThreshold: 2 - timeoutSeconds: 10 - exec: - command: - - /bin/sh - - -c - - echo startupProbe -dependsOn: -- v1:Namespace:sampleapp -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_main_container/prod/kcl.yaml b/base/examples/server/app_main_container/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_main_container/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_main_container/prod/main.k b/base/examples/server/app_main_container/prod/main.k deleted file mode 100644 index 732dc40e..00000000 --- a/base/examples/server/app_main_container/prod/main.k +++ /dev/null @@ -1,77 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.frontend.container.env as e -import base.pkg.kusion_models.kube.frontend.container.port as cp -import base.pkg.kusion_models.kube.frontend.container.probe as p -import base.pkg.kusion_models.kube.frontend.container.lifecycle as lc - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - # Main container configuration - mainContainer: container.Main { - # 主容器名称,可选 - name = "main" - # 主容器启动命令,可选 - command = ["/home/admin/server.sh"] - # 主容器启动参数,可选 - args = ["start"] - # 主容器环境变量,可选 - env = [ - e.Env { - name = "app.version" - value = "v1.0.0" - } - ] - envFrom = [ - e.EnvFromSource { - configMapRef = "my-configmap" - } - ] - lifecycle = lc.Lifecycle { - preStop = p.Exec { - command = ["/bin/sh", "-c", "echo 1"] - } - } - # 主容器端口,可选 - ports = [ - cp.ContainerPort { - containerPort = 12201 - protocol = "TCP" - } - ] - # 主容器存活探针,可选 - livenessProbe = p.Probe { - failureThreshold = 3 - initialDelaySeconds = 30 - periodSeconds = 5 - successThreshold = 1 - timeoutSeconds = 10 - handler = p.Exec { - command = ["/bin/sh", "-c", "echo livenessProbe"] - } - } - # 主容器就绪探针,可选 - readinessProbe = p.Probe { - failureThreshold = 3 - initialDelaySeconds = 30 - periodSeconds = 5 - successThreshold = 2 - timeoutSeconds = 10 - handler = p.Exec { - command = ["/bin/sh", "-c", "echo readinessProbe"] - } - } - # 主容器启动探针, 启动探针探测成功之后存活探测才开始工作,可选 - startupProbe = p.Probe { - failureThreshold = 3 - initialDelaySeconds = 30 - periodSeconds = 5 - successThreshold = 2 - timeoutSeconds = 10 - handler = p.Exec { - command = ["/bin/sh", "-c", "echo startupProbe"] - } - } - } -} diff --git a/base/examples/server/app_main_container/prod/stack.yaml b/base/examples/server/app_main_container/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_main_container/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_main_container/project.yaml b/base/examples/server/app_main_container/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_main_container/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_need_namespace/OWNERS b/base/examples/server/app_need_namespace/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_need_namespace/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_need_namespace/README.md b/base/examples/server/app_need_namespace/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_need_namespace/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_need_namespace/base/base.k b/base/examples/server/app_need_namespace/base/base.k deleted file mode 100644 index f092857e..00000000 --- a/base/examples/server/app_need_namespace/base/base.k +++ /dev/null @@ -1,11 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy.resource = res_tpl.tiny - image: "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_need_namespace/prod/ci-test/settings.yaml b/base/examples/server/app_need_namespace/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_need_namespace/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_need_namespace/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_need_namespace/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 7a9ce99c..00000000 --- a/base/examples/server/app_need_namespace/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,46 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:sampleapp -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_need_namespace/prod/kcl.yaml b/base/examples/server/app_need_namespace/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_need_namespace/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_need_namespace/prod/main.k b/base/examples/server/app_need_namespace/prod/main.k deleted file mode 100644 index 3f196520..00000000 --- a/base/examples/server/app_need_namespace/prod/main.k +++ /dev/null @@ -1,8 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - # Generate default namespace - needNamespace = True -} diff --git a/base/examples/server/app_need_namespace/prod/stack.yaml b/base/examples/server/app_need_namespace/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_need_namespace/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_need_namespace/project.yaml b/base/examples/server/app_need_namespace/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_need_namespace/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_scheduling_strategy/OWNERS b/base/examples/server/app_scheduling_strategy/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_scheduling_strategy/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_scheduling_strategy/README.md b/base/examples/server/app_scheduling_strategy/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_scheduling_strategy/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_scheduling_strategy/base/base.k b/base/examples/server/app_scheduling_strategy/base/base.k deleted file mode 100644 index 2fe6ea67..00000000 --- a/base/examples/server/app_scheduling_strategy/base/base.k +++ /dev/null @@ -1,9 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_scheduling_strategy/prod/ci-test/settings.yaml b/base/examples/server/app_scheduling_strategy/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_scheduling_strategy/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_scheduling_strategy/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_scheduling_strategy/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index c6b5eb39..00000000 --- a/base/examples/server/app_scheduling_strategy/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,46 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: '1' - memory: 1Gi - ephemeral-storage: 30Gi - requests: - cpu: '1' - memory: 1Gi - ephemeral-storage: 30Gi -dependsOn: -- v1:Namespace:sampleapp -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_scheduling_strategy/prod/kcl.yaml b/base/examples/server/app_scheduling_strategy/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_scheduling_strategy/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_scheduling_strategy/prod/main.k b/base/examples/server/app_scheduling_strategy/prod/main.k deleted file mode 100644 index 101d541d..00000000 --- a/base/examples/server/app_scheduling_strategy/prod/main.k +++ /dev/null @@ -1,12 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.resource as res - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - schedulingStrategy.resource = res.Resource { - cpu = 1 - memory = 1Gi - disk = 30Gi - } -} diff --git a/base/examples/server/app_scheduling_strategy/prod/stack.yaml b/base/examples/server/app_scheduling_strategy/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_scheduling_strategy/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_scheduling_strategy/project.yaml b/base/examples/server/app_scheduling_strategy/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_scheduling_strategy/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_secret/OWNERS b/base/examples/server/app_secret/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_secret/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_secret/README.md b/base/examples/server/app_secret/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_secret/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_secret/base/base.k b/base/examples/server/app_secret/base/base.k deleted file mode 100644 index 8064a84b..00000000 --- a/base/examples/server/app_secret/base/base.k +++ /dev/null @@ -1,11 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy.resource = res_tpl.tiny - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_secret/prod/ci-test/settings.yaml b/base/examples/server/app_secret/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_secret/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_secret/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_secret/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index e16b1408..00000000 --- a/base/examples/server/app_secret/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,76 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:sampleapp -- v1:Secret:sampleapp:sampleappprod0 -- v1:Secret:sampleapp:sampleappprod1 -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes ---- -attributes: - apiVersion: v1 - data: - ca.conf: ZG9tYWluSWQ9CmdhdGV3YXk9aHR0cDovL2xhYi5nYXRld2F5LmdhbGF4eS5teWJhbmsuY2 - kind: Secret - metadata: - name: sampleappprod0 - namespace: sampleapp - type: Opaque -dependsOn: -- v1:Namespace:sampleapp -id: v1:Secret:sampleapp:sampleappprod0 -type: Kubernetes ---- -attributes: - apiVersion: v1 - data: - token: cVZFZGowOGg1Zm5nbWlJS0FzMWw2OUhPUVdEd1pNeHo= - kind: Secret - metadata: - name: sampleappprod1 - namespace: sampleapp - type: Opaque -dependsOn: -- v1:Namespace:sampleapp -id: v1:Secret:sampleapp:sampleappprod1 -type: Kubernetes diff --git a/base/examples/server/app_secret/prod/kcl.yaml b/base/examples/server/app_secret/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_secret/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_secret/prod/main.k b/base/examples/server/app_secret/prod/main.k deleted file mode 100644 index 6458fac0..00000000 --- a/base/examples/server/app_secret/prod/main.k +++ /dev/null @@ -1,21 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.secret - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - secrets = [ - secret.Secret { - data = { - "ca.conf" = "ZG9tYWluSWQ9CmdhdGV3YXk9aHR0cDovL2xhYi5nYXRld2F5LmdhbGF4eS5teWJhbmsuY2" - } - type = "Opaque" - } - secret.Secret { - data = { - "token" = "cVZFZGowOGg1Zm5nbWlJS0FzMWw2OUhPUVdEd1pNeHo=" - } - type = "Opaque" - } - ] -} diff --git a/base/examples/server/app_secret/prod/stack.yaml b/base/examples/server/app_secret/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_secret/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_secret/project.yaml b/base/examples/server/app_secret/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_secret/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_service/OWNERS b/base/examples/server/app_service/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_service/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_service/README.md b/base/examples/server/app_service/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_service/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_service/base/base.k b/base/examples/server/app_service/base/base.k deleted file mode 100644 index 8064a84b..00000000 --- a/base/examples/server/app_service/base/base.k +++ /dev/null @@ -1,11 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy.resource = res_tpl.tiny - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_service/prod/ci-test/settings.yaml b/base/examples/server/app_service/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_service/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_service/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_service/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index 66d345bf..00000000 --- a/base/examples/server/app_service/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,67 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:sampleapp -- v1:Service:sampleapp:frontend -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Service - metadata: - name: frontend - namespace: sampleapp - spec: - ports: - - port: 80 - selector: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - type: NodePort -dependsOn: -- v1:Namespace:sampleapp -id: v1:Service:sampleapp:frontend -type: Kubernetes diff --git a/base/examples/server/app_service/prod/kcl.yaml b/base/examples/server/app_service/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_service/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_service/prod/main.k b/base/examples/server/app_service/prod/main.k deleted file mode 100644 index 4128515e..00000000 --- a/base/examples/server/app_service/prod/main.k +++ /dev/null @@ -1,18 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.service - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - services = [ - service.Service { - name = "frontend" - type = "NodePort" - ports = [ - { - "port" = 80 - } - ] - } - ] -} diff --git a/base/examples/server/app_service/prod/stack.yaml b/base/examples/server/app_service/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_service/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_service/project.yaml b/base/examples/server/app_service/project.yaml deleted file mode 100644 index e1470c72..00000000 --- a/base/examples/server/app_service/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen \ No newline at end of file diff --git a/base/examples/server/app_sidecar/OWNERS b/base/examples/server/app_sidecar/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_sidecar/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_sidecar/README.md b/base/examples/server/app_sidecar/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_sidecar/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_sidecar/base/base.k b/base/examples/server/app_sidecar/base/base.k deleted file mode 100644 index 8064a84b..00000000 --- a/base/examples/server/app_sidecar/base/base.k +++ /dev/null @@ -1,11 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy.resource = res_tpl.tiny - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_sidecar/prod/ci-test/settings.yaml b/base/examples/server/app_sidecar/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_sidecar/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_sidecar/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_sidecar/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index ba6bb795..00000000 --- a/base/examples/server/app_sidecar/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,67 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - - env: - - name: FILES_TO_COLLECT - value: /mnt/log/synthetic-count.log /mnt/log/synthetic-dates.log - image: gcr.io/google_containers/fluentd-sidecar-es:1.0 - name: sidecar-log-collector - volumeMounts: - - mountPath: /mnt/log - name: log-storage - readOnly: true - resources: - limits: - cpu: '1' - memory: 2Gi - ephemeral-storage: 20Gi - requests: - cpu: '1' - memory: 2Gi - ephemeral-storage: 20Gi - volumes: - - name: log-storage - emptyDir: {} -dependsOn: -- v1:Namespace:sampleapp -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_sidecar/prod/kcl.yaml b/base/examples/server/app_sidecar/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_sidecar/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_sidecar/prod/main.k b/base/examples/server/app_sidecar/prod/main.k deleted file mode 100644 index e99f9282..00000000 --- a/base/examples/server/app_sidecar/prod/main.k +++ /dev/null @@ -1,36 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.sidecar as s -import base.pkg.kusion_models.kube.frontend.container.env as e -import base.pkg.kusion_models.kube.frontend.volume as v -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - sidecarContainers = [ - s.Sidecar { - name = "sidecar-log-collector" - image = "gcr.io/google_containers/fluentd-sidecar-es:1.0" - env = [ - e.Env { - name = "FILES_TO_COLLECT" - value = "/mnt/log/synthetic-count.log /mnt/log/synthetic-dates.log" - } - ] - resource = res_tpl.small - } - ] - volumes = [ - v.Volume { - name = "log-storage" - volumeSource = v.EmptyDir {} - mounts = [ - v.Mount { - container = "sidecar-log-collector" - path = "/mnt/log" - readOnly = True - } - ] - } - ] -} diff --git a/base/examples/server/app_sidecar/prod/stack.yaml b/base/examples/server/app_sidecar/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_sidecar/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_sidecar/project.yaml b/base/examples/server/app_sidecar/project.yaml deleted file mode 100644 index 9f3bdc32..00000000 --- a/base/examples/server/app_sidecar/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen diff --git a/base/examples/server/app_stateful_set/OWNERS b/base/examples/server/app_stateful_set/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_stateful_set/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_stateful_set/README.md b/base/examples/server/app_stateful_set/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_stateful_set/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_stateful_set/base/base.k b/base/examples/server/app_stateful_set/base/base.k deleted file mode 100644 index 8064a84b..00000000 --- a/base/examples/server/app_stateful_set/base/base.k +++ /dev/null @@ -1,11 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy.resource = res_tpl.tiny - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_stateful_set/prod/ci-test/settings.yaml b/base/examples/server/app_stateful_set/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_stateful_set/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_stateful_set/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_stateful_set/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index db9bfc5c..00000000 --- a/base/examples/server/app_stateful_set/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,66 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: StatefulSet - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - serviceName: sampleappprod - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi -dependsOn: -- v1:Namespace:sampleapp -- v1:Service:sampleapp:sampleappprod -id: apps/v1:StatefulSet:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Service - metadata: - name: sampleappprod - namespace: sampleapp - spec: - clusterIP: None - selector: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name -dependsOn: -- v1:Namespace:sampleapp -id: v1:Service:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_stateful_set/prod/kcl.yaml b/base/examples/server/app_stateful_set/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_stateful_set/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_stateful_set/prod/main.k b/base/examples/server/app_stateful_set/prod/main.k deleted file mode 100644 index d640b76c..00000000 --- a/base/examples/server/app_stateful_set/prod/main.k +++ /dev/null @@ -1,7 +0,0 @@ -import base.pkg.kusion_models.kube.frontend - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - workloadType = "StatefulSet" -} diff --git a/base/examples/server/app_stateful_set/prod/stack.yaml b/base/examples/server/app_stateful_set/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_stateful_set/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_stateful_set/project.yaml b/base/examples/server/app_stateful_set/project.yaml deleted file mode 100644 index 9f3bdc32..00000000 --- a/base/examples/server/app_stateful_set/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen diff --git a/base/examples/server/app_volume/OWNERS b/base/examples/server/app_volume/OWNERS deleted file mode 100644 index e43b0f90..00000000 --- a/base/examples/server/app_volume/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: - - howieyuen \ No newline at end of file diff --git a/base/examples/server/app_volume/README.md b/base/examples/server/app_volume/README.md deleted file mode 100644 index 22d30aba..00000000 --- a/base/examples/server/app_volume/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# 前言 - -> 本 README.md 包括配置代码仓库目录/文件说明及如何本地使用 Kusion+Minikube 进行测试 - -## 快速开始 - -1. 查看应用目录 base/base.k 和 test/main.k 文件中的配置是否符合预期,如果不符合预期,可自行修改 - -```bash -# 进入应用目录 -cd demo -# 查看应用配置 -cat base/base.k -cat test/main.k -``` - -2. 编译(编译 .k 文件,生成 YAML) - -```bash -cd test/ci-test -make -# 查看编译结果 -cat stdout.golden.yaml -``` - -3. 集群测试:使用 kusionCtl 将 test/main.k 一键拍到 minikube 本地集群中 - -```bash -# test.kubeconfig 需要替换为测试集群的证书 -export KUBECONFIG=test.kubeconfig - -# 部署到集群 -make deploy - -# 查看拍到集群中的资源 -kubectl get deployment -n demo -kubectl get namespace - -# 删除拍到集群中的资源 -make undeploy -``` - -## 目录和文件说明 - -```bash -. -├── base // 各环境通用配置 -│   ├── base.k -├── prod // 环境目录 -│   └── ci-test // ci 测试目录,放置测试脚本和数据 -│     └── Makefile // 测试脚本 -│     └── settings.yaml // 测试数据和编译文件配置 -│     └── stdout.golden.yaml // 期望的 YAML,可通过 make 更新 -│   └── main.k // 应用在当前环境的配置清单 -│   └── stack.yaml -└── project.yaml // 应用基础信息 -└── README.md // 说明文档 -``` diff --git a/base/examples/server/app_volume/base/base.k b/base/examples/server/app_volume/base/base.k deleted file mode 100644 index 8064a84b..00000000 --- a/base/examples/server/app_volume/base/base.k +++ /dev/null @@ -1,11 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.templates.resource as res_tpl - -# Application Configuration -appConfiguration: frontend.Server { - # Main Container Configuration - mainContainer = container.Main {} - schedulingStrategy.resource = res_tpl.tiny - image = "gcr.io/google-samples/gb-frontend:v4" -} diff --git a/base/examples/server/app_volume/prod/ci-test/settings.yaml b/base/examples/server/app_volume/prod/ci-test/settings.yaml deleted file mode 100644 index a8e3d924..00000000 --- a/base/examples/server/app_volume/prod/ci-test/settings.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kcl_options: - - key: cluster - value: demo-cluster-name diff --git a/base/examples/server/app_volume/prod/ci-test/stdout.golden.yaml b/base/examples/server/app_volume/prod/ci-test/stdout.golden.yaml deleted file mode 100644 index d7fac6ef..00000000 --- a/base/examples/server/app_volume/prod/ci-test/stdout.golden.yaml +++ /dev/null @@ -1,52 +0,0 @@ -attributes: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: sampleappprod - namespace: sampleapp - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - template: - metadata: - labels: - app.kubernetes.io/env: prod - app.kubernetes.io/instance: sampleapp-prod - app.kubernetes.io/name: sampleapp - cluster.x-k8s.io/cluster-name: demo-cluster-name - spec: - containers: - - image: gcr.io/google-samples/gb-frontend:v4 - name: main - volumeMounts: - - mountPath: /home/admin/logs - name: log-volume - resources: - limits: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - requests: - cpu: 100m - memory: 100Mi - ephemeral-storage: 1Gi - volumes: - - name: log-volume - emptyDir: {} -dependsOn: -- v1:Namespace:sampleapp -id: apps/v1:Deployment:sampleapp:sampleappprod -type: Kubernetes ---- -attributes: - apiVersion: v1 - kind: Namespace - metadata: - name: sampleapp -id: v1:Namespace:sampleapp -type: Kubernetes diff --git a/base/examples/server/app_volume/prod/kcl.yaml b/base/examples/server/app_volume/prod/kcl.yaml deleted file mode 100644 index e3f8d8d8..00000000 --- a/base/examples/server/app_volume/prod/kcl.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kcl_cli_configs: - file: - - ${KCL_MOD}/base/pkg/kusion_models/kube/metadata/metadata.k - - ../base/base.k - - main.k - - ${KCL_MOD}/base/pkg/kusion_models/kube/render/render.k diff --git a/base/examples/server/app_volume/prod/main.k b/base/examples/server/app_volume/prod/main.k deleted file mode 100644 index b01c5140..00000000 --- a/base/examples/server/app_volume/prod/main.k +++ /dev/null @@ -1,19 +0,0 @@ -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.frontend.volume as v - -# The application configuration in stack will overwrite -# the configuration with the same attribute in base. -appConfiguration: frontend.Server { - volumes = [ - v.Volume { - name = "log-volume" - volumeSource = v.EmptyDir {} - mounts = [ - v.Mount { - container = "main" - path = "/home/admin/logs" - } - ] - } - ] -} diff --git a/base/examples/server/app_volume/prod/stack.yaml b/base/examples/server/app_volume/prod/stack.yaml deleted file mode 100644 index 55617733..00000000 --- a/base/examples/server/app_volume/prod/stack.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# The stack basic info -name: prod diff --git a/base/examples/server/app_volume/project.yaml b/base/examples/server/app_volume/project.yaml deleted file mode 100644 index 9f3bdc32..00000000 --- a/base/examples/server/app_volume/project.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The project basic info -name: sampleapp -tenant: howieyuen diff --git a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/mutating_webhook.k b/base/pkg/kusion_kubernetes/api/admissionregistration/v1/mutating_webhook.k deleted file mode 100644 index 7399a9bf..00000000 --- a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/mutating_webhook.k +++ /dev/null @@ -1,100 +0,0 @@ -""" -This is the mutating_webhook module in kusion_kubernetes.api.admissionregistration.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema MutatingWebhook: - """ MutatingWebhook describes an admission webhook and the resources and operations it applies to. - - Attributes - ---------- - admissionReviewVersions : [str], default is Undefined, required - 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. - failurePolicy : str, default is Undefined, optional - FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. - matchPolicy : str, default is Undefined, 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 : str, default is Undefined, 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. Required. - reinvocationPolicy : str, default is Undefined, 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". - rules : [RuleWithOperations], default is Undefined, optional - 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. - sideEffects : str, default is Undefined, 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 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. - timeoutSeconds : int, default is Undefined, 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. - clientConfig : WebhookClientConfig, default is Undefined, required - ClientConfig defines how to communicate with the hook. Required - namespaceSelector : apis.LabelSelector, default is Undefined, 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. - objectSelector : apis.LabelSelector, default is Undefined, 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. - """ - - - admissionReviewVersions: [str] - - failurePolicy?: str - - matchPolicy?: str - - name: str - - reinvocationPolicy?: str - - rules?: [RuleWithOperations] - - sideEffects: str - - timeoutSeconds?: int - - clientConfig: WebhookClientConfig - - namespaceSelector?: apis.LabelSelector - - objectSelector?: apis.LabelSelector - - diff --git a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/rule_with_operations.k b/base/pkg/kusion_kubernetes/api/admissionregistration/v1/rule_with_operations.k deleted file mode 100644 index 4bd3b6f7..00000000 --- a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/rule_with_operations.k +++ /dev/null @@ -1,41 +0,0 @@ -""" -This is the rule_with_operations module in kusion_kubernetes.api.admissionregistration.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema RuleWithOperations: - """ RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid. - - Attributes - ---------- - apiGroups : [str], default is Undefined, optional - APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required. - apiVersions : [str], default is Undefined, optional - APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required. - operations : [str], default is Undefined, optional - 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 : [str], default is Undefined, optional - Resources is a list of resources this rule applies to. - - For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources. - - If wildcard is present, the validation rule will ensure resources do not overlap with each other. - Depending on the enclosing object, subresources might not be allowed. Required. - scope : str, default is Undefined, optional - 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 "*". - """ - - - apiGroups?: [str] - - apiVersions?: [str] - - operations?: [str] - - resources?: [str] - - scope?: str - - diff --git a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/service_reference.k b/base/pkg/kusion_kubernetes/api/admissionregistration/v1/service_reference.k deleted file mode 100644 index 33736543..00000000 --- a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/service_reference.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the service_reference module in kusion_kubernetes.api.admissionregistration.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ServiceReference: - """ ServiceReference holds a reference to Service.legacy.k8s.io - - Attributes - ---------- - name : str, default is Undefined, required - `name` is the name of the service. Required - namespace : str, default is Undefined, required - `namespace` is the namespace of the service. Required - path : str, default is Undefined, optional - `path` is an optional URL path which will be sent in any request to this service. - port : int, default is Undefined, 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). - """ - - - name: str - - namespace: str - - path?: str - - port?: int - - diff --git a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/validating_webhook.k b/base/pkg/kusion_kubernetes/api/admissionregistration/v1/validating_webhook.k deleted file mode 100644 index e6182241..00000000 --- a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/validating_webhook.k +++ /dev/null @@ -1,91 +0,0 @@ -""" -This is the validating_webhook module in kusion_kubernetes.api.admissionregistration.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema ValidatingWebhook: - """ ValidatingWebhook describes an admission webhook and the resources and operations it applies to. - - Attributes - ---------- - admissionReviewVersions : [str], default is Undefined, required - 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. - failurePolicy : str, default is Undefined, optional - FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. - matchPolicy : str, default is Undefined, 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 : str, default is Undefined, 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. Required. - rules : [RuleWithOperations], default is Undefined, optional - 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. - sideEffects : str, default is Undefined, 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 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. - timeoutSeconds : int, default is Undefined, 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. - clientConfig : WebhookClientConfig, default is Undefined, required - ClientConfig defines how to communicate with the hook. Required - namespaceSelector : apis.LabelSelector, default is Undefined, 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. - objectSelector : apis.LabelSelector, default is Undefined, 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. - """ - - - admissionReviewVersions: [str] - - failurePolicy?: str - - matchPolicy?: str - - name: str - - rules?: [RuleWithOperations] - - sideEffects: str - - timeoutSeconds?: int - - clientConfig: WebhookClientConfig - - namespaceSelector?: apis.LabelSelector - - objectSelector?: apis.LabelSelector - - diff --git a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/webhook_client_config.k b/base/pkg/kusion_kubernetes/api/admissionregistration/v1/webhook_client_config.k deleted file mode 100644 index c2b10bcb..00000000 --- a/base/pkg/kusion_kubernetes/api/admissionregistration/v1/webhook_client_config.k +++ /dev/null @@ -1,38 +0,0 @@ -""" -This is the webhook_client_config module in kusion_kubernetes.api.admissionregistration.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema WebhookClientConfig: - """ WebhookClientConfig contains the information to make a TLS connection with the webhook - - Attributes - ---------- - caBundle : str, default is Undefined, optional - `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. - url : str, default is Undefined, optional - `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 : ServiceReference, default is Undefined, optional - `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`. - """ - - - caBundle?: str - - url?: str - - service?: ServiceReference - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set.k b/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set.k deleted file mode 100644 index 83461c11..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the daemon_set module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema DaemonSet: - """ DaemonSet represents the configuration of a daemon set. - - Attributes - ---------- - apiVersion : "apps/v1", default is "apps/v1", required - 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 - kind : "DaemonSet", default is "DaemonSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : DaemonSetSpec, default is Undefined, optional - The desired behavior of this daemon set. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - apiVersion: "apps/v1" = "apps/v1" - - kind: "DaemonSet" = "DaemonSet" - - metadata?: apis.ObjectMeta - - spec?: DaemonSetSpec - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set_spec.k b/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set_spec.k deleted file mode 100644 index 20412b0a..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set_spec.k +++ /dev/null @@ -1,38 +0,0 @@ -""" -This is the daemon_set_spec module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 - - -schema DaemonSetSpec: - """ DaemonSetSpec is the specification of a daemon set. - - Attributes - ---------- - minReadySeconds : int, default is Undefined, optional - The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready). - revisionHistoryLimit : int, default is Undefined, optional - The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. - selector : apis.LabelSelector, default is Undefined, required - A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - template : v1.PodTemplateSpec, default is Undefined, required - 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/replicationcontroller#pod-template - updateStrategy : DaemonSetUpdateStrategy, default is Undefined, optional - An update strategy to replace existing DaemonSet pods with new pods. - """ - - - minReadySeconds?: int - - revisionHistoryLimit?: int - - selector: apis.LabelSelector - - template: v1.PodTemplateSpec - - updateStrategy?: DaemonSetUpdateStrategy - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set_update_strategy.k b/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set_update_strategy.k deleted file mode 100644 index 8f9eba05..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/daemon_set_update_strategy.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the daemon_set_update_strategy module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema DaemonSetUpdateStrategy: - """ DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate. - rollingUpdate : RollingUpdateDaemonSet, default is Undefined, optional - Rolling update config params. Present only if type = "RollingUpdate". - """ - - - $type?: str - - rollingUpdate?: RollingUpdateDaemonSet - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/deployment.k b/base/pkg/kusion_kubernetes/api/apps/v1/deployment.k deleted file mode 100644 index a6b8fc0a..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/deployment.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the deployment module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Deployment: - """ Deployment enables declarative updates for Pods and ReplicaSets. - - Attributes - ---------- - apiVersion : "apps/v1", default is "apps/v1", required - 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 - kind : "Deployment", default is "Deployment", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : DeploymentSpec, default is Undefined, optional - Specification of the desired behavior of the Deployment. - """ - - - apiVersion: "apps/v1" = "apps/v1" - - kind: "Deployment" = "Deployment" - - metadata?: apis.ObjectMeta - - spec?: DeploymentSpec - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/deployment_spec.k b/base/pkg/kusion_kubernetes/api/apps/v1/deployment_spec.k deleted file mode 100644 index 04a5d324..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/deployment_spec.k +++ /dev/null @@ -1,50 +0,0 @@ -""" -This is the deployment_spec module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 - - -schema DeploymentSpec: - """ DeploymentSpec is the specification of the desired behavior of the Deployment. - - Attributes - ---------- - minReadySeconds : int, default is Undefined, 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 : bool, default is Undefined, optional - Indicates that the deployment is paused. - progressDeadlineSeconds : int, default is Undefined, 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 : int, default is Undefined, optional - Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. - revisionHistoryLimit : int, default is Undefined, 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. - selector : apis.LabelSelector, default is Undefined, required - Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. - strategy : DeploymentStrategy, default is Undefined, optional - The deployment strategy to use to replace existing pods with new ones. - template : v1.PodTemplateSpec, default is Undefined, required - Template describes the pods that will be created. - """ - - - minReadySeconds?: int - - paused?: bool - - progressDeadlineSeconds?: int - - replicas?: int - - revisionHistoryLimit?: int - - selector: apis.LabelSelector - - strategy?: DeploymentStrategy - - template: v1.PodTemplateSpec - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/deployment_strategy.k b/base/pkg/kusion_kubernetes/api/apps/v1/deployment_strategy.k deleted file mode 100644 index b5b65516..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/deployment_strategy.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the deployment_strategy module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema DeploymentStrategy: - """ DeploymentStrategy describes how to replace existing pods with new ones. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - rollingUpdate : RollingUpdateDeployment, default is Undefined, optional - Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate. - """ - - - $type?: str - - rollingUpdate?: RollingUpdateDeployment - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_daemon_set.k b/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_daemon_set.k deleted file mode 100644 index c28ed633..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_daemon_set.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the rolling_update_daemon_set module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema RollingUpdateDaemonSet: - """ Spec to control the desired behavior of daemon set rolling update. - - Attributes - ---------- - maxSurge : int | str, default is Undefined, optional - The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate. - maxUnavailable : int | str, default is Undefined, optional - The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update. - """ - - - maxSurge?: int | str - - maxUnavailable?: int | str - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_deployment.k b/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_deployment.k deleted file mode 100644 index f63d3e17..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_deployment.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the rolling_update_deployment module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema RollingUpdateDeployment: - """ Spec to control the desired behavior of rolling update. - - Attributes - ---------- - maxSurge : int | str, default is Undefined, optional - The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods. - maxUnavailable : int | str, default is Undefined, optional - The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods. - """ - - - maxSurge?: int | str - - maxUnavailable?: int | str - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_stateful_set_strategy.k b/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_stateful_set_strategy.k deleted file mode 100644 index 674a1016..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/rolling_update_stateful_set_strategy.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the rolling_update_stateful_set_strategy module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema RollingUpdateStatefulSetStrategy: - """ RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. - - Attributes - ---------- - partition : int, default is Undefined, optional - Partition indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0. - """ - - - partition?: int - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set.k b/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set.k deleted file mode 100644 index 677b9f9f..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set.k +++ /dev/null @@ -1,35 +0,0 @@ -""" -This is the stateful_set module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema StatefulSet: - """ StatefulSet represents a set of pods with consistent identities. Identities are defined as: - - Network: A single stable DNS and hostname. - - Storage: As many VolumeClaims as requested.The StatefulSet guarantees that a given network identity will always map to the same storage identity. - - Attributes - ---------- - apiVersion : "apps/v1", default is "apps/v1", required - 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 - kind : "StatefulSet", default is "StatefulSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : StatefulSetSpec, default is Undefined, optional - Spec defines the desired identities of pods in this set. - """ - - - apiVersion: "apps/v1" = "apps/v1" - - kind: "StatefulSet" = "StatefulSet" - - metadata?: apis.ObjectMeta - - spec?: StatefulSetSpec - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set_spec.k b/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set_spec.k deleted file mode 100644 index 53cee343..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set_spec.k +++ /dev/null @@ -1,54 +0,0 @@ -""" -This is the stateful_set_spec module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 - - -schema StatefulSetSpec: - """ A StatefulSetSpec is the specification of a StatefulSet. - - Attributes - ---------- - minReadySeconds : int, default is Undefined, 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) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. - podManagementPolicy : str, default is Undefined, 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. - replicas : int, default is Undefined, optional - replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. - revisionHistoryLimit : int, default is Undefined, optional - revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. - serviceName : str, default is Undefined, required - serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller. - volumeClaimTemplates : [v1.PersistentVolumeClaim], default is Undefined, optional - volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. - selector : apis.LabelSelector, default is Undefined, required - selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - template : v1.PodTemplateSpec, default is Undefined, required - template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. - updateStrategy : StatefulSetUpdateStrategy, default is Undefined, optional - updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - """ - - - minReadySeconds?: int - - podManagementPolicy?: str - - replicas?: int - - revisionHistoryLimit?: int - - serviceName: str - - volumeClaimTemplates?: [v1.PersistentVolumeClaim] - - selector: apis.LabelSelector - - template: v1.PodTemplateSpec - - updateStrategy?: StatefulSetUpdateStrategy - - diff --git a/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set_update_strategy.k b/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set_update_strategy.k deleted file mode 100644 index ce11279f..00000000 --- a/base/pkg/kusion_kubernetes/api/apps/v1/stateful_set_update_strategy.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the stateful_set_update_strategy module in kusion_kubernetes.api.apps.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema StatefulSetUpdateStrategy: - """ StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate. - rollingUpdate : RollingUpdateStatefulSetStrategy, default is Undefined, optional - RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - """ - - - $type?: str - - rollingUpdate?: RollingUpdateStatefulSetStrategy - - diff --git a/base/pkg/kusion_kubernetes/api/autoscaling/v1/cross_version_object_reference.k b/base/pkg/kusion_kubernetes/api/autoscaling/v1/cross_version_object_reference.k deleted file mode 100644 index 3f532654..00000000 --- a/base/pkg/kusion_kubernetes/api/autoscaling/v1/cross_version_object_reference.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the cross_version_object_reference module in kusion_kubernetes.api.autoscaling.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema CrossVersionObjectReference: - """ CrossVersionObjectReference contains enough information to let you identify the referred resource. - - Attributes - ---------- - apiVersion : str, default is Undefined, optional - API version of the referent - kind : str, default is Undefined, required - Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - name : str, default is Undefined, required - Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names - """ - - - apiVersion?: str - - kind: str - - name: str - - diff --git a/base/pkg/kusion_kubernetes/api/autoscaling/v1/horizontal_pod_autoscaler.k b/base/pkg/kusion_kubernetes/api/autoscaling/v1/horizontal_pod_autoscaler.k deleted file mode 100644 index 642d3b60..00000000 --- a/base/pkg/kusion_kubernetes/api/autoscaling/v1/horizontal_pod_autoscaler.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the horizontal_pod_autoscaler module in kusion_kubernetes.api.autoscaling.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema HorizontalPodAutoscaler: - """ configuration of a horizontal pod autoscaler. - - Attributes - ---------- - apiVersion : "autoscaling/v1", default is "autoscaling/v1", required - 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 - kind : "HorizontalPodAutoscaler", default is "HorizontalPodAutoscaler", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : HorizontalPodAutoscalerSpec, default is Undefined, optional - behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - """ - - - apiVersion: "autoscaling/v1" = "autoscaling/v1" - - kind: "HorizontalPodAutoscaler" = "HorizontalPodAutoscaler" - - metadata?: apis.ObjectMeta - - spec?: HorizontalPodAutoscalerSpec - - diff --git a/base/pkg/kusion_kubernetes/api/autoscaling/v1/horizontal_pod_autoscaler_spec.k b/base/pkg/kusion_kubernetes/api/autoscaling/v1/horizontal_pod_autoscaler_spec.k deleted file mode 100644 index f94cfbf1..00000000 --- a/base/pkg/kusion_kubernetes/api/autoscaling/v1/horizontal_pod_autoscaler_spec.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the horizontal_pod_autoscaler_spec module in kusion_kubernetes.api.autoscaling.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HorizontalPodAutoscalerSpec: - """ specification of a horizontal pod autoscaler. - - Attributes - ---------- - maxReplicas : int, default is Undefined, required - upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. - minReplicas : int, default is Undefined, optional - minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available. - targetCPUUtilizationPercentage : int, default is Undefined, 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. - scaleTargetRef : CrossVersionObjectReference, default is Undefined, required - reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource. - """ - - - maxReplicas: int - - minReplicas?: int - - targetCPUUtilizationPercentage?: int - - scaleTargetRef: CrossVersionObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/batch/v1/job.k b/base/pkg/kusion_kubernetes/api/batch/v1/job.k deleted file mode 100644 index 341fba27..00000000 --- a/base/pkg/kusion_kubernetes/api/batch/v1/job.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the job module in kusion_kubernetes.api.batch.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Job: - """ Job represents the configuration of a single job. - - Attributes - ---------- - apiVersion : "batch/v1", default is "batch/v1", required - 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 - kind : "Job", default is "Job", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : JobSpec, default is Undefined, optional - Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - apiVersion: "batch/v1" = "batch/v1" - - kind: "Job" = "Job" - - metadata?: apis.ObjectMeta - - spec?: JobSpec - - diff --git a/base/pkg/kusion_kubernetes/api/batch/v1/job_spec.k b/base/pkg/kusion_kubernetes/api/batch/v1/job_spec.k deleted file mode 100644 index 18b2c0f9..00000000 --- a/base/pkg/kusion_kubernetes/api/batch/v1/job_spec.k +++ /dev/null @@ -1,64 +0,0 @@ -""" -This is the job_spec module in kusion_kubernetes.api.batch.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 - - -schema JobSpec: - """ JobSpec describes how the job execution will look like. - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, optional - Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again. - backoffLimit : int, default is Undefined, optional - Specifies the number of retries before marking this job failed. Defaults to 6 - completionMode : str, default is Undefined, optional - CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. - - `NonIndexed` means that the Job is considered complete when there have been .spec.completions successfully completed Pods. Each Pod completion is homologous to each other. - - `Indexed` means that the Pods of a Job get an associated completion index from 0 to (.spec.completions - 1), available in the annotation batch.kubernetes.io/job-completion-index. The Job is considered complete when there is one successfully completed Pod for each index. When value is `Indexed`, .spec.completions must be specified and `.spec.parallelism` must be less than or equal to 10^5. In addition, The Pod name takes the form `$(job-name)-$(index)-$(random-string)`, the Pod hostname takes the form `$(job-name)-$(index)`. - This field is beta-level. More completion modes can be added in the future. If the Job controller observes a mode that it doesn't recognize, the controller skips updates for the Job. - completions : int, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - manualSelector : bool, default is Undefined, optional - manualSelector 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. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector - parallelism : int, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - suspend : bool, default is Undefined, optional - Suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false. - This field is beta-level, gated by SuspendJob feature flag (enabled by default). - ttlSecondsAfterFinished : int, default is Undefined, 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. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature. - selector : apis.LabelSelector, default is Undefined, optional - A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - template : v1.PodTemplateSpec, default is Undefined, required - Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - """ - - - activeDeadlineSeconds?: int - - backoffLimit?: int - - completionMode?: str - - completions?: int - - manualSelector?: bool - - parallelism?: int - - suspend?: bool - - ttlSecondsAfterFinished?: int - - selector?: apis.LabelSelector - - template: v1.PodTemplateSpec - - diff --git a/base/pkg/kusion_kubernetes/api/batch/v1beta1/cron_job.k b/base/pkg/kusion_kubernetes/api/batch/v1beta1/cron_job.k deleted file mode 100644 index d93b4e51..00000000 --- a/base/pkg/kusion_kubernetes/api/batch/v1beta1/cron_job.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the cron_job module in kusion_kubernetes.api.batch.v1beta1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema CronJob: - """ CronJob represents the configuration of a single cron job. - - Attributes - ---------- - apiVersion : "batch/v1beta1", default is "batch/v1beta1", required - 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 - kind : "CronJob", default is "CronJob", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : CronJobSpec, default is Undefined, optional - Specification of the desired behavior of a cron job, including the schedule. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - apiVersion: "batch/v1beta1" = "batch/v1beta1" - - kind: "CronJob" = "CronJob" - - metadata?: apis.ObjectMeta - - spec?: CronJobSpec - - diff --git a/base/pkg/kusion_kubernetes/api/batch/v1beta1/cron_job_spec.k b/base/pkg/kusion_kubernetes/api/batch/v1beta1/cron_job_spec.k deleted file mode 100644 index ed305811..00000000 --- a/base/pkg/kusion_kubernetes/api/batch/v1beta1/cron_job_spec.k +++ /dev/null @@ -1,44 +0,0 @@ -""" -This is the cron_job_spec module in kusion_kubernetes.api.batch.v1beta1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema CronJobSpec: - """ CronJobSpec describes how the job execution will look like and when it will actually run. - - Attributes - ---------- - concurrencyPolicy : str, default is Undefined, 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 - failedJobsHistoryLimit : int, default is Undefined, optional - The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. - schedule : str, default is Undefined, required - The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. - startingDeadlineSeconds : int, default is Undefined, optional - 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. - successfulJobsHistoryLimit : int, default is Undefined, 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 : bool, default is Undefined, optional - This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. - jobTemplate : JobTemplateSpec, default is Undefined, required - Specifies the job that will be created when executing a CronJob. - """ - - - concurrencyPolicy?: str - - failedJobsHistoryLimit?: int - - schedule: str - - startingDeadlineSeconds?: int - - successfulJobsHistoryLimit?: int - - suspend?: bool - - jobTemplate: JobTemplateSpec - - diff --git a/base/pkg/kusion_kubernetes/api/batch/v1beta1/job_template_spec.k b/base/pkg/kusion_kubernetes/api/batch/v1beta1/job_template_spec.k deleted file mode 100644 index 7e3c6a62..00000000 --- a/base/pkg/kusion_kubernetes/api/batch/v1beta1/job_template_spec.k +++ /dev/null @@ -1,26 +0,0 @@ -""" -This is the job_template_spec module in kusion_kubernetes.api.batch.v1beta1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.api.batch.v1 -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema JobTemplateSpec: - """ JobTemplateSpec describes the data a Job should have when created from a template - - Attributes - ---------- - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata of the jobs created from this template. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : v1.JobSpec, default is Undefined, optional - Specification of the desired behavior of the job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - metadata?: apis.ObjectMeta - - spec?: v1.JobSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/affinity.k b/base/pkg/kusion_kubernetes/api/core/v1/affinity.k deleted file mode 100644 index b3e4406d..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/affinity.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the affinity module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Affinity: - """ Affinity is a group of affinity scheduling rules. - - Attributes - ---------- - nodeAffinity : NodeAffinity, default is Undefined, optional - Describes node affinity scheduling rules for the pod. - podAffinity : PodAffinity, default is Undefined, optional - Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - podAntiAffinity : PodAntiAffinity, default is Undefined, optional - Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - """ - - - nodeAffinity?: NodeAffinity - - podAffinity?: PodAffinity - - podAntiAffinity?: PodAntiAffinity - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/aws_elastic_block_store_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/aws_elastic_block_store_volume_source.k deleted file mode 100644 index 2aa6648d..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/aws_elastic_block_store_volume_source.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the aws_elastic_block_store_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AWSElasticBlockStoreVolumeSource: - """ Represents a Persistent Disk resource in AWS. - An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - fsType : str, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - partition : int, default is Undefined, 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). - readOnly : bool, default is Undefined, optional - Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - volumeID : str, default is Undefined, required - Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - """ - - - fsType?: str - - partition?: int - - readOnly?: bool - - volumeID: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/azure_disk_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/azure_disk_volume_source.k deleted file mode 100644 index 2c2f4152..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/azure_disk_volume_source.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This is the azure_disk_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AzureDiskVolumeSource: - """ AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - - Attributes - ---------- - cachingMode : str, default is Undefined, optional - Host Caching mode: None, Read Only, Read Write. - diskName : str, default is Undefined, required - The Name of the data disk in the blob storage - diskURI : str, default is Undefined, required - The URI the data disk in the blob storage - fsType : str, default is Undefined, 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. - kind : str, default is Undefined, optional - Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared - readOnly : bool, default is Undefined, optional - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - """ - - - cachingMode?: str - - diskName: str - - diskURI: str - - fsType?: str - - kind?: str - - readOnly?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/azure_file_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/azure_file_volume_source.k deleted file mode 100644 index 8d108482..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/azure_file_volume_source.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the azure_file_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AzureFileVolumeSource: - """ AzureFile represents an Azure File Service mount on the host and bind mount to the pod. - - Attributes - ---------- - readOnly : bool, default is Undefined, optional - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - secretName : str, default is Undefined, required - the name of secret that contains Azure Storage Account Name and Key - shareName : str, default is Undefined, required - Share Name - """ - - - readOnly?: bool - - secretName: str - - shareName: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/capabilities.k b/base/pkg/kusion_kubernetes/api/core/v1/capabilities.k deleted file mode 100644 index daee7d90..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/capabilities.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the capabilities module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Capabilities: - """ Adds and removes POSIX capabilities from running containers. - - Attributes - ---------- - add : [str], default is Undefined, optional - Added capabilities - drop : [str], default is Undefined, optional - Removed capabilities - """ - - - add?: [str] - - drop?: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/ceph_fs_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/ceph_fs_volume_source.k deleted file mode 100644 index bb4b64e8..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/ceph_fs_volume_source.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This is the ceph_fs_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema CephFSVolumeSource: - """ Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling. - - Attributes - ---------- - monitors : [str], default is Undefined, required - Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - path : str, default is Undefined, optional - Optional: Used as the mounted root, rather than the full Ceph tree, default is / - readOnly : bool, default is Undefined, optional - Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - secretFile : str, default is Undefined, optional - Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - user : str, default is Undefined, optional - Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - secretRef : LocalObjectReference, default is Undefined, optional - Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - """ - - - monitors: [str] - - path?: str - - readOnly?: bool - - secretFile?: str - - user?: str - - secretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/cinder_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/cinder_volume_source.k deleted file mode 100644 index 2d1ddf36..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/cinder_volume_source.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the cinder_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema CinderVolumeSource: - """ Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - fsType : str, default is Undefined, 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. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - readOnly : bool, default is Undefined, optional - Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - volumeID : str, default is Undefined, required - volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - secretRef : LocalObjectReference, default is Undefined, optional - Optional: points to a secret object containing parameters used to connect to OpenStack. - """ - - - fsType?: str - - readOnly?: bool - - volumeID: str - - secretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/client_ip_config.k b/base/pkg/kusion_kubernetes/api/core/v1/client_ip_config.k deleted file mode 100644 index cccc9513..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/client_ip_config.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the client_ip_config module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ClientIPConfig: - """ ClientIPConfig represents the configurations of Client IP based session affinity. - - Attributes - ---------- - timeoutSeconds : int, default is Undefined, optional - timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". Default value is 10800(for 3 hours). - """ - - - timeoutSeconds?: int - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/config_map.k b/base/pkg/kusion_kubernetes/api/core/v1/config_map.k deleted file mode 100644 index 91bc4d2b..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/config_map.k +++ /dev/null @@ -1,41 +0,0 @@ -""" -This is the config_map module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema ConfigMap: - """ ConfigMap holds configuration data for pods to consume. - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - binaryData : {str:str}, default is Undefined, 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. - data : {str:str}, default is Undefined, 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 : bool, default is Undefined, 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. - kind : "ConfigMap", default is "ConfigMap", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - """ - - - apiVersion: "v1" = "v1" - - binaryData?: {str:str} - - data?: {str:str} - - immutable?: bool - - kind: "ConfigMap" = "ConfigMap" - - metadata?: apis.ObjectMeta - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/config_map_env_source.k b/base/pkg/kusion_kubernetes/api/core/v1/config_map_env_source.k deleted file mode 100644 index c1359d19..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/config_map_env_source.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the config_map_env_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ConfigMapEnvSource: - """ ConfigMapEnvSource selects a ConfigMap to populate the environment variables with. - The contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables. - - Attributes - ---------- - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the ConfigMap must be defined - """ - - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/config_map_key_selector.k b/base/pkg/kusion_kubernetes/api/core/v1/config_map_key_selector.k deleted file mode 100644 index a62efd48..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/config_map_key_selector.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the config_map_key_selector module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ConfigMapKeySelector: - """ Selects a key from a ConfigMap. - - Attributes - ---------- - key : str, default is Undefined, required - The key to select. - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the ConfigMap or its key must be defined - """ - - - key: str - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/config_map_node_config_source.k b/base/pkg/kusion_kubernetes/api/core/v1/config_map_node_config_source.k deleted file mode 100644 index 0c57a069..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/config_map_node_config_source.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the config_map_node_config_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ConfigMapNodeConfigSource: - """ ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration - - Attributes - ---------- - kubeletConfigKey : str, default is Undefined, required - KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases. - name : str, default is Undefined, required - Name is the metadata.name of the referenced ConfigMap. This field is required in all cases. - namespace : str, default is Undefined, required - Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases. - resourceVersion : str, default is Undefined, optional - ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status. - uid : str, default is Undefined, optional - UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status. - """ - - - kubeletConfigKey: str - - name: str - - namespace: str - - resourceVersion?: str - - uid?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/config_map_projection.k b/base/pkg/kusion_kubernetes/api/core/v1/config_map_projection.k deleted file mode 100644 index 88fde66e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/config_map_projection.k +++ /dev/null @@ -1,29 +0,0 @@ -""" -This is the config_map_projection module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ConfigMapProjection: - """ 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. - - Attributes - ---------- - items : [KeyToPath], default is Undefined, 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 : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the ConfigMap or its keys must be defined - """ - - - items?: [KeyToPath] - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/config_map_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/config_map_volume_source.k deleted file mode 100644 index c1f21cf5..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/config_map_volume_source.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the config_map_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ConfigMapVolumeSource: - """ Adapts a ConfigMap into a volume. - The contents of the target ConfigMap's Data field will be presented in a 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. ConfigMap volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - defaultMode : int, default is Undefined, optional - Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - items : [KeyToPath], default is Undefined, 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 : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the ConfigMap or its keys must be defined - """ - - - defaultMode?: int - - items?: [KeyToPath] - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/container.k b/base/pkg/kusion_kubernetes/api/core/v1/container.k deleted file mode 100644 index a9ec8542..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/container.k +++ /dev/null @@ -1,104 +0,0 @@ -""" -This is the container module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Container: - """ A single application container that you want to run within a pod. - - Attributes - ---------- - args : [str], default is Undefined, 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - command : [str], default is Undefined, 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - env : [EnvVar], default is Undefined, optional - List of environment variables to set in the container. Cannot be updated. - envFrom : [EnvFromSource], default is Undefined, 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 : str, default is Undefined, optional - Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets. - imagePullPolicy : str, default is Undefined, optional - 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 - name : str, default is Undefined, 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. - ports : [ContainerPort], default is Undefined, 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. - stdin : bool, default is Undefined, 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. Default is false. - stdinOnce : bool, default is Undefined, 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. Default is false - terminationMessagePath : str, default is Undefined, 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. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated. - terminationMessagePolicy : str, default is Undefined, 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 : bool, default is Undefined, optional - Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - volumeDevices : [VolumeDevice], default is Undefined, optional - volumeDevices is the list of block devices to be used by the container. - volumeMounts : [VolumeMount], default is Undefined, optional - Pod volumes to mount into the container's filesystem. Cannot be updated. - workingDir : str, default is Undefined, 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. - lifecycle : Lifecycle, default is Undefined, optional - Actions that the management system should take in response to container lifecycle events. Cannot be updated. - livenessProbe : Probe, default is Undefined, optional - 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 - readinessProbe : Probe, default is Undefined, optional - 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 - resources : ResourceRequirements, default is Undefined, optional - Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - securityContext : SecurityContext, default is Undefined, optional - SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - startupProbe : Probe, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - """ - - - args?: [str] - - command?: [str] - - env?: [EnvVar] - - envFrom?: [EnvFromSource] - - image?: str - - imagePullPolicy?: str - - name: str - - ports?: [ContainerPort] - - stdin?: bool - - stdinOnce?: bool - - terminationMessagePath?: str - - terminationMessagePolicy?: str - - tty?: bool - - volumeDevices?: [VolumeDevice] - - volumeMounts?: [VolumeMount] - - workingDir?: str - - lifecycle?: Lifecycle - - livenessProbe?: Probe - - readinessProbe?: Probe - - resources?: ResourceRequirements - - securityContext?: SecurityContext - - startupProbe?: Probe - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/container_port.k b/base/pkg/kusion_kubernetes/api/core/v1/container_port.k deleted file mode 100644 index e24ac8e7..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/container_port.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the container_port module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ContainerPort: - """ ContainerPort represents a network port in a single container. - - Attributes - ---------- - containerPort : int, default is Undefined, required - Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - hostIP : str, default is Undefined, optional - What host IP to bind the external port to. - hostPort : int, default is Undefined, 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 : str, default is Undefined, 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 : str, default is Undefined, optional - Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - """ - - - containerPort: int - - hostIP?: str - - hostPort?: int - - name?: str - - $protocol?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/csi_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/csi_volume_source.k deleted file mode 100644 index 16f01ad2..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/csi_volume_source.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the csi_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema CSIVolumeSource: - """ Represents a source location of a volume to mount, managed by an external CSI driver - - Attributes - ---------- - driver : str, default is Undefined, required - Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. - fsType : str, default is Undefined, optional - Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. - readOnly : bool, default is Undefined, optional - Specifies a read-only configuration for the volume. Defaults to false (read/write). - volumeAttributes : {str:str}, default is Undefined, optional - VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. - nodePublishSecretRef : LocalObjectReference, default is Undefined, optional - NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. - """ - - - driver: str - - fsType?: str - - readOnly?: bool - - volumeAttributes?: {str:str} - - nodePublishSecretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/downward_api_projection.k b/base/pkg/kusion_kubernetes/api/core/v1/downward_api_projection.k deleted file mode 100644 index 10f2ab10..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/downward_api_projection.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the downward_api_projection module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema DownwardAPIProjection: - """ Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode. - - Attributes - ---------- - items : [DownwardAPIVolumeFile], default is Undefined, optional - Items is a list of DownwardAPIVolume file - """ - - - items?: [DownwardAPIVolumeFile] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/downward_api_volume_file.k b/base/pkg/kusion_kubernetes/api/core/v1/downward_api_volume_file.k deleted file mode 100644 index d5ac8108..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/downward_api_volume_file.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the downward_api_volume_file module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema DownwardAPIVolumeFile: - """ DownwardAPIVolumeFile represents information to create the file containing the pod field - - Attributes - ---------- - mode : int, default is Undefined, optional - Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - path : str, default is Undefined, required - Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..' - fieldRef : ObjectFieldSelector, default is Undefined, optional - Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. - resourceFieldRef : ResourceFieldSelector, default is Undefined, optional - Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. - """ - - - mode?: int - - path: str - - fieldRef?: ObjectFieldSelector - - resourceFieldRef?: ResourceFieldSelector - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/downward_api_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/downward_api_volume_source.k deleted file mode 100644 index bc006901..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/downward_api_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the downward_api_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema DownwardAPIVolumeSource: - """ DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - defaultMode : int, default is Undefined, optional - Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - items : [DownwardAPIVolumeFile], default is Undefined, optional - Items is a list of downward API volume file - """ - - - defaultMode?: int - - items?: [DownwardAPIVolumeFile] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/empty_dir_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/empty_dir_volume_source.k deleted file mode 100644 index c97c14b2..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/empty_dir_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the empty_dir_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema EmptyDirVolumeSource: - """ Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - medium : str, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - sizeLimit : str, default is Undefined, optional - Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir - """ - - - medium?: str - - sizeLimit?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/env_from_source.k b/base/pkg/kusion_kubernetes/api/core/v1/env_from_source.k deleted file mode 100644 index 7dc7924e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/env_from_source.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the env_from_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema EnvFromSource: - """ EnvFromSource represents the source of a set of ConfigMaps - - Attributes - ---------- - prefix : str, default is Undefined, optional - An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - configMapRef : ConfigMapEnvSource, default is Undefined, optional - The ConfigMap to select from - secretRef : SecretEnvSource, default is Undefined, optional - The Secret to select from - """ - - - prefix?: str - - configMapRef?: ConfigMapEnvSource - - secretRef?: SecretEnvSource - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/env_var.k b/base/pkg/kusion_kubernetes/api/core/v1/env_var.k deleted file mode 100644 index 16498e04..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/env_var.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the env_var module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema EnvVar: - """ EnvVar represents an environment variable present in a Container. - - Attributes - ---------- - name : str, default is Undefined, required - Name of the environment variable. Must be a C_IDENTIFIER. - value : str, default is Undefined, optional - Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". - valueFrom : EnvVarSource, default is Undefined, optional - Source for the environment variable's value. Cannot be used if value is not empty. - """ - - - name: str - - value?: str - - valueFrom?: EnvVarSource - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/env_var_source.k b/base/pkg/kusion_kubernetes/api/core/v1/env_var_source.k deleted file mode 100644 index 5f698818..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/env_var_source.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the env_var_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema EnvVarSource: - """ EnvVarSource represents a source for the value of an EnvVar. - - Attributes - ---------- - configMapKeyRef : ConfigMapKeySelector, default is Undefined, optional - Selects a key of a ConfigMap. - fieldRef : ObjectFieldSelector, default is Undefined, optional - Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - resourceFieldRef : ResourceFieldSelector, default is Undefined, 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. - secretKeyRef : SecretKeySelector, default is Undefined, optional - Selects a key of a secret in the pod's namespace - """ - - - configMapKeyRef?: ConfigMapKeySelector - - fieldRef?: ObjectFieldSelector - - resourceFieldRef?: ResourceFieldSelector - - secretKeyRef?: SecretKeySelector - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/ephemeral_container.k b/base/pkg/kusion_kubernetes/api/core/v1/ephemeral_container.k deleted file mode 100644 index a0944e73..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/ephemeral_container.k +++ /dev/null @@ -1,108 +0,0 @@ -""" -This is the ephemeral_container module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema EphemeralContainer: - """ An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod's ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag. - - Attributes - ---------- - args : [str], default is Undefined, 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - command : [str], default is Undefined, 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - env : [EnvVar], default is Undefined, optional - List of environment variables to set in the container. Cannot be updated. - envFrom : [EnvFromSource], default is Undefined, 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 : str, default is Undefined, optional - Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images - imagePullPolicy : str, default is Undefined, optional - 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 - name : str, default is Undefined, required - Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers. - ports : [ContainerPort], default is Undefined, optional - Ports are not allowed for ephemeral containers. - stdin : bool, default is Undefined, 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. Default is false. - stdinOnce : bool, default is Undefined, 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. Default is false - targetContainerName : str, default is Undefined, optional - If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature. - terminationMessagePath : str, default is Undefined, 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. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated. - terminationMessagePolicy : str, default is Undefined, 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 : bool, default is Undefined, optional - Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - volumeDevices : [VolumeDevice], default is Undefined, optional - volumeDevices is the list of block devices to be used by the container. - volumeMounts : [VolumeMount], default is Undefined, optional - Pod volumes to mount into the container's filesystem. Cannot be updated. - workingDir : str, default is Undefined, 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. - lifecycle : Lifecycle, default is Undefined, optional - Lifecycle is not allowed for ephemeral containers. - livenessProbe : Probe, default is Undefined, optional - Probes are not allowed for ephemeral containers. - readinessProbe : Probe, default is Undefined, optional - Probes are not allowed for ephemeral containers. - resources : ResourceRequirements, default is Undefined, optional - Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod. - securityContext : SecurityContext, default is Undefined, optional - Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. - startupProbe : Probe, default is Undefined, optional - Probes are not allowed for ephemeral containers. - """ - - - args?: [str] - - command?: [str] - - env?: [EnvVar] - - envFrom?: [EnvFromSource] - - image?: str - - imagePullPolicy?: str - - name: str - - ports?: [ContainerPort] - - stdin?: bool - - stdinOnce?: bool - - targetContainerName?: str - - terminationMessagePath?: str - - terminationMessagePolicy?: str - - tty?: bool - - volumeDevices?: [VolumeDevice] - - volumeMounts?: [VolumeMount] - - workingDir?: str - - lifecycle?: Lifecycle - - livenessProbe?: Probe - - readinessProbe?: Probe - - resources?: ResourceRequirements - - securityContext?: SecurityContext - - startupProbe?: Probe - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/ephemeral_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/ephemeral_volume_source.k deleted file mode 100644 index 7b4e1962..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/ephemeral_volume_source.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the ephemeral_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema EphemeralVolumeSource: - """ Represents an ephemeral volume that is handled by a normal storage driver. - - Attributes - ---------- - volumeClaimTemplate : PersistentVolumeClaimTemplate, default is Undefined, optional - Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). - - An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. - - This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. - Required, must not be nil. - """ - - - volumeClaimTemplate?: PersistentVolumeClaimTemplate - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/exec_action.k b/base/pkg/kusion_kubernetes/api/core/v1/exec_action.k deleted file mode 100644 index bca11ebc..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/exec_action.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the exec_action module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ExecAction: - """ ExecAction describes a "run in container" action. - - Attributes - ---------- - command : [str], default is Undefined, 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 ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - """ - - - command?: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/fc_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/fc_volume_source.k deleted file mode 100644 index 2ae89e56..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/fc_volume_source.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the fc_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema FCVolumeSource: - """ Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - fsType : str, default is Undefined, 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 : int, default is Undefined, optional - Optional: FC target lun number - readOnly : bool, default is Undefined, optional - Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - targetWWNs : [str], default is Undefined, optional - Optional: FC target worldwide names (WWNs) - wwids : [str], default is Undefined, optional - Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. - """ - - - fsType?: str - - lun?: int - - readOnly?: bool - - targetWWNs?: [str] - - wwids?: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/flex_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/flex_volume_source.k deleted file mode 100644 index d5ae56af..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/flex_volume_source.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the flex_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema FlexVolumeSource: - """ FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - - Attributes - ---------- - driver : str, default is Undefined, required - Driver is the name of the driver to use for this volume. - fsType : str, default is Undefined, 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 : {str:str}, default is Undefined, optional - Optional: Extra command options if any. - readOnly : bool, default is Undefined, optional - Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - secretRef : LocalObjectReference, default is Undefined, optional - Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts. - """ - - - driver: str - - fsType?: str - - options?: {str:str} - - readOnly?: bool - - secretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/flocker_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/flocker_volume_source.k deleted file mode 100644 index 6378fd4b..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/flocker_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the flocker_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema FlockerVolumeSource: - """ Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling. - - Attributes - ---------- - datasetName : str, default is Undefined, optional - Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated - datasetUUID : str, default is Undefined, optional - UUID of the dataset. This is unique identifier of a Flocker dataset - """ - - - datasetName?: str - - datasetUUID?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/gce_persistent_disk_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/gce_persistent_disk_volume_source.k deleted file mode 100644 index dc01a77f..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/gce_persistent_disk_volume_source.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the gce_persistent_disk_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema GCEPersistentDiskVolumeSource: - """ Represents a Persistent Disk resource in Google Compute Engine. - A GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling. - - Attributes - ---------- - fsType : str, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - partition : int, default is Undefined, 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). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - pdName : str, default is Undefined, required - 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 - readOnly : bool, default is Undefined, optional - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - """ - - - fsType?: str - - partition?: int - - pdName: str - - readOnly?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/git_repo_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/git_repo_volume_source.k deleted file mode 100644 index 57800aa1..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/git_repo_volume_source.k +++ /dev/null @@ -1,29 +0,0 @@ -""" -This is the git_repo_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema GitRepoVolumeSource: - """ Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling. - DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container. - - Attributes - ---------- - directory : str, default is Undefined, 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 : str, default is Undefined, required - Repository URL - revision : str, default is Undefined, optional - Commit hash for the specified revision. - """ - - - directory?: str - - repository: str - - revision?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/glusterfs_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/glusterfs_volume_source.k deleted file mode 100644 index a9c644a3..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/glusterfs_volume_source.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the glusterfs_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema GlusterfsVolumeSource: - """ Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling. - - Attributes - ---------- - endpoints : str, default is Undefined, required - EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - path : str, default is Undefined, required - Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - readOnly : bool, default is Undefined, optional - ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - """ - - - endpoints: str - - path: str - - readOnly?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/handler.k b/base/pkg/kusion_kubernetes/api/core/v1/handler.k deleted file mode 100644 index 61861cf8..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/handler.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the handler module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Handler: - """ Handler defines a specific action that should be taken - - Attributes - ---------- - exec : ExecAction, default is Undefined, optional - One and only one of the following should be specified. Exec specifies the action to take. - httpGet : HTTPGetAction, default is Undefined, optional - HTTPGet specifies the http request to perform. - tcpSocket : TCPSocketAction, default is Undefined, optional - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - """ - - - exec?: ExecAction - - httpGet?: HTTPGetAction - - tcpSocket?: TCPSocketAction - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/host_alias.k b/base/pkg/kusion_kubernetes/api/core/v1/host_alias.k deleted file mode 100644 index 5c777a6b..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/host_alias.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the host_alias module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HostAlias: - """ HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. - - Attributes - ---------- - hostnames : [str], default is Undefined, optional - Hostnames for the above IP address. - ip : str, default is Undefined, optional - IP address of the host file entry. - """ - - - hostnames?: [str] - - ip?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/host_path_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/host_path_volume_source.k deleted file mode 100644 index b4b87924..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/host_path_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the host_path_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HostPathVolumeSource: - """ Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling. - - Attributes - ---------- - path : str, default is Undefined, required - Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - $type : str, default is Undefined, optional - Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - """ - - - path: str - - $type?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/http_get_action.k b/base/pkg/kusion_kubernetes/api/core/v1/http_get_action.k deleted file mode 100644 index bfe82448..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/http_get_action.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the http_get_action module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HTTPGetAction: - """ HTTPGetAction describes an action based on HTTP Get requests. - - Attributes - ---------- - host : str, default is Undefined, optional - Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - httpHeaders : [HTTPHeader], default is Undefined, optional - Custom headers to set in the request. HTTP allows repeated headers. - path : str, default is Undefined, optional - Path to access on the HTTP server. - port : int | str, default is Undefined, required - 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 : str, default is Undefined, optional - Scheme to use for connecting to the host. Defaults to HTTP. - """ - - - host?: str - - httpHeaders?: [HTTPHeader] - - path?: str - - port: int | str - - scheme?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/http_header.k b/base/pkg/kusion_kubernetes/api/core/v1/http_header.k deleted file mode 100644 index 8be28a47..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/http_header.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the http_header module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HTTPHeader: - """ HTTPHeader describes a custom header to be used in HTTP probes - - Attributes - ---------- - name : str, default is Undefined, required - The header field name - value : str, default is Undefined, required - The header field value - """ - - - name: str - - value: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/iscsi_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/iscsi_volume_source.k deleted file mode 100644 index e464ffc8..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/iscsi_volume_source.k +++ /dev/null @@ -1,60 +0,0 @@ -""" -This is the iscsi_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ISCSIVolumeSource: - """ Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - chapAuthDiscovery : bool, default is Undefined, optional - whether support iSCSI Discovery CHAP authentication - chapAuthSession : bool, default is Undefined, optional - whether support iSCSI Session CHAP authentication - fsType : str, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - initiatorName : str, default is Undefined, optional - Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. - iqn : str, default is Undefined, required - Target iSCSI Qualified Name. - iscsiInterface : str, default is Undefined, optional - iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). - lun : int, default is Undefined, required - iSCSI Target Lun number. - portals : [str], default is Undefined, optional - iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - readOnly : bool, default is Undefined, optional - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. - targetPortal : str, default is Undefined, 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). - secretRef : LocalObjectReference, default is Undefined, optional - CHAP Secret for iSCSI target and initiator authentication - """ - - - chapAuthDiscovery?: bool - - chapAuthSession?: bool - - fsType?: str - - initiatorName?: str - - iqn: str - - iscsiInterface?: str - - lun: int - - portals?: [str] - - readOnly?: bool - - targetPortal: str - - secretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/key_to_path.k b/base/pkg/kusion_kubernetes/api/core/v1/key_to_path.k deleted file mode 100644 index 08684e53..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/key_to_path.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the key_to_path module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema KeyToPath: - """ Maps a string key to a path within a volume. - - Attributes - ---------- - key : str, default is Undefined, required - The key to project. - mode : int, default is Undefined, optional - Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - path : str, default is Undefined, 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 '..'. - """ - - - key: str - - mode?: int - - path: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/lifecycle.k b/base/pkg/kusion_kubernetes/api/core/v1/lifecycle.k deleted file mode 100644 index 3fb8b67c..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/lifecycle.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the lifecycle module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Lifecycle: - """ Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted. - - Attributes - ---------- - postStart : Handler, default is Undefined, optional - PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks - preStop : Handler, default is Undefined, optional - PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks - """ - - - postStart?: Handler - - preStop?: Handler - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/local_object_reference.k b/base/pkg/kusion_kubernetes/api/core/v1/local_object_reference.k deleted file mode 100644 index 0fb06ee5..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/local_object_reference.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the local_object_reference module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema LocalObjectReference: - """ LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - - Attributes - ---------- - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - """ - - - name?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/namespace.k b/base/pkg/kusion_kubernetes/api/core/v1/namespace.k deleted file mode 100644 index 12b48517..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/namespace.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the namespace module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Namespace: - """ Namespace provides a scope for Names. Use of multiple namespaces is optional. - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - kind : "Namespace", default is "Namespace", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : NamespaceSpec, default is Undefined, optional - Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - apiVersion: "v1" = "v1" - - kind: "Namespace" = "Namespace" - - metadata?: apis.ObjectMeta - - spec?: NamespaceSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/namespace_spec.k b/base/pkg/kusion_kubernetes/api/core/v1/namespace_spec.k deleted file mode 100644 index 4c603d22..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/namespace_spec.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the namespace_spec module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NamespaceSpec: - """ NamespaceSpec describes the attributes on a Namespace. - - Attributes - ---------- - finalizers : [str], default is Undefined, optional - Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ - """ - - - finalizers?: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/nfs_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/nfs_volume_source.k deleted file mode 100644 index 345661ea..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/nfs_volume_source.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the nfs_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NFSVolumeSource: - """ Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling. - - Attributes - ---------- - path : str, default is Undefined, required - Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - readOnly : bool, default is Undefined, optional - ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - server : str, default is Undefined, required - Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - """ - - - path: str - - readOnly?: bool - - server: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node.k b/base/pkg/kusion_kubernetes/api/core/v1/node.k deleted file mode 100644 index 2fcac585..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the node module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Node: - """ Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - kind : "Node", default is "Node", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : NodeSpec, default is Undefined, optional - Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - apiVersion: "v1" = "v1" - - kind: "Node" = "Node" - - metadata?: apis.ObjectMeta - - spec?: NodeSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node_affinity.k b/base/pkg/kusion_kubernetes/api/core/v1/node_affinity.k deleted file mode 100644 index 2c177fa9..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node_affinity.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the node_affinity module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NodeAffinity: - """ Node affinity is a group of node affinity scheduling rules. - - Attributes - ---------- - preferredDuringSchedulingIgnoredDuringExecution : [PreferredSchedulingTerm], default is Undefined, 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. 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. - requiredDuringSchedulingIgnoredDuringExecution : NodeSelector, default is Undefined, 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. - """ - - - preferredDuringSchedulingIgnoredDuringExecution?: [PreferredSchedulingTerm] - - requiredDuringSchedulingIgnoredDuringExecution?: NodeSelector - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node_config_source.k b/base/pkg/kusion_kubernetes/api/core/v1/node_config_source.k deleted file mode 100644 index e5684bb1..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node_config_source.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the node_config_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NodeConfigSource: - """ NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22 - - Attributes - ---------- - configMap : ConfigMapNodeConfigSource, default is Undefined, optional - ConfigMap is a reference to a Node's ConfigMap - """ - - - configMap?: ConfigMapNodeConfigSource - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node_selector.k b/base/pkg/kusion_kubernetes/api/core/v1/node_selector.k deleted file mode 100644 index 4fbc789c..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node_selector.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the node_selector module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NodeSelector: - """ A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms. - - Attributes - ---------- - nodeSelectorTerms : [NodeSelectorTerm], default is Undefined, required - Required. A list of node selector terms. The terms are ORed. - """ - - - nodeSelectorTerms: [NodeSelectorTerm] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node_selector_requirement.k b/base/pkg/kusion_kubernetes/api/core/v1/node_selector_requirement.k deleted file mode 100644 index 39971005..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node_selector_requirement.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the node_selector_requirement module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NodeSelectorRequirement: - """ A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - The label key that the selector applies to. - operator : str, default is Undefined, required - Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - values : [str], default is Undefined, 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. - """ - - - key: str - - operator: str - - values?: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node_selector_term.k b/base/pkg/kusion_kubernetes/api/core/v1/node_selector_term.k deleted file mode 100644 index f4d9bbcf..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node_selector_term.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the node_selector_term module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NodeSelectorTerm: - """ A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - - Attributes - ---------- - matchExpressions : [NodeSelectorRequirement], default is Undefined, optional - A list of node selector requirements by node's labels. - matchFields : [NodeSelectorRequirement], default is Undefined, optional - A list of node selector requirements by node's fields. - """ - - - matchExpressions?: [NodeSelectorRequirement] - - matchFields?: [NodeSelectorRequirement] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/node_spec.k b/base/pkg/kusion_kubernetes/api/core/v1/node_spec.k deleted file mode 100644 index b4a863df..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/node_spec.k +++ /dev/null @@ -1,44 +0,0 @@ -""" -This is the node_spec module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema NodeSpec: - """ NodeSpec describes the attributes that a node is created with. - - Attributes - ---------- - externalID : str, default is Undefined, optional - Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966 - podCIDR : str, default is Undefined, optional - PodCIDR represents the pod IP range assigned to the node. - podCIDRs : [str], default is Undefined, optional - podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6. - providerID : str, default is Undefined, optional - ID of the node assigned by the cloud provider in the format: :// - taints : [Taint], default is Undefined, optional - If specified, the node's taints. - unschedulable : bool, default is Undefined, optional - Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration - configSource : NodeConfigSource, default is Undefined, optional - Deprecated. If specified, the source of the node's configuration. The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field. This field is deprecated as of 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration - """ - - - externalID?: str - - podCIDR?: str - - podCIDRs?: [str] - - providerID?: str - - taints?: [Taint] - - unschedulable?: bool - - configSource?: NodeConfigSource - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/object_field_selector.k b/base/pkg/kusion_kubernetes/api/core/v1/object_field_selector.k deleted file mode 100644 index 0f7f60fa..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/object_field_selector.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the object_field_selector module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ObjectFieldSelector: - """ ObjectFieldSelector selects an APIVersioned field of an object. - - Attributes - ---------- - apiVersion : str, default is Undefined, optional - Version of the schema the FieldPath is written in terms of, defaults to "v1". - fieldPath : str, default is Undefined, required - Path of the field to select in the specified API version. - """ - - - apiVersion?: str - - fieldPath: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/object_reference.k b/base/pkg/kusion_kubernetes/api/core/v1/object_reference.k deleted file mode 100644 index fd0802ff..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/object_reference.k +++ /dev/null @@ -1,44 +0,0 @@ -""" -This is the object_reference module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ObjectReference: - """ ObjectReference contains enough information to let you inspect or modify the referred object. - - Attributes - ---------- - apiVersion : str, default is Undefined, optional - API version of the referent. - fieldPath : str, default is Undefined, optional - 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]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. - kind : str, default is Undefined, optional - Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - namespace : str, default is Undefined, optional - Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - resourceVersion : str, default is Undefined, optional - Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - uid : str, default is Undefined, optional - UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - """ - - - apiVersion?: str - - fieldPath?: str - - kind?: str - - name?: str - - namespace?: str - - resourceVersion?: str - - uid?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim.k b/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim.k deleted file mode 100644 index 618916fb..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the persistent_volume_claim module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema PersistentVolumeClaim: - """ PersistentVolumeClaim is a user's request for and claim to a persistent volume - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - kind : "PersistentVolumeClaim", default is "PersistentVolumeClaim", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : PersistentVolumeClaimSpec, default is Undefined, optional - Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - """ - - - apiVersion: "v1" = "v1" - - kind: "PersistentVolumeClaim" = "PersistentVolumeClaim" - - metadata?: apis.ObjectMeta - - spec?: PersistentVolumeClaimSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_spec.k b/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_spec.k deleted file mode 100644 index 46209a8d..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_spec.k +++ /dev/null @@ -1,53 +0,0 @@ -""" -This is the persistent_volume_claim_spec module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema PersistentVolumeClaimSpec: - """ PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes - - Attributes - ---------- - accessModes : [str], default is Undefined, optional - AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - storageClassName : str, default is Undefined, optional - Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - volumeMode : str, default is Undefined, optional - volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - volumeName : str, default is Undefined, optional - VolumeName is the binding reference to the PersistentVolume backing this claim. - dataSource : TypedLocalObjectReference, default is Undefined, optional - This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field. - dataSourceRef : TypedLocalObjectReference, default is Undefined, optional - Specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef - allows any non-core object, as well as PersistentVolumeClaim objects. - * While DataSource ignores disallowed values (dropping them), DataSourceRef - preserves all values, and generates an error if a disallowed value is - specified.(Alpha) Using this field requires the AnyVolumeDataSource feature gate to be enabled. - resources : ResourceRequirements, default is Undefined, optional - Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources - selector : apis.LabelSelector, default is Undefined, optional - A label query over volumes to consider for binding. - """ - - - accessModes?: [str] - - storageClassName?: str - - volumeMode?: str - - volumeName?: str - - dataSource?: TypedLocalObjectReference - - dataSourceRef?: TypedLocalObjectReference - - resources?: ResourceRequirements - - selector?: apis.LabelSelector - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_template.k b/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_template.k deleted file mode 100644 index a2b02604..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_template.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the persistent_volume_claim_template module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema PersistentVolumeClaimTemplate: - """ PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource. - - Attributes - ---------- - metadata : apis.ObjectMeta, default is Undefined, 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 : PersistentVolumeClaimSpec, default is Undefined, required - 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. - """ - - - metadata?: apis.ObjectMeta - - spec: PersistentVolumeClaimSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_volume_source.k deleted file mode 100644 index 45142408..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/persistent_volume_claim_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the persistent_volume_claim_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PersistentVolumeClaimVolumeSource: - """ PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system). - - Attributes - ---------- - claimName : str, default is Undefined, required - ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - readOnly : bool, default is Undefined, optional - Will force the ReadOnly setting in VolumeMounts. Default false. - """ - - - claimName: str - - readOnly?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/photon_persistent_disk_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/photon_persistent_disk_volume_source.k deleted file mode 100644 index 910e68ff..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/photon_persistent_disk_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the photon_persistent_disk_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PhotonPersistentDiskVolumeSource: - """ Represents a Photon Controller persistent disk resource. - - Attributes - ---------- - fsType : str, default is Undefined, 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. - pdID : str, default is Undefined, required - ID that identifies Photon Controller persistent disk - """ - - - fsType?: str - - pdID: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_affinity.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_affinity.k deleted file mode 100644 index 8c98fe1c..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_affinity.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the pod_affinity module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodAffinity: - """ Pod affinity is a group of inter pod affinity scheduling rules. - - Attributes - ---------- - preferredDuringSchedulingIgnoredDuringExecution : [WeightedPodAffinityTerm], default is Undefined, 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. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - requiredDuringSchedulingIgnoredDuringExecution : [PodAffinityTerm], default is Undefined, 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. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - """ - - - preferredDuringSchedulingIgnoredDuringExecution?: [WeightedPodAffinityTerm] - - requiredDuringSchedulingIgnoredDuringExecution?: [PodAffinityTerm] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_affinity_term.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_affinity_term.k deleted file mode 100644 index b34fb524..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_affinity_term.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the pod_affinity_term module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema PodAffinityTerm: - """ Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - - Attributes - ---------- - namespaces : [str], default is Undefined, optional - namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace" - topologyKey : str, default is Undefined, required - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - labelSelector : apis.LabelSelector, default is Undefined, optional - A label query over a set of resources, in this case pods. - namespaceSelector : apis.LabelSelector, default is Undefined, optional - A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled. - """ - - - namespaces?: [str] - - topologyKey: str - - labelSelector?: apis.LabelSelector - - namespaceSelector?: apis.LabelSelector - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_anti_affinity.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_anti_affinity.k deleted file mode 100644 index 5da3dc68..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_anti_affinity.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the pod_anti_affinity module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodAntiAffinity: - """ Pod anti affinity is a group of inter pod anti affinity scheduling rules. - - Attributes - ---------- - preferredDuringSchedulingIgnoredDuringExecution : [WeightedPodAffinityTerm], default is Undefined, 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. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - requiredDuringSchedulingIgnoredDuringExecution : [PodAffinityTerm], default is Undefined, 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. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - """ - - - preferredDuringSchedulingIgnoredDuringExecution?: [WeightedPodAffinityTerm] - - requiredDuringSchedulingIgnoredDuringExecution?: [PodAffinityTerm] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_dns_config.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_dns_config.k deleted file mode 100644 index dbc3c997..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_dns_config.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the pod_dns_config module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodDNSConfig: - """ PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy. - - Attributes - ---------- - nameservers : [str], default is Undefined, optional - A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. - options : [PodDNSConfigOption], default is Undefined, optional - 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. - searches : [str], default is Undefined, optional - 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. - """ - - - nameservers?: [str] - - options?: [PodDNSConfigOption] - - searches?: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_dns_config_option.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_dns_config_option.k deleted file mode 100644 index 02243185..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_dns_config_option.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the pod_dns_config_option module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodDNSConfigOption: - """ PodDNSConfigOption defines DNS resolver options of a pod. - - Attributes - ---------- - name : str, default is Undefined, optional - Required. - value : str, default is Undefined, optional - value - """ - - - name?: str - - value?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_readiness_gate.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_readiness_gate.k deleted file mode 100644 index 4e67c51e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_readiness_gate.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the pod_readiness_gate module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodReadinessGate: - """ PodReadinessGate contains the reference to a pod condition - - Attributes - ---------- - conditionType : str, default is Undefined, required - ConditionType refers to a condition in the pod's condition list with matching type. - """ - - - conditionType: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_security_context.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_security_context.k deleted file mode 100644 index 0a778590..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_security_context.k +++ /dev/null @@ -1,59 +0,0 @@ -""" -This is the pod_security_context module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodSecurityContext: - """ PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext. - - Attributes - ---------- - fsGroup : int, default is Undefined, 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. - fsGroupChangePolicy : str, default is Undefined, optional - fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. - runAsGroup : int, default is Undefined, 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. - runAsNonRoot : bool, default is Undefined, 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. - runAsUser : int, default is Undefined, 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. - supplementalGroups : [int], default is Undefined, 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. - sysctls : [Sysctl], default is Undefined, optional - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. - seLinuxOptions : SELinuxOptions, default is Undefined, 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. - seccompProfile : SeccompProfile, default is Undefined, optional - The seccomp options to use by the containers in this pod. - windowsOptions : WindowsSecurityContextOptions, default is Undefined, optional - 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. - """ - - - fsGroup?: int - - fsGroupChangePolicy?: str - - runAsGroup?: int - - runAsNonRoot?: bool - - runAsUser?: int - - supplementalGroups?: [int] - - sysctls?: [Sysctl] - - seLinuxOptions?: SELinuxOptions - - seccompProfile?: SeccompProfile - - windowsOptions?: WindowsSecurityContextOptions - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_spec.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_spec.k deleted file mode 100644 index 0390d79d..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_spec.k +++ /dev/null @@ -1,156 +0,0 @@ -""" -This is the pod_spec module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PodSpec: - """ PodSpec is a description of a pod. - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, 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. - automountServiceAccountToken : bool, default is Undefined, optional - AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. - containers : [Container], default is Undefined, required - 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. - dnsPolicy : str, default is Undefined, optional - Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. - enableServiceLinks : bool, default is Undefined, optional - EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true. - ephemeralContainers : [EphemeralContainer], default is Undefined, optional - List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature. - hostAliases : [HostAlias], default is Undefined, optional - HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. - hostIPC : bool, default is Undefined, optional - Use the host's ipc namespace. Optional: Default to false. - hostNetwork : bool, default is Undefined, 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. Default to false. - hostPID : bool, default is Undefined, optional - Use the host's pid namespace. Optional: Default to false. - hostname : str, default is Undefined, optional - Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. - imagePullSecrets : [LocalObjectReference], default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - initContainers : [Container], default is Undefined, optional - List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ - nodeName : str, default is Undefined, 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. - nodeSelector : {str:str}, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - overhead : {str:str}, default is Undefined, optional - Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md This field is beta-level as of Kubernetes v1.18, and is only honored by servers that enable the PodOverhead feature. - preemptionPolicy : str, default is Undefined, optional - PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate. - priority : int, default is Undefined, optional - The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. - priorityClassName : str, default is Undefined, 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. - readinessGates : [PodReadinessGate], default is Undefined, 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://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates - restartPolicy : str, default is Undefined, optional - Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy - runtimeClassName : str, default is Undefined, optional - RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class This is a beta feature as of Kubernetes v1.14. - schedulerName : str, default is Undefined, optional - If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. - serviceAccount : str, default is Undefined, optional - DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead. - serviceAccountName : str, default is Undefined, optional - ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ - setHostnameAsFQDN : bool, default is Undefined, optional - If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. - shareProcessNamespace : bool, default is Undefined, 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. Optional: Default to false. - subdomain : str, default is Undefined, optional - If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. - terminationGracePeriodSeconds : int, default is Undefined, 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 stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds. - tolerations : [Toleration], default is Undefined, optional - If specified, the pod's tolerations. - topologySpreadConstraints : [TopologySpreadConstraint], default is Undefined, optional - TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. - volumes : [Volume], default is Undefined, optional - List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes - affinity : Affinity, default is Undefined, optional - If specified, the pod's scheduling constraints - dnsConfig : PodDNSConfig, default is Undefined, optional - Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. - securityContext : PodSecurityContext, default is Undefined, optional - SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field. - """ - - - activeDeadlineSeconds?: int - - automountServiceAccountToken?: bool - - containers: [Container] - - dnsPolicy?: str - - enableServiceLinks?: bool - - ephemeralContainers?: [EphemeralContainer] - - hostAliases?: [HostAlias] - - hostIPC?: bool - - hostNetwork?: bool - - hostPID?: bool - - hostname?: str - - imagePullSecrets?: [LocalObjectReference] - - initContainers?: [Container] - - nodeName?: str - - nodeSelector?: {str:str} - - overhead?: {str:str} - - preemptionPolicy?: str - - priority?: int - - priorityClassName?: str - - readinessGates?: [PodReadinessGate] - - restartPolicy?: str - - runtimeClassName?: str - - schedulerName?: str - - serviceAccount?: str - - serviceAccountName?: str - - setHostnameAsFQDN?: bool - - shareProcessNamespace?: bool - - subdomain?: str - - terminationGracePeriodSeconds?: int - - tolerations?: [Toleration] - - topologySpreadConstraints?: [TopologySpreadConstraint] - - volumes?: [Volume] - - affinity?: Affinity - - dnsConfig?: PodDNSConfig - - securityContext?: PodSecurityContext - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/pod_template_spec.k b/base/pkg/kusion_kubernetes/api/core/v1/pod_template_spec.k deleted file mode 100644 index 30049853..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/pod_template_spec.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the pod_template_spec module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema PodTemplateSpec: - """ PodTemplateSpec describes the data a pod should have when created from a template - - Attributes - ---------- - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : PodSpec, default is Undefined, optional - Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - metadata?: apis.ObjectMeta - - spec?: PodSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/portworx_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/portworx_volume_source.k deleted file mode 100644 index 3fc2ba10..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/portworx_volume_source.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the portworx_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PortworxVolumeSource: - """ PortworxVolumeSource represents a Portworx volume resource. - - Attributes - ---------- - fsType : str, default is Undefined, optional - FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. - readOnly : bool, default is Undefined, optional - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - volumeID : str, default is Undefined, required - VolumeID uniquely identifies a Portworx volume - """ - - - fsType?: str - - readOnly?: bool - - volumeID: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/preferred_scheduling_term.k b/base/pkg/kusion_kubernetes/api/core/v1/preferred_scheduling_term.k deleted file mode 100644 index da34ecb3..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/preferred_scheduling_term.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the preferred_scheduling_term module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PreferredSchedulingTerm: - """ An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - - Attributes - ---------- - weight : int, default is Undefined, required - Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - preference : NodeSelectorTerm, default is Undefined, required - A node selector term, associated with the corresponding weight. - """ - - - weight: int - - preference: NodeSelectorTerm - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/probe.k b/base/pkg/kusion_kubernetes/api/core/v1/probe.k deleted file mode 100644 index 85aa7cfe..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/probe.k +++ /dev/null @@ -1,52 +0,0 @@ -""" -This is the probe module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Probe: - """ Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. - - Attributes - ---------- - failureThreshold : int, default is Undefined, optional - Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - initialDelaySeconds : int, default is Undefined, optional - 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 - periodSeconds : int, default is Undefined, optional - How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - successThreshold : int, default is Undefined, optional - Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - terminationGracePeriodSeconds : int, default is Undefined, optional - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - timeoutSeconds : int, default is Undefined, optional - Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - exec : ExecAction, default is Undefined, optional - One and only one of the following should be specified. Exec specifies the action to take. - httpGet : HTTPGetAction, default is Undefined, optional - HTTPGet specifies the http request to perform. - tcpSocket : TCPSocketAction, default is Undefined, optional - TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - """ - - - failureThreshold?: int - - initialDelaySeconds?: int - - periodSeconds?: int - - successThreshold?: int - - terminationGracePeriodSeconds?: int - - timeoutSeconds?: int - - exec?: ExecAction - - httpGet?: HTTPGetAction - - tcpSocket?: TCPSocketAction - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/projected_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/projected_volume_source.k deleted file mode 100644 index 40e0e66b..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/projected_volume_source.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the projected_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ProjectedVolumeSource: - """ Represents a projected volume source - - Attributes - ---------- - defaultMode : int, default is Undefined, optional - Mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. 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. - sources : [VolumeProjection], default is Undefined, optional - list of volume projections - """ - - - defaultMode?: int - - sources?: [VolumeProjection] - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/quobyte_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/quobyte_volume_source.k deleted file mode 100644 index 7d42dd11..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/quobyte_volume_source.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This is the quobyte_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema QuobyteVolumeSource: - """ Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling. - - Attributes - ---------- - group : str, default is Undefined, optional - Group to map volume access to Default is no group - readOnly : bool, default is Undefined, optional - ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. - registry : str, default is Undefined, 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 - tenant : str, default is Undefined, optional - Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin - user : str, default is Undefined, optional - User to map volume access to Defaults to serivceaccount user - volume : str, default is Undefined, required - Volume is a string that references an already created Quobyte volume by name. - """ - - - group?: str - - readOnly?: bool - - registry: str - - tenant?: str - - user?: str - - volume: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/rbd_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/rbd_volume_source.k deleted file mode 100644 index 0e2525b1..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/rbd_volume_source.k +++ /dev/null @@ -1,48 +0,0 @@ -""" -This is the rbd_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema RBDVolumeSource: - """ Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - fsType : str, default is Undefined, 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. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - image : str, default is Undefined, required - The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - keyring : str, default is Undefined, optional - 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 - monitors : [str], default is Undefined, required - A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - pool : str, default is Undefined, optional - The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - readOnly : bool, default is Undefined, optional - ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - user : str, default is Undefined, optional - The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - secretRef : LocalObjectReference, default is Undefined, optional - SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - """ - - - fsType?: str - - image: str - - keyring?: str - - monitors: [str] - - pool?: str - - readOnly?: bool - - user?: str - - secretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/resource_field_selector.k b/base/pkg/kusion_kubernetes/api/core/v1/resource_field_selector.k deleted file mode 100644 index 610945b9..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/resource_field_selector.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the resource_field_selector module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ResourceFieldSelector: - """ ResourceFieldSelector represents container resources (cpu, memory) and their output format - - Attributes - ---------- - containerName : str, default is Undefined, optional - Container name: required for volumes, optional for env vars - divisor : str, default is Undefined, optional - Specifies the output format of the exposed resources, defaults to "1" - resource : str, default is Undefined, required - Required: resource to select - """ - - - containerName?: str - - divisor?: str - - resource: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/resource_requirements.k b/base/pkg/kusion_kubernetes/api/core/v1/resource_requirements.k deleted file mode 100644 index a777dd3e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/resource_requirements.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the resource_requirements module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ResourceRequirements: - """ ResourceRequirements describes the compute resource requirements. - - Attributes - ---------- - limits : {str:str}, default is Undefined, optional - Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - requests : {str:str}, default is Undefined, optional - Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - """ - - - limits?: {str:str} - - requests?: {str:str} - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/scale_io_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/scale_io_volume_source.k deleted file mode 100644 index ebbee222..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/scale_io_volume_source.k +++ /dev/null @@ -1,56 +0,0 @@ -""" -This is the scale_io_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ScaleIOVolumeSource: - """ ScaleIOVolumeSource represents a persistent ScaleIO volume - - Attributes - ---------- - fsType : str, default is Undefined, optional - Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". - gateway : str, default is Undefined, required - The host address of the ScaleIO API Gateway. - protectionDomain : str, default is Undefined, optional - The name of the ScaleIO Protection Domain for the configured storage. - readOnly : bool, default is Undefined, optional - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - sslEnabled : bool, default is Undefined, optional - Flag to enable/disable SSL communication with Gateway, default false - storageMode : str, default is Undefined, optional - Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. - storagePool : str, default is Undefined, optional - The ScaleIO Storage Pool associated with the protection domain. - system : str, default is Undefined, required - The name of the storage system as configured in ScaleIO. - volumeName : str, default is Undefined, optional - The name of a volume already created in the ScaleIO system that is associated with this volume source. - secretRef : LocalObjectReference, default is Undefined, required - SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. - """ - - - fsType?: str - - gateway: str - - protectionDomain?: str - - readOnly?: bool - - sslEnabled?: bool - - storageMode?: str - - storagePool?: str - - system: str - - volumeName?: str - - secretRef: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/se_linux_options.k b/base/pkg/kusion_kubernetes/api/core/v1/se_linux_options.k deleted file mode 100644 index e15a1a51..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/se_linux_options.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the se_linux_options module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SELinuxOptions: - """ SELinuxOptions are the labels to be applied to the container - - Attributes - ---------- - level : str, default is Undefined, optional - Level is SELinux level label that applies to the container. - role : str, default is Undefined, optional - Role is a SELinux role label that applies to the container. - $type : str, default is Undefined, optional - Type is a SELinux type label that applies to the container. - user : str, default is Undefined, optional - User is a SELinux user label that applies to the container. - """ - - - level?: str - - role?: str - - $type?: str - - user?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/seccomp_profile.k b/base/pkg/kusion_kubernetes/api/core/v1/seccomp_profile.k deleted file mode 100644 index b76e164e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/seccomp_profile.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the seccomp_profile module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SeccompProfile: - """ SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set. - - Attributes - ---------- - localhostProfile : str, default is Undefined, optional - localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - $type : str, default is Undefined, required - 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 - no profile should be applied. - """ - - - localhostProfile?: str - - $type: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/secret.k b/base/pkg/kusion_kubernetes/api/core/v1/secret.k deleted file mode 100644 index e1208430..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/secret.k +++ /dev/null @@ -1,45 +0,0 @@ -""" -This is the secret module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Secret: - """ Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - data : {str:str}, default is Undefined, optional - Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4 - immutable : bool, default is Undefined, optional - Immutable, if set to true, 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. Defaulted to nil. - kind : "Secret", default is "Secret", required - 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 - stringData : {str:str}, default is Undefined, optional - stringData allows specifying non-binary secret data in string form. It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API. - $type : str, default is Undefined, optional - Used to facilitate programmatic handling of secret data. - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - """ - - - apiVersion: "v1" = "v1" - - data?: {str:str} - - immutable?: bool - - kind: "Secret" = "Secret" - - stringData?: {str:str} - - $type?: str - - metadata?: apis.ObjectMeta - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/secret_env_source.k b/base/pkg/kusion_kubernetes/api/core/v1/secret_env_source.k deleted file mode 100644 index 8ea34930..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/secret_env_source.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the secret_env_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SecretEnvSource: - """ SecretEnvSource selects a Secret to populate the environment variables with. - The contents of the target Secret's Data field will represent the key-value pairs as environment variables. - - Attributes - ---------- - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the Secret must be defined - """ - - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/secret_key_selector.k b/base/pkg/kusion_kubernetes/api/core/v1/secret_key_selector.k deleted file mode 100644 index 3f72d44e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/secret_key_selector.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the secret_key_selector module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SecretKeySelector: - """ SecretKeySelector selects a key of a Secret. - - Attributes - ---------- - key : str, default is Undefined, required - The key of the secret to select from. Must be a valid secret key. - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the Secret or its key must be defined - """ - - - key: str - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/secret_projection.k b/base/pkg/kusion_kubernetes/api/core/v1/secret_projection.k deleted file mode 100644 index 8cb57581..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/secret_projection.k +++ /dev/null @@ -1,29 +0,0 @@ -""" -This is the secret_projection module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SecretProjection: - """ 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. - - Attributes - ---------- - items : [KeyToPath], default is Undefined, optional - 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 '..'. - name : str, default is Undefined, optional - Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional : bool, default is Undefined, optional - Specify whether the Secret or its key must be defined - """ - - - items?: [KeyToPath] - - name?: str - - optional?: bool - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/secret_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/secret_volume_source.k deleted file mode 100644 index b579747d..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/secret_volume_source.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the secret_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SecretVolumeSource: - """ Adapts a Secret into a volume. - The contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling. - - Attributes - ---------- - defaultMode : int, default is Undefined, optional - Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - items : [KeyToPath], default is Undefined, optional - 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 : bool, default is Undefined, optional - Specify whether the Secret or its keys must be defined - secretName : str, default is Undefined, optional - Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - """ - - - defaultMode?: int - - items?: [KeyToPath] - - optional?: bool - - secretName?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/security_context.k b/base/pkg/kusion_kubernetes/api/core/v1/security_context.k deleted file mode 100644 index 3e354e3e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/security_context.k +++ /dev/null @@ -1,60 +0,0 @@ -""" -This is the security_context module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SecurityContext: - """ SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence. - - Attributes - ---------- - allowPrivilegeEscalation : bool, default is Undefined, 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 - privileged : bool, default is Undefined, optional - Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. - procMount : str, default is Undefined, optional - procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. - readOnlyRootFilesystem : bool, default is Undefined, optional - Whether this container has a read-only root filesystem. Default is false. - runAsGroup : int, default is Undefined, 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. - runAsNonRoot : bool, default is Undefined, 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. - runAsUser : int, default is Undefined, 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. - capabilities : Capabilities, default is Undefined, optional - The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. - seLinuxOptions : SELinuxOptions, default is Undefined, 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. - seccompProfile : SeccompProfile, default is Undefined, optional - The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. - windowsOptions : WindowsSecurityContextOptions, default is Undefined, optional - The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - """ - - - allowPrivilegeEscalation?: bool - - privileged?: bool - - procMount?: str - - readOnlyRootFilesystem?: bool - - runAsGroup?: int - - runAsNonRoot?: bool - - runAsUser?: int - - capabilities?: Capabilities - - seLinuxOptions?: SELinuxOptions - - seccompProfile?: SeccompProfile - - windowsOptions?: WindowsSecurityContextOptions - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/service.k b/base/pkg/kusion_kubernetes/api/core/v1/service.k deleted file mode 100644 index ddd8faa3..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/service.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the service module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Service: - """ Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy. - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - kind : "Service", default is "Service", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : ServiceSpec, default is Undefined, optional - Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - """ - - - apiVersion: "v1" = "v1" - - kind: "Service" = "Service" - - metadata?: apis.ObjectMeta - - spec?: ServiceSpec - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/service_account.k b/base/pkg/kusion_kubernetes/api/core/v1/service_account.k deleted file mode 100644 index 99e9cfd4..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/service_account.k +++ /dev/null @@ -1,41 +0,0 @@ -""" -This is the service_account module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema ServiceAccount: - """ ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets - - Attributes - ---------- - apiVersion : "v1", default is "v1", required - 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 - automountServiceAccountToken : bool, default is Undefined, optional - AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level. - imagePullSecrets : [LocalObjectReference], default is Undefined, optional - ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod - kind : "ServiceAccount", default is "ServiceAccount", required - 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 - secrets : [ObjectReference], default is Undefined, optional - Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. More info: https://kubernetes.io/docs/concepts/configuration/secret - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - """ - - - apiVersion: "v1" = "v1" - - automountServiceAccountToken?: bool - - imagePullSecrets?: [LocalObjectReference] - - kind: "ServiceAccount" = "ServiceAccount" - - secrets?: [ObjectReference] - - metadata?: apis.ObjectMeta - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/service_account_token_projection.k b/base/pkg/kusion_kubernetes/api/core/v1/service_account_token_projection.k deleted file mode 100644 index 6e98c531..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/service_account_token_projection.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the service_account_token_projection module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ServiceAccountTokenProjection: - """ ServiceAccountTokenProjection 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). - - Attributes - ---------- - audience : str, default is Undefined, 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. - expirationSeconds : int, default is Undefined, optional - ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. - path : str, default is Undefined, required - Path is the path relative to the mount point of the file to project the token into. - """ - - - audience?: str - - expirationSeconds?: int - - path: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/service_port.k b/base/pkg/kusion_kubernetes/api/core/v1/service_port.k deleted file mode 100644 index d7184a01..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/service_port.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This is the service_port module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ServicePort: - """ ServicePort contains information on service's port. - - Attributes - ---------- - appProtocol : str, default is Undefined, 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 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. - name : str, default is Undefined, optional - The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service. - nodePort : int, default is Undefined, optional - The port on each node on which this service is exposed when type is NodePort or LoadBalancer. Usually assigned by the system. If a value is specified, in-range, and not in use it will be used, otherwise the operation will fail. If not specified, a port will be allocated if this Service requires one. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type from NodePort to ClusterIP). More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - port : int, default is Undefined, required - The port that will be exposed by this service. - $protocol : str, default is Undefined, optional - The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". Default is TCP. - targetPort : int | str, default is Undefined, 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. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service - """ - - - appProtocol?: str - - name?: str - - nodePort?: int - - port: int - - $protocol?: str - - targetPort?: int | str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/service_spec.k b/base/pkg/kusion_kubernetes/api/core/v1/service_spec.k deleted file mode 100644 index 91080fe1..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/service_spec.k +++ /dev/null @@ -1,94 +0,0 @@ -""" -This is the service_spec module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ServiceSpec: - """ ServiceSpec describes the attributes that a user creates on a service. - - Attributes - ---------- - allocateLoadBalancerNodePorts : bool, default is Undefined, optional - allocateLoadBalancerNodePorts defines if NodePorts will be automatically allocated for services with type LoadBalancer. Default is "true". 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 and will be cleared if the type is changed to any other type. This field is beta-level and is only honored by servers that enable the ServiceLBNodePortControl feature. - clusterIP : str, default is Undefined, optional - clusterIP is the IP address of the service and is usually assigned randomly. If an address is specified manually, is in-range (as per system configuration), and is not in use, it will be allocated to the service; otherwise creation of the service will fail. This field may not be changed through updates unless the type field is also being changed to ExternalName (which requires this field to be blank) or the type field is being changed from ExternalName (in which case this field may optionally be specified, as describe above). Valid values are "None", empty string (""), or a valid IP address. Setting this to "None" makes a "headless service" (no virtual IP), which is useful when direct endpoint connections are preferred and proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. If this field is specified when creating a Service of type ExternalName, creation will fail. This field will be wiped when updating a Service to type ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - clusterIPs : [str], default is Undefined, optional - ClusterIPs is a list of IP addresses assigned to this service, and are usually assigned randomly. If an address is specified manually, is in-range (as per system configuration), and is not in use, it will be allocated to the service; otherwise creation of the service will fail. This field may not be changed through updates unless the type field is also being changed to ExternalName (which requires this field to be empty) or the type field is being changed from ExternalName (in which case this field may optionally be specified, as describe above). Valid values are "None", empty string (""), or a valid IP address. Setting this to "None" makes a "headless service" (no virtual IP), which is useful when direct endpoint connections are preferred and proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. If this field is specified when creating a Service of type ExternalName, creation will fail. This field will be wiped when updating a Service to type ExternalName. 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. - Unless the "IPv6DualStack" feature gate is enabled, this field is limited to one value, which must be the same as the clusterIP field. If the feature gate is enabled, this field may hold a maximum of two entries (dual-stack IPs, in either order). These IPs must correspond to the values of the ipFamilies field. Both clusterIPs and ipFamilies are governed by the ipFamilyPolicy field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - externalIPs : [str], default is Undefined, optional - externalIPs is 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. - externalName : str, default is Undefined, optional - externalName is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record). No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires `type` to be "ExternalName". - externalTrafficPolicy : str, default is Undefined, optional - externalTrafficPolicy 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. - healthCheckNodePort : int, default is Undefined, optional - healthCheckNodePort specifies the healthcheck nodePort for the service. This only applies when type is set to LoadBalancer and externalTrafficPolicy is set to Local. If a value is specified, is in-range, and is not in use, it will be used. If not specified, a value will be automatically allocated. External systems (e.g. load-balancers) can use this port to determine if a given node holds endpoints for this service or not. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type). - internalTrafficPolicy : str, default is Undefined, optional - InternalTrafficPolicy 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". - ipFamilies : [str], default is Undefined, optional - IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service, and is gated by the "IPv6DualStack" feature gate. 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. Valid values are "IPv4" and "IPv6". This field only applies to Services of types ClusterIP, NodePort, and LoadBalancer, and does apply to "headless" services. This field will be wiped when updating a Service to type ExternalName. - This field may hold a maximum of two entries (dual-stack families, in either order). These families must correspond to the values of the clusterIPs field, if specified. Both clusterIPs and ipFamilies are governed by the ipFamilyPolicy field. - ipFamilyPolicy : str, default is Undefined, optional - IPFamilyPolicy represents the dual-stack-ness requested or required by this Service, and is gated by the "IPv6DualStack" feature gate. 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. This field will be wiped when updating a service to type ExternalName. - loadBalancerClass : str, default is Undefined, optional - loadBalancerClass is 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, e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users. This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load balancer implementation is used, today this is typically done through the cloud provider integration, but should apply for any default implementation. If set, it is assumed that a load balancer implementation is watching for Services with a matching class. Any default load balancer implementation (e.g. cloud providers) should ignore Services that set this field. This field can only be set when creating or updating a Service to type 'LoadBalancer'. Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type. - loadBalancerIP : str, default is Undefined, optional - Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. - loadBalancerSourceRanges : [str], default is Undefined, 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." More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/ - ports : [ServicePort], default is Undefined, optional - 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 - publishNotReadyAddresses : bool, default is Undefined, optional - publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. The primary use case for setting this field is for a StatefulSet's Headless Service to propagate SRV DNS records for its Pods for the purpose of peer discovery. The Kubernetes controllers that generate Endpoints and EndpointSlice resources for Services interpret this to mean that all endpoints are considered "ready" even if the Pods themselves are not. Agents which consume only Kubernetes generated endpoints through the Endpoints or EndpointSlice resources can safely assume this behavior. - selector : {str:str}, default is Undefined, optional - Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/ - sessionAffinity : str, default is Undefined, optional - Supports "ClientIP" and "None". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - $type : str, default is Undefined, optional - type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ClusterIP" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects. If clusterIP is "None", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP. "NodePort" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP. "LoadBalancer" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP. "ExternalName" aliases this service to the specified externalName. Several other fields do not apply to ExternalName services. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - sessionAffinityConfig : SessionAffinityConfig, default is Undefined, optional - sessionAffinityConfig contains the configurations of session affinity. - """ - - - allocateLoadBalancerNodePorts?: bool - - clusterIP?: str - - clusterIPs?: [str] - - externalIPs?: [str] - - externalName?: str - - externalTrafficPolicy?: str - - healthCheckNodePort?: int - - internalTrafficPolicy?: str - - ipFamilies?: [str] - - ipFamilyPolicy?: str - - loadBalancerClass?: str - - loadBalancerIP?: str - - loadBalancerSourceRanges?: [str] - - ports?: [ServicePort] - - publishNotReadyAddresses?: bool - - selector?: {str:str} - - sessionAffinity?: str - - $type?: str - - sessionAffinityConfig?: SessionAffinityConfig - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/session_affinity_config.k b/base/pkg/kusion_kubernetes/api/core/v1/session_affinity_config.k deleted file mode 100644 index af19e6d5..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/session_affinity_config.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the session_affinity_config module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema SessionAffinityConfig: - """ SessionAffinityConfig represents the configurations of session affinity. - - Attributes - ---------- - clientIP : ClientIPConfig, default is Undefined, optional - clientIP contains the configurations of Client IP based session affinity. - """ - - - clientIP?: ClientIPConfig - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/storage_os_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/storage_os_volume_source.k deleted file mode 100644 index 65998d70..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/storage_os_volume_source.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the storage_os_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema StorageOSVolumeSource: - """ Represents a StorageOS persistent volume resource. - - Attributes - ---------- - fsType : str, default is Undefined, 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. - readOnly : bool, default is Undefined, optional - Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - volumeName : str, default is Undefined, optional - VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. - volumeNamespace : str, default is Undefined, optional - VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. - secretRef : LocalObjectReference, default is Undefined, optional - SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. - """ - - - fsType?: str - - readOnly?: bool - - volumeName?: str - - volumeNamespace?: str - - secretRef?: LocalObjectReference - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/sysctl.k b/base/pkg/kusion_kubernetes/api/core/v1/sysctl.k deleted file mode 100644 index 6144634b..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/sysctl.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the sysctl module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Sysctl: - """ Sysctl defines a kernel parameter to be set - - Attributes - ---------- - name : str, default is Undefined, required - Name of a property to set - value : str, default is Undefined, required - Value of a property to set - """ - - - name: str - - value: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/taint.k b/base/pkg/kusion_kubernetes/api/core/v1/taint.k deleted file mode 100644 index 6244a59a..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/taint.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the taint module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Taint: - """ The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. - - Attributes - ---------- - effect : str, default is Undefined, required - Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - key : str, default is Undefined, required - Required. The taint key to be applied to a node. - timeAdded : str, default is Undefined, optional - TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. - value : str, default is Undefined, optional - The taint value corresponding to the taint key. - """ - - - effect: str - - key: str - - timeAdded?: str - - value?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/tcp_socket_action.k b/base/pkg/kusion_kubernetes/api/core/v1/tcp_socket_action.k deleted file mode 100644 index eca3ffd9..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/tcp_socket_action.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the tcp_socket_action module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema TCPSocketAction: - """ TCPSocketAction describes an action based on opening a socket - - Attributes - ---------- - host : str, default is Undefined, optional - Optional: Host name to connect to, defaults to the pod IP. - port : int | str, default is Undefined, 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. - """ - - - host?: str - - port: int | str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/toleration.k b/base/pkg/kusion_kubernetes/api/core/v1/toleration.k deleted file mode 100644 index 73d4d899..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/toleration.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the toleration module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Toleration: - """ The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - - Attributes - ---------- - effect : str, default is Undefined, optional - Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - key : str, default is Undefined, 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 : str, default is Undefined, 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. - tolerationSeconds : int, default is Undefined, 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 : str, default is Undefined, 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. - """ - - - effect?: str - - key?: str - - operator?: str - - tolerationSeconds?: int - - value?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/topology_spread_constraint.k b/base/pkg/kusion_kubernetes/api/core/v1/topology_spread_constraint.k deleted file mode 100644 index 4722aca5..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/topology_spread_constraint.k +++ /dev/null @@ -1,35 +0,0 @@ -""" -This is the topology_spread_constraint module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema TopologySpreadConstraint: - """ TopologySpreadConstraint specifies how to spread matching pods among the given topology. - - Attributes - ---------- - maxSkew : int, default is Undefined, required - MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed. - topologyKey : str, default is Undefined, required - TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try to put balanced number of pods into each bucket. It's a required field. - whenUnsatisfiable : str, default is Undefined, required - WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, - but giving higher precedence to topologies that would help reduce the - skew.A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assigment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field. - labelSelector : apis.LabelSelector, default is Undefined, optional - LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain. - """ - - - maxSkew: int - - topologyKey: str - - whenUnsatisfiable: str - - labelSelector?: apis.LabelSelector - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/typed_local_object_reference.k b/base/pkg/kusion_kubernetes/api/core/v1/typed_local_object_reference.k deleted file mode 100644 index 892a0d01..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/typed_local_object_reference.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the typed_local_object_reference module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema TypedLocalObjectReference: - """ TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace. - - Attributes - ---------- - apiGroup : str, default is Undefined, optional - 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 : str, default is Undefined, required - Kind is the type of resource being referenced - name : str, default is Undefined, required - Name is the name of resource being referenced - """ - - - apiGroup?: str - - kind: str - - name: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/volume.k b/base/pkg/kusion_kubernetes/api/core/v1/volume.k deleted file mode 100644 index 27944ad0..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/volume.k +++ /dev/null @@ -1,150 +0,0 @@ -""" -This is the volume module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Volume: - """ Volume represents a named volume in a pod that may be accessed by any container in the pod. - - Attributes - ---------- - name : str, default is Undefined, required - 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 - awsElasticBlockStore : AWSElasticBlockStoreVolumeSource, default is Undefined, optional - AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - azureDisk : AzureDiskVolumeSource, default is Undefined, optional - AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - azureFile : AzureFileVolumeSource, default is Undefined, optional - AzureFile represents an Azure File Service mount on the host and bind mount to the pod. - cephfs : CephFSVolumeSource, default is Undefined, optional - CephFS represents a Ceph FS mount on the host that shares a pod's lifetime - cinder : CinderVolumeSource, default is Undefined, optional - Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md - configMap : ConfigMapVolumeSource, default is Undefined, optional - ConfigMap represents a configMap that should populate this volume - csi : CSIVolumeSource, default is Undefined, optional - CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). - downwardAPI : DownwardAPIVolumeSource, default is Undefined, optional - DownwardAPI represents downward API about the pod that should populate this volume - emptyDir : EmptyDirVolumeSource, default is Undefined, optional - EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - ephemeral : EphemeralVolumeSource, default is Undefined, optional - Ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. - - Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity - tracking are needed, - c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through - a PersistentVolumeClaim (see EphemeralVolumeSource for more - information on the connection between this volume type - and PersistentVolumeClaim). - - Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. - - Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. - - A pod can use both types of ephemeral volumes and persistent volumes at the same time. - This is a beta feature and only available when the GenericEphemeralVolume feature gate is enabled. - fc : FCVolumeSource, default is Undefined, optional - FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - flexVolume : FlexVolumeSource, default is Undefined, optional - FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - flocker : FlockerVolumeSource, default is Undefined, optional - Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - gcePersistentDisk : GCEPersistentDiskVolumeSource, default is Undefined, optional - GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - gitRepo : GitRepoVolumeSource, default is Undefined, optional - GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container. - glusterfs : GlusterfsVolumeSource, default is Undefined, optional - Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md - hostPath : HostPathVolumeSource, default is Undefined, optional - HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - iscsi : ISCSIVolumeSource, default is Undefined, optional - ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md - nfs : NFSVolumeSource, default is Undefined, optional - NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - persistentVolumeClaim : PersistentVolumeClaimVolumeSource, default is Undefined, optional - PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - photonPersistentDisk : PhotonPersistentDiskVolumeSource, default is Undefined, optional - PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - portworxVolume : PortworxVolumeSource, default is Undefined, optional - PortworxVolume represents a portworx volume attached and mounted on kubelets host machine - projected : ProjectedVolumeSource, default is Undefined, optional - Items for all in one resources secrets, configmaps, and downward API - quobyte : QuobyteVolumeSource, default is Undefined, optional - Quobyte represents a Quobyte mount on the host that shares a pod's lifetime - rbd : RBDVolumeSource, default is Undefined, optional - RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md - scaleIO : ScaleIOVolumeSource, default is Undefined, optional - ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - secret : SecretVolumeSource, default is Undefined, optional - Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - storageos : StorageOSVolumeSource, default is Undefined, optional - StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - vsphereVolume : VsphereVirtualDiskVolumeSource, default is Undefined, optional - VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - """ - - - name: str - - awsElasticBlockStore?: AWSElasticBlockStoreVolumeSource - - azureDisk?: AzureDiskVolumeSource - - azureFile?: AzureFileVolumeSource - - cephfs?: CephFSVolumeSource - - cinder?: CinderVolumeSource - - configMap?: ConfigMapVolumeSource - - csi?: CSIVolumeSource - - downwardAPI?: DownwardAPIVolumeSource - - emptyDir?: EmptyDirVolumeSource - - ephemeral?: EphemeralVolumeSource - - fc?: FCVolumeSource - - flexVolume?: FlexVolumeSource - - flocker?: FlockerVolumeSource - - gcePersistentDisk?: GCEPersistentDiskVolumeSource - - gitRepo?: GitRepoVolumeSource - - glusterfs?: GlusterfsVolumeSource - - hostPath?: HostPathVolumeSource - - iscsi?: ISCSIVolumeSource - - nfs?: NFSVolumeSource - - persistentVolumeClaim?: PersistentVolumeClaimVolumeSource - - photonPersistentDisk?: PhotonPersistentDiskVolumeSource - - portworxVolume?: PortworxVolumeSource - - projected?: ProjectedVolumeSource - - quobyte?: QuobyteVolumeSource - - rbd?: RBDVolumeSource - - scaleIO?: ScaleIOVolumeSource - - secret?: SecretVolumeSource - - storageos?: StorageOSVolumeSource - - vsphereVolume?: VsphereVirtualDiskVolumeSource - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/volume_device.k b/base/pkg/kusion_kubernetes/api/core/v1/volume_device.k deleted file mode 100644 index 3f5195bf..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/volume_device.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the volume_device module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema VolumeDevice: - """ volumeDevice describes a mapping of a raw block device within a container. - - Attributes - ---------- - devicePath : str, default is Undefined, required - devicePath is the path inside of the container that the device will be mapped to. - name : str, default is Undefined, required - name must match the name of a persistentVolumeClaim in the pod - """ - - - devicePath: str - - name: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/volume_mount.k b/base/pkg/kusion_kubernetes/api/core/v1/volume_mount.k deleted file mode 100644 index 2091849e..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/volume_mount.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This is the volume_mount module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema VolumeMount: - """ VolumeMount describes a mounting of a Volume within a container. - - Attributes - ---------- - mountPath : str, default is Undefined, required - Path within the container at which the volume should be mounted. Must not contain ':'. - mountPropagation : str, default is Undefined, optional - mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - name : str, default is Undefined, required - This must match the Name of a Volume. - readOnly : bool, default is Undefined, optional - Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - subPath : str, default is Undefined, optional - Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - subPathExpr : str, default is Undefined, optional - Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - """ - - - mountPath: str - - mountPropagation?: str - - name: str - - readOnly?: bool - - subPath?: str - - subPathExpr?: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/volume_projection.k b/base/pkg/kusion_kubernetes/api/core/v1/volume_projection.k deleted file mode 100644 index 837671af..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/volume_projection.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the volume_projection module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema VolumeProjection: - """ Projection that may be projected along with other supported volume types - - Attributes - ---------- - configMap : ConfigMapProjection, default is Undefined, optional - information about the configMap data to project - downwardAPI : DownwardAPIProjection, default is Undefined, optional - information about the downwardAPI data to project - secret : SecretProjection, default is Undefined, optional - information about the secret data to project - serviceAccountToken : ServiceAccountTokenProjection, default is Undefined, optional - information about the serviceAccountToken data to project - """ - - - configMap?: ConfigMapProjection - - downwardAPI?: DownwardAPIProjection - - secret?: SecretProjection - - serviceAccountToken?: ServiceAccountTokenProjection - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/vsphere_virtual_disk_volume_source.k b/base/pkg/kusion_kubernetes/api/core/v1/vsphere_virtual_disk_volume_source.k deleted file mode 100644 index 8e8f826c..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/vsphere_virtual_disk_volume_source.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the vsphere_virtual_disk_volume_source module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema VsphereVirtualDiskVolumeSource: - """ Represents a vSphere volume resource. - - Attributes - ---------- - fsType : str, default is Undefined, 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. - storagePolicyID : str, default is Undefined, optional - Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - storagePolicyName : str, default is Undefined, optional - Storage Policy Based Management (SPBM) profile name. - volumePath : str, default is Undefined, required - Path that identifies vSphere volume vmdk - """ - - - fsType?: str - - storagePolicyID?: str - - storagePolicyName?: str - - volumePath: str - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/weighted_pod_affinity_term.k b/base/pkg/kusion_kubernetes/api/core/v1/weighted_pod_affinity_term.k deleted file mode 100644 index 196cb54c..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/weighted_pod_affinity_term.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the weighted_pod_affinity_term module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema WeightedPodAffinityTerm: - """ The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - - Attributes - ---------- - weight : int, default is Undefined, required - weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - podAffinityTerm : PodAffinityTerm, default is Undefined, required - Required. A pod affinity term, associated with the corresponding weight. - """ - - - weight: int - - podAffinityTerm: PodAffinityTerm - - diff --git a/base/pkg/kusion_kubernetes/api/core/v1/windows_security_context_options.k b/base/pkg/kusion_kubernetes/api/core/v1/windows_security_context_options.k deleted file mode 100644 index 75775427..00000000 --- a/base/pkg/kusion_kubernetes/api/core/v1/windows_security_context_options.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the windows_security_context_options module in kusion_kubernetes.api.core.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema WindowsSecurityContextOptions: - """ WindowsSecurityContextOptions contain Windows-specific options and credentials. - - Attributes - ---------- - gmsaCredentialSpec : str, default is Undefined, optional - GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - gmsaCredentialSpecName : str, default is Undefined, optional - GMSACredentialSpecName is the name of the GMSA credential spec to use. - hostProcess : bool, default is Undefined, optional - HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - runAsUserName : str, default is Undefined, optional - 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. - """ - - - gmsaCredentialSpec?: str - - gmsaCredentialSpecName?: str - - hostProcess?: bool - - runAsUserName?: str - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/http_ingress_path.k b/base/pkg/kusion_kubernetes/api/networking/v1/http_ingress_path.k deleted file mode 100644 index 499745d8..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/http_ingress_path.k +++ /dev/null @@ -1,37 +0,0 @@ -""" -This is the http_ingress_path module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HTTPIngressPath: - """ HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend. - - Attributes - ---------- - path : str, default is Undefined, optional - 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". - pathType : str, default is Undefined, required - 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. - backend : IngressBackend, default is Undefined, required - Backend defines the referenced service endpoint to which the traffic will be forwarded to. - """ - - - path?: str - - pathType: str - - backend: IngressBackend - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/http_ingress_rule_value.k b/base/pkg/kusion_kubernetes/api/networking/v1/http_ingress_rule_value.k deleted file mode 100644 index 7f49406f..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/http_ingress_rule_value.k +++ /dev/null @@ -1,20 +0,0 @@ -""" -This is the http_ingress_rule_value module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema HTTPIngressRuleValue: - """ HTTPIngressRuleValue 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 '#'. - - Attributes - ---------- - paths : [HTTPIngressPath], default is Undefined, required - A collection of paths that map requests to backends. - """ - - - paths: [HTTPIngressPath] - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/ingress.k b/base/pkg/kusion_kubernetes/api/networking/v1/ingress.k deleted file mode 100644 index 07c54475..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/ingress.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the ingress module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema 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. - - Attributes - ---------- - apiVersion : "networking.k8s.io/v1", default is "networking.k8s.io/v1", required - 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 - kind : "Ingress", default is "Ingress", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - spec : IngressSpec, default is Undefined, optional - 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 - """ - - - apiVersion: "networking.k8s.io/v1" = "networking.k8s.io/v1" - - kind: "Ingress" = "Ingress" - - metadata?: apis.ObjectMeta - - spec?: IngressSpec - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_backend.k b/base/pkg/kusion_kubernetes/api/networking/v1/ingress_backend.k deleted file mode 100644 index 1988892c..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_backend.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This is the ingress_backend module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.api.core.v1 - - -schema IngressBackend: - """ IngressBackend describes all endpoints for a given service and port. - - Attributes - ---------- - resource : v1.TypedLocalObjectReference, default is Undefined, 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. This is a mutually exclusive setting with "Service". - service : IngressServiceBackend, default is Undefined, optional - Service references a Service as a Backend. This is a mutually exclusive setting with "Resource". - """ - - - resource?: v1.TypedLocalObjectReference - - service?: IngressServiceBackend - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_rule.k b/base/pkg/kusion_kubernetes/api/networking/v1/ingress_rule.k deleted file mode 100644 index 42d64d3d..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_rule.k +++ /dev/null @@ -1,30 +0,0 @@ -""" -This is the ingress_rule module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema IngressRule: - """ IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue. - - Attributes - ---------- - host : str, default is Undefined, 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 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 : HTTPIngressRuleValue, default is Undefined, optional - http - """ - - - host?: str - - http?: HTTPIngressRuleValue - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_service_backend.k b/base/pkg/kusion_kubernetes/api/networking/v1/ingress_service_backend.k deleted file mode 100644 index 5235ba03..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_service_backend.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the ingress_service_backend module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema IngressServiceBackend: - """ IngressServiceBackend references a Kubernetes Service as a Backend. - - Attributes - ---------- - name : str, default is Undefined, required - Name is the referenced service. The service must exist in the same namespace as the Ingress object. - port : ServiceBackendPort, default is Undefined, optional - Port of the referenced service. A port name or port number is required for a IngressServiceBackend. - """ - - - name: str - - port?: ServiceBackendPort - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_spec.k b/base/pkg/kusion_kubernetes/api/networking/v1/ingress_spec.k deleted file mode 100644 index fa40b66b..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_spec.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the ingress_spec module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema IngressSpec: - """ IngressSpec describes the Ingress the user wishes to exist. - - Attributes - ---------- - ingressClassName : str, default is Undefined, optional - 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. - rules : [IngressRule], default is Undefined, 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. - tls : [IngressTLS], default is Undefined, 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. - defaultBackend : IngressBackend, default is Undefined, 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. - """ - - - ingressClassName?: str - - rules?: [IngressRule] - - tls?: [IngressTLS] - - defaultBackend?: IngressBackend - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_tls.k b/base/pkg/kusion_kubernetes/api/networking/v1/ingress_tls.k deleted file mode 100644 index 08119505..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/ingress_tls.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the ingress_tls module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema IngressTLS: - """ IngressTLS describes the transport layer security associated with an Ingress. - - Attributes - ---------- - hosts : [str], default is Undefined, 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. - secretName : str, default is Undefined, optional - 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. - """ - - - hosts?: [str] - - secretName?: str - - diff --git a/base/pkg/kusion_kubernetes/api/networking/v1/service_backend_port.k b/base/pkg/kusion_kubernetes/api/networking/v1/service_backend_port.k deleted file mode 100644 index c6025a5d..00000000 --- a/base/pkg/kusion_kubernetes/api/networking/v1/service_backend_port.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the service_backend_port module in kusion_kubernetes.api.networking.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ServiceBackendPort: - """ ServiceBackendPort is the service port being referenced. - - Attributes - ---------- - name : str, default is Undefined, optional - Name is the name of the port on the Service. This is a mutually exclusive setting with "Number". - number : int, default is Undefined, optional - Number is the numerical port number (e.g. 80) on the Service. This is a mutually exclusive setting with "Name". - """ - - - name?: str - - number?: int - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/aggregation_rule.k b/base/pkg/kusion_kubernetes/api/rbac/v1/aggregation_rule.k deleted file mode 100644 index 2ed0b258..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/aggregation_rule.k +++ /dev/null @@ -1,21 +0,0 @@ -""" -This is the aggregation_rule module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema AggregationRule: - """ AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole - - Attributes - ---------- - clusterRoleSelectors : [apis.LabelSelector], default is Undefined, optional - ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added - """ - - - clusterRoleSelectors?: [apis.LabelSelector] - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/cluster_role.k b/base/pkg/kusion_kubernetes/api/rbac/v1/cluster_role.k deleted file mode 100644 index 4517130a..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/cluster_role.k +++ /dev/null @@ -1,37 +0,0 @@ -""" -This is the cluster_role module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema ClusterRole: - """ ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. - - Attributes - ---------- - apiVersion : "rbac.authorization.k8s.io/v1", default is "rbac.authorization.k8s.io/v1", required - 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 - kind : "ClusterRole", default is "ClusterRole", required - 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 - rules : [PolicyRule], default is Undefined, optional - Rules holds all the PolicyRules for this ClusterRole - aggregationRule : AggregationRule, default is Undefined, optional - AggregationRule is an optional field that 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 stomped by the controller. - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. - """ - - - apiVersion: "rbac.authorization.k8s.io/v1" = "rbac.authorization.k8s.io/v1" - - kind: "ClusterRole" = "ClusterRole" - - rules?: [PolicyRule] - - aggregationRule?: AggregationRule - - metadata?: apis.ObjectMeta - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/cluster_role_binding.k b/base/pkg/kusion_kubernetes/api/rbac/v1/cluster_role_binding.k deleted file mode 100644 index ec40ffd8..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/cluster_role_binding.k +++ /dev/null @@ -1,37 +0,0 @@ -""" -This is the cluster_role_binding module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema ClusterRoleBinding: - """ ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. - - Attributes - ---------- - apiVersion : "rbac.authorization.k8s.io/v1", default is "rbac.authorization.k8s.io/v1", required - 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 - kind : "ClusterRoleBinding", default is "ClusterRoleBinding", required - 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 - subjects : [Subject], default is Undefined, optional - Subjects holds references to the objects the role applies to. - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. - roleRef : RoleRef, default is Undefined, required - RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. - """ - - - apiVersion: "rbac.authorization.k8s.io/v1" = "rbac.authorization.k8s.io/v1" - - kind: "ClusterRoleBinding" = "ClusterRoleBinding" - - subjects?: [Subject] - - metadata?: apis.ObjectMeta - - roleRef: RoleRef - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/policy_rule.k b/base/pkg/kusion_kubernetes/api/rbac/v1/policy_rule.k deleted file mode 100644 index 06c6d0c6..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/policy_rule.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This is the policy_rule module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema PolicyRule: - """ PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. - - Attributes - ---------- - apiGroups : [str], default is Undefined, 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. - nonResourceURLs : [str], default is Undefined, 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. - resourceNames : [str], default is Undefined, optional - ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. - resources : [str], default is Undefined, optional - Resources is a list of resources this rule applies to. '*' represents all resources. - verbs : [str], default is Undefined, required - Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. '*' represents all verbs. - """ - - - apiGroups?: [str] - - nonResourceURLs?: [str] - - resourceNames?: [str] - - resources?: [str] - - verbs: [str] - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/role.k b/base/pkg/kusion_kubernetes/api/rbac/v1/role.k deleted file mode 100644 index ce0fe744..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/role.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This is the role module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Role: - """ Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. - - Attributes - ---------- - apiVersion : "rbac.authorization.k8s.io/v1", default is "rbac.authorization.k8s.io/v1", required - 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 - kind : "Role", default is "Role", required - 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 - rules : [PolicyRule], default is Undefined, optional - Rules holds all the PolicyRules for this Role - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. - """ - - - apiVersion: "rbac.authorization.k8s.io/v1" = "rbac.authorization.k8s.io/v1" - - kind: "Role" = "Role" - - rules?: [PolicyRule] - - metadata?: apis.ObjectMeta - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/role_binding.k b/base/pkg/kusion_kubernetes/api/rbac/v1/role_binding.k deleted file mode 100644 index 8b4321d1..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/role_binding.k +++ /dev/null @@ -1,37 +0,0 @@ -""" -This is the role_binding module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema RoleBinding: - """ RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. - - Attributes - ---------- - apiVersion : "rbac.authorization.k8s.io/v1", default is "rbac.authorization.k8s.io/v1", required - 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 - kind : "RoleBinding", default is "RoleBinding", required - 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 - subjects : [Subject], default is Undefined, optional - Subjects holds references to the objects the role applies to. - metadata : apis.ObjectMeta, default is Undefined, optional - Standard object's metadata. - roleRef : RoleRef, default is Undefined, required - RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. - """ - - - apiVersion: "rbac.authorization.k8s.io/v1" = "rbac.authorization.k8s.io/v1" - - kind: "RoleBinding" = "RoleBinding" - - subjects?: [Subject] - - metadata?: apis.ObjectMeta - - roleRef: RoleRef - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/role_ref.k b/base/pkg/kusion_kubernetes/api/rbac/v1/role_ref.k deleted file mode 100644 index 89703251..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/role_ref.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the role_ref module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema RoleRef: - """ RoleRef contains information that points to the role being used - - Attributes - ---------- - apiGroup : str, default is Undefined, required - APIGroup is the group for the resource being referenced - kind : str, default is Undefined, required - Kind is the type of resource being referenced - name : str, default is Undefined, required - Name is the name of resource being referenced - """ - - - apiGroup: str - - kind: str - - name: str - - diff --git a/base/pkg/kusion_kubernetes/api/rbac/v1/subject.k b/base/pkg/kusion_kubernetes/api/rbac/v1/subject.k deleted file mode 100644 index b679a1f1..00000000 --- a/base/pkg/kusion_kubernetes/api/rbac/v1/subject.k +++ /dev/null @@ -1,32 +0,0 @@ -""" -This is the subject module in kusion_kubernetes.api.rbac.v1 package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Subject: - """ Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names. - - Attributes - ---------- - apiGroup : str, default is Undefined, optional - APIGroup holds the API group of the referenced subject. Defaults to "" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for User and Group subjects. - kind : str, default is Undefined, required - Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". If the Authorizer does not recognized the kind value, the Authorizer should report an error. - name : str, default is Undefined, required - Name of the object being referenced. - namespace : str, default is Undefined, optional - Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty the Authorizer should report an error. - """ - - - apiGroup?: str - - kind: str - - name: str - - namespace?: str - - diff --git a/base/pkg/kusion_kubernetes/apimachinery/apis/label_selector.k b/base/pkg/kusion_kubernetes/apimachinery/apis/label_selector.k deleted file mode 100644 index ae67e785..00000000 --- a/base/pkg/kusion_kubernetes/apimachinery/apis/label_selector.k +++ /dev/null @@ -1,24 +0,0 @@ -""" -This is the label_selector module in kusion_kubernetes.apimachinery.apis package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema LabelSelector: - """ A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. - - Attributes - ---------- - matchExpressions : [LabelSelectorRequirement], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - - matchExpressions?: [LabelSelectorRequirement] - - matchLabels?: {str:str} - - diff --git a/base/pkg/kusion_kubernetes/apimachinery/apis/label_selector_requirement.k b/base/pkg/kusion_kubernetes/apimachinery/apis/label_selector_requirement.k deleted file mode 100644 index 62beab8c..00000000 --- a/base/pkg/kusion_kubernetes/apimachinery/apis/label_selector_requirement.k +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is the label_selector_requirement module in kusion_kubernetes.apimachinery.apis package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema LabelSelectorRequirement: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - - key: str - - operator: str - - values?: [str] - - diff --git a/base/pkg/kusion_kubernetes/apimachinery/apis/managed_fields_entry.k b/base/pkg/kusion_kubernetes/apimachinery/apis/managed_fields_entry.k deleted file mode 100644 index 27664736..00000000 --- a/base/pkg/kusion_kubernetes/apimachinery/apis/managed_fields_entry.k +++ /dev/null @@ -1,44 +0,0 @@ -""" -This is the managed_fields_entry module in kusion_kubernetes.apimachinery.apis package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ManagedFieldsEntry: - """ ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to. - - Attributes - ---------- - apiVersion : str, default is Undefined, optional - APIVersion defines the version of this resource that this field set applies to. The format is "group/version" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted. - fieldsType : str, default is Undefined, optional - FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: "FieldsV1" - fieldsV1 : any, default is Undefined, optional - FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. - manager : str, default is Undefined, optional - Manager is an identifier of the workflow managing these fields. - operation : str, default is Undefined, optional - Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'. - subresource : str, default is Undefined, optional - Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource. - time : str, default is Undefined, optional - Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply' - """ - - - apiVersion?: str - - fieldsType?: str - - fieldsV1?: any - - manager?: str - - operation?: str - - subresource?: str - - time?: str - - diff --git a/base/pkg/kusion_kubernetes/apimachinery/apis/object_meta.k b/base/pkg/kusion_kubernetes/apimachinery/apis/object_meta.k deleted file mode 100644 index 3791f117..00000000 --- a/base/pkg/kusion_kubernetes/apimachinery/apis/object_meta.k +++ /dev/null @@ -1,89 +0,0 @@ -""" -This is the object_meta module in kusion_kubernetes.apimachinery.apis package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ObjectMeta: - """ ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. - - Attributes - ---------- - annotations : {str:str}, default is Undefined, optional - Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations - clusterName : str, default is Undefined, optional - The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. - creationTimestamp : str, default is Undefined, optional - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - deletionGracePeriodSeconds : int, default is Undefined, optional - Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. - deletionTimestamp : str, default is Undefined, optional - DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. - Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - finalizers : [str], default is Undefined, optional - Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. - generateName : str, default is Undefined, optional - GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. - - If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). - Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency - generation : int, default is Undefined, optional - A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. - labels : {str:str}, default is Undefined, optional - Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels - managedFields : [ManagedFieldsEntry], default is Undefined, optional - ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. - name : str, default is Undefined, optional - Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names - namespace : str, default is Undefined, optional - Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. - Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - ownerReferences : [OwnerReference], default is Undefined, optional - List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. - resourceVersion : str, default is Undefined, optional - An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. - Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - selfLink : str, default is Undefined, optional - SelfLink is a URL representing this object. Populated by the system. Read-only. - DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. - uid : str, default is Undefined, optional - UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. - Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids - """ - - - annotations?: {str:str} - - clusterName?: str - - creationTimestamp?: str - - deletionGracePeriodSeconds?: int - - deletionTimestamp?: str - - finalizers?: [str] - - generateName?: str - - generation?: int - - labels?: {str:str} - - managedFields?: [ManagedFieldsEntry] - - name?: str - - namespace?: str - - ownerReferences?: [OwnerReference] - - resourceVersion?: str - - selfLink?: str - - uid?: str - - diff --git a/base/pkg/kusion_kubernetes/apimachinery/apis/owner_reference.k b/base/pkg/kusion_kubernetes/apimachinery/apis/owner_reference.k deleted file mode 100644 index 94237e0d..00000000 --- a/base/pkg/kusion_kubernetes/apimachinery/apis/owner_reference.k +++ /dev/null @@ -1,40 +0,0 @@ -""" -This is the owner_reference module in kusion_kubernetes.apimachinery.apis package. -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema OwnerReference: - """ OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field. - - Attributes - ---------- - apiVersion : str, default is Undefined, required - API version of the referent. - blockOwnerDeletion : bool, default is Undefined, optional - If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. - controller : bool, default is Undefined, optional - If true, this reference points to the managing controller. - kind : str, default is Undefined, required - Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - name : str, default is Undefined, required - Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names - uid : str, default is Undefined, required - UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids - """ - - - apiVersion: str - - blockOwnerDeletion?: bool - - controller?: bool - - kind: str - - name: str - - uid: str - - diff --git a/base/pkg/kusion_models/kube/backend/job_backend.k b/base/pkg/kusion_models/kube/backend/job_backend.k deleted file mode 100644 index 5266fe4e..00000000 --- a/base/pkg/kusion_models/kube/backend/job_backend.k +++ /dev/null @@ -1,106 +0,0 @@ -import base.pkg.kusion_kubernetes.api.batch.v1 as batchv1 -import base.pkg.kusion_models.kube.frontend -import base.pkg.kusion_models.kube.mixins -import base.pkg.kusion_models.kube.utils -import base.pkg.kusion_models.kube.metadata -import base.pkg.kusion_models.kube.resource - -schema JobBackend[inputConfig: frontend.Job]: - # mixins - mixin [ - # Resource builder mixin - mixins.NamespaceMixin, - mixins.ConfigMapMixin, - mixins.ServiceAccountMixin - - # mixins.OutputTypeMixin - ] - - config: frontend.Job = inputConfig - - # variables - jobName: str = "{}-{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME).lower() - app: utils.ApplicationBuilder = utils.ApplicationBuilder {} - mainContainerDict: {str:} - mainContainer: {str:} - sidecarContainers?: [{str:}] - initContainers?: [{str:}] - - # rendering logic - if config.mainContainer: - assert config.image, "config.image must be specified and can't be empty or None or Undefined" - # construct input for converter - mainContainerDict = { - **config.mainContainer - if config.mainContainer.useBuiltInEnv: - env += app.envs - name = config.mainContainer.name or "main" - image = config.image - resource = config?.schedulingStrategy?.resource - } - mainContainer = utils.VolumePatch(config.volumes, [utils.ContainerFrontend2Kube(mainContainerDict)])?[0] - - if config.sidecarContainers: - sidecarContainers = utils.VolumePatch(config.volumes, [utils.ContainerFrontend2Kube(_s) for _s in config.sidecarContainers]) - - if config.initContainers: - initContainers = utils.VolumePatch(config.volumes, [utils.ContainerFrontend2Kube(_s) for _s in config.initContainers]) - - # construct job attributes - jobAttrs: {str:} = { - metadata = utils.MetadataBuilder(config) | { - name = jobName - } - spec = { - activeDeadlineSeconds = config.activeDeadlineSeconds - backoffLimit = config.backoffLimit - completionMode = config.completionMode - completions = config.completions - manualSelector = config.manualSelector - parallelism = config.parallelism - suspend = config.suspend - ttlSecondsAfterFinished = config.ttlSecondsAfterFinished - selector.matchLabels = app.selector | config.selector - - template = { - metadata = { - labels = app.labels - **config.podMetadata - } - spec = { - containers = [ - mainContainer - *sidecarContainers - ] - initContainers = initContainers - restartPolicy = config.restartPolicy - # volume - if config.volumes: volumes = [ - (lambda volume { - volumeType = typeof(volume.volumeSource) - assert volumeType in VOLUME_SOURCE_TYPE_MAPPING, "Invalid frontend volume type, please check VOLUME_SOURCE_TYPE_MAPPING" - kubeVolumeType = VOLUME_SOURCE_TYPE_MAPPING[volumeType] - { - name = volume.name - if typeof(volume.volumeSource) == "EmptyDir" and volume.volumeSource.medium == "": - "${kubeVolumeType}" = {} - else: - "${kubeVolumeType}" = volume.volumeSource - } - })(volume) for volume in config.volumes if volume.volumeSource - ] - # service account - if config.serviceAccount: - serviceAccountName = config.serviceAccount.name - } - } - } - } - - # generate job instance - _jobInstance = batchv1.Job {**jobAttrs} - - # put job instance to backend result - kubernetes: resource.ResourceMapping = { - "${typeof(_jobInstance)}" = [_jobInstance] - } diff --git a/base/pkg/kusion_models/kube/backend/server_backend.k b/base/pkg/kusion_models/kube/backend/server_backend.k deleted file mode 100644 index c3b2e416..00000000 --- a/base/pkg/kusion_models/kube/backend/server_backend.k +++ /dev/null @@ -1,134 +0,0 @@ -import base.pkg.kusion_kubernetes.api.apps.v1 as appsv1 -import base.pkg.kusion_kubernetes.api.core.v1 as corev1 -import base.pkg.kusion_models.kube.frontend.server -import base.pkg.kusion_models.kube.mixins -import base.pkg.kusion_models.kube.metadata -import base.pkg.kusion_models.kube.utils -import base.pkg.kusion_models.kube.resource -import base.pkg.kusion_prometheus.mixins as pmixins - -# Frontend volume to kubernetes volume mapping. -VOLUME_SOURCE_TYPE_MAPPING = { - EmptyDir = "emptyDir" - Secret = "secret" - ConfigMap = "configMap" - DownwardAPI = "downwardAPI" - CSI = "csi" - HostPath = "hostPath" -} - -schema ServerBackend[inputConfig: server.Server]: - """ServerBackend converts the user-written front-end model `Server` into a - collection of kubernetes resources and places the resource collection into - the `kubernetes` attribute. - """ - mixin [ - # Resource builder mixin - mixins.NamespaceMixin, - mixins.ConfigMapMixin, - mixins.SecretMixin, - mixins.ServiceMixin, - mixins.IngressMixin, - mixins.ServiceAccountMixin, - - # Monitor mixin - pmixins.MonitorMixin - ] - - # Store the input config parameter, ensure it can be seen in protocol and mixin. - config: server.Server = inputConfig - # Workload name. - workloadName: str = "{}{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME).lower() - # App variable contains labels, selector and environments. - app: utils.ApplicationBuilder = utils.ApplicationBuilder {} - # Main containers and sidecar contrainers. - mainContainer: {str:} - sidecarContainers?: [{str:}] - initContainers?: [{str:}] - - if config.mainContainer: - assert config.image, "config.image must be specified and can't be empty or None or Undefined" - # Construct input of converter using the volumes. - mainContainer = utils.VolumePatch(config.volumes, [utils.ContainerFrontend2Kube({ - **config.mainContainer - if config.mainContainer.useBuiltInEnv: - env += app.envs - name = config.mainContainer.name or "main" - image = config.image - resource = config?.schedulingStrategy?.resource - })])?[0] - - if config.sidecarContainers: - sidecarContainers = utils.VolumePatch(config.volumes, [utils.ContainerFrontend2Kube(_s) for _s in config.sidecarContainers]) - - if config.initContainers: - initContainers = utils.VolumePatch(config.volumes, [utils.ContainerFrontend2Kube(_s) for _s in config.initContainers]) - - # Construct workload attributes. - workloadAttributes: {str:} = { - metadata = utils.MetadataBuilder(config) | { - name = workloadName - } - spec = { - replicas = config.replicas - if config.useBuiltInSelector: - selector.matchLabels: app.selector | config.selector - else: - selector.matchLabels: config.selector - template = { - metadata = { - if config.useBuiltInLabels: - labels = app.labels - **config.podMetadata - } - spec = { - containers = [mainContainer] + (sidecarContainers or []) - initContainers = initContainers - if config.volumes: volumes = [ - (lambda volume { - """Convert frontend volume to kubernetes Volume.""" - volumeType = typeof(volume.volumeSource) - assert volumeType in VOLUME_SOURCE_TYPE_MAPPING, "Invalid frontend volume type, please check VOLUME_SOURCE_TYPE_MAPPING" - kubeVolumeType = VOLUME_SOURCE_TYPE_MAPPING[volumeType] - { - name = volume.name - if typeof(volume.volumeSource) == "EmptyDir" and volume.volumeSource.medium == "": - "${kubeVolumeType}" = {} - else: - "${kubeVolumeType}" = volume.volumeSource - } - })(volume) for volume in config.volumes if volume.volumeSource - ] - if config.serviceAccount: - serviceAccountName = config.serviceAccount.name - } - } - } - } - - # Generate workload instance. - if config.workloadType == "Deployment": - _workloadInstance = appsv1.Deployment {**workloadAttributes} - elif config.workloadType == "StatefulSet": - # Generate default headless service of StatefulSet. - _headlessServiceInstance = corev1.Service { - metadata = workloadAttributes.metadata - spec = { - clusterIP = "None" - selector = workloadAttributes.spec.selector.matchLabels - } - } - _workloadInstance = appsv1.StatefulSet { - **workloadAttributes - spec.serviceName = _headlessServiceInstance.metadata.name - } - else: - assert False, "Invalid workload name {}".format(config.workloadType) - - # Put workload instance to backend result. - kubernetes: resource.ResourceMapping = { - if _workloadInstance: - "${typeof(_workloadInstance)}" = [_workloadInstance] - if _headlessServiceInstance: - "${typeof(_headlessServiceInstance)}" = [_headlessServiceInstance] - } diff --git a/base/pkg/kusion_models/kube/frontend/common/metadata.k b/base/pkg/kusion_models/kube/frontend/common/metadata.k deleted file mode 100644 index 5e30f830..00000000 --- a/base/pkg/kusion_models/kube/frontend/common/metadata.k +++ /dev/null @@ -1,36 +0,0 @@ -schema Metadata: - """Metadata is the base schema of all models, which contains data - that helps uniquely identify the object. - - Attributes - ---------- - name: str, default is Undefined, required. - The name of the resource. - Name must be unique within a namespace. It's required when creating - resources, although some resources may allow a client to request the - generation of an appropriate name automatically. - Name is primarily intended for creation idempotence and configuration - definition. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/identifiers#names - labels: {str:str}, default is Undefined, optional. - Labels is a map of string keys and values that can be used to - organize and categorize (scope and select) objects. - May match selectors of replication controllers and services. - More info: http://kubernetes.io/docs/user-guide/labels - annotations: {str:str}, default is Undefined, optional. - Annotations is an unstructured key value map stored with a - resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. - More info: http://kubernetes.io/docs/user-guide/annotations - namespace: str, default is Undefined, optional. - Namespaces are intended for use in environments with many users spread - across multiple teams, or projects. - For clusters with a few to tens of users, you should not need to create - or think about namespaces at all. Start using namespaces when you need the features they provide. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - """ - name?: str - labels?: {str:str} - annotations?: {str:str} - namespace?: str diff --git a/base/pkg/kusion_models/kube/frontend/configmap/configmap.k b/base/pkg/kusion_models/kube/frontend/configmap/configmap.k deleted file mode 100644 index 629a70d6..00000000 --- a/base/pkg/kusion_models/kube/frontend/configmap/configmap.k +++ /dev/null @@ -1,26 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.common - -schema ConfigMap(common.Metadata): - """ConfigMap holds configuration data for pods to consume. - More info: https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/config-map-v1/#ConfigMap - - Attributes - ---------- - data: {str:str}, default is Undefined, optional. - Data contains the configuration data. - binaryData: {str:str}, default is Undefined, optional - BinaryData contains the binary data. - - Examples - -------- - configmap = ConfigMap { - name = "my-configmap" - namespace = "my-configmap-namespace" - data = { - foo = "bar" - bar = "foo" - } - } - """ - data?: {str:str} - binaryData?: {str:str} diff --git a/base/pkg/kusion_models/kube/frontend/container/container.k b/base/pkg/kusion_models/kube/frontend/container/container.k deleted file mode 100644 index 1ff8e408..00000000 --- a/base/pkg/kusion_models/kube/frontend/container/container.k +++ /dev/null @@ -1,75 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.container.probe as p -import base.pkg.kusion_models.kube.frontend.container.env as e -import base.pkg.kusion_models.kube.frontend.container.port as cp -import base.pkg.kusion_models.kube.frontend.container.lifecycle as lc - -schema Main: - """ Main describes the main container configuration that is expected to be run on the host. - - Attributes - ---------- - name: str, default is "main", required. - A Container-level attribute. - The container name. Each container in a pod must have a unique name. - command: [str], default is Undefined, optional. - A Container-level attribute. - The startup command of main process. The image's entrypoint is used if this is not provided. - useBuiltInEnv: bool, default is False, optional. - useBuiltInEnv indicates use built-in envs or not. - args: [str], default is Undefined, optional. - A Container-level attribute. - The startup arguments of main process. The image's cmd is used if this is not provided. - env: [e.Env], default is Undefined, optional. - A Container-level attribute. - List of environment variables in the container. - envFrom: [e.EnvFromSource], default is Undefined, optional. - A Container-level attribute. - List of sources to populate environment variables in the container. - ports: [cp.ContainerPort], default is Undefined, optional. - A Container-level attribute. - List of network ports in the container. - livenessProbe: p.Probe, default is Undefined, optional. - A Container-level attribute. - The probe to check whether container is live or not. - readinessProbe: p.Probe, default is Undefined, optional. - A Container-level attribute. - The probe to check whether container is ready or not. - The default value can be referred to presupposed template: base/pkg/kusion_models/templates/sofa_probe.k - startupProbe: p.Probe, default is Undefined, optional. - A Container-level attribute. - The probe to indicates that the Pod has successfully initialized. - - Examples - -------- - import base.pkg.kusion_models.kube.frontend.container - import base.pkg.kusion_models.kube.frontend.container.probe as p - - main = container.Main { - name = "test" - livenessProbe = p.Probe { - handler = p.Http { - path = "/healthz" - } - initialDelaySeconds = 10 - } - } - """ - - name: str = "main" - command?: [str] - args?: [str] - useBuiltInEnv?: bool = False - env?: [e.Env] - envFrom?: [e.EnvFromSource] - ports?: [cp.ContainerPort] - - livenessProbe?: p.Probe - readinessProbe?: p.Probe - startupProbe?: p.Probe - - lifecycle?: lc.Lifecycle - workingDir?: str - securityContext?: {str:} - - check: - livenessProbe.successThreshold == 1 if livenessProbe, "success threshold must be 1 for liveness probe" diff --git a/base/pkg/kusion_models/kube/frontend/container/env/env.k b/base/pkg/kusion_models/kube/frontend/container/env/env.k deleted file mode 100644 index a859e95e..00000000 --- a/base/pkg/kusion_models/kube/frontend/container/env/env.k +++ /dev/null @@ -1,129 +0,0 @@ -import regex -import units - -schema Env: - """ Env represents an environment variable present in a Container. - - Attributes - ---------- - name: str, default is Undefined, required. - A Container-level attribute. - The env name. This must be a C_IDENTIFIER. - value: str, default is Undefined, optional. - A Container-level attribute. - The simple literal value. - valueFrom: EnvValueFrom, default is Undefined, optional. - A Container-level attribute. - The ref source of this env. - """ - - name: str - value?: str - valueFrom?: EnvValueFrom - - check: - len(name) <= 63, "a valid env name must be no more than 63 characters" - regex.match(name, r"[A-Za-z_][A-Za-z0-9_]*"), "a valid env name must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'" - not valueFrom if value, "valueFrom may not be specified when `value` is not empty" - -schema EnvValueFrom: - """ EnvValueFrom represents the source of the value of an Env. - - Attributes - ---------- - fieldRef: ObjectFieldSelector, default is Undefined, optional. - A Container-level attribute. - Selects a key of a field. - configMapKeyRef: ObjectKeySelector, default is Undefined, optional. - A Container-level attribute. - Selects a key of a ConfigMap. - secretKeyRef: ObjectKeySelector, default is Undefined, optional. - A Container-level attribute. - Selects a key of a secret. - resourceFieldRef: ResourceFieldSelector, default is Undefined, optional. - A Container-level attribute. - 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. - """ - - fieldRef?: ObjectFieldSelector - configMapKeyRef?: ObjectKeySelector - secretKeyRef?: ObjectKeySelector - resourceFieldRef?: ResourceFieldSelector - - check: - (fieldRef and not configMapKeyRef and not secretKeyRef and not resourceFieldRef) or \ - (not fieldRef and configMapKeyRef and not secretKeyRef and not resourceFieldRef) or \ - (not fieldRef and not configMapKeyRef and secretKeyRef and not resourceFieldRef) or \ - (not fieldRef and not configMapKeyRef and not secretKeyRef and resourceFieldRef), "must specify one of: `fieldRef`, `configMapKeyRef`, `secretKeyRef` or `resourceFieldRef`" - -schema ObjectKeySelector: - """ ObjectKeySelector contains enough information to let you locate the referenced object. - - Attributes - ---------- - name: str, default is Undefined, required. - A Container-level attribute. - The name of object, typically a ConfigMap or Secret name. - key: str, default is Undefined, required. - A Container-level attribute. - The key of the object to select from. - """ - - name: str - key: str - -schema ObjectFieldSelector: - """ ObjectFieldSelector contains enough information to let you select field of an object. - - Attributes - ---------- - apiVersion: str, default is v1, optional. - A Container-level attribute. - Version of the schema the FieldPath is written in terms of, defaults to "v1". - fieldPath: str, default is Undefined, required. - A Container-level attribute. - Path of the field to select of an object. - """ - - apiVersion?: str = "v1" - fieldPath: str - -type Unit = units.NumberMultiplier -schema ResourceFieldSelector: - """ ResourceFieldSelector represents container resources (cpu, memory) and their output format. - - Attributes - ---------- - containerName: str, default is Undefined, required for volumes, optional for env vars. - A Container-level attribute. - resource: str, default is Undefined, required. - A Container-level attribute. - Resource to select. - divisor: int | Unit, default is 1, optional. - A Container-level attribute. - Specifies the output format of the exposed resources, defaults to 1 - """ - containerName?: str - resource: str - divisor?: int | Unit = 1 - -schema EnvFromSource: - """ EnvFromSource represents the source of a set of ConfigMaps or Secrets. - - Attributes - ---------- - configMapRef: str, default is Undefined, optional. - A Container-level attribute. - The ConfigMap name to select from. - secretRef: str, default is Undefined, optional. - A Container-level attribute. - The Secret name to select from. - """ - - configMapRef?: str - secretRef?: str - - check: - not configMapRef or not secretRef, "can not set configMapRef and secretRef in env at the same time" - configMapRef or secretRef, "must specify one of: `configMapRef` or `secretRef`" diff --git a/base/pkg/kusion_models/kube/frontend/container/lifecycle/lifecycle.k b/base/pkg/kusion_models/kube/frontend/container/lifecycle/lifecycle.k deleted file mode 100644 index 526667c8..00000000 --- a/base/pkg/kusion_models/kube/frontend/container/lifecycle/lifecycle.k +++ /dev/null @@ -1,36 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.container.probe as p - -schema Lifecycle: - """ Lifecycle describes actions that the management system should take in response - to container lifecycle events. - - Attributes - ---------- - preStop: p.Exec|p.Http, default is Undefined, optional. - A Container-level attribute. - The PreStop action is called immediately before a container is terminated. - postStart: p.Exec|p.Http, default is Undefined, optional. - A Container-level attribute. - The PostStart action is called immediately after a container is created. - - Examples - -------- - import base.pkg.kusion_models.kube.frontend.container.lifecycle as lc - import base.pkg.kusion_models.kube.frontend.container.probe as p - - p = lc.Lifecycle { - preStop = p.Exec { - command = [ - "timeout" - "--signal=9" - "1800s" - "sh" - "-c" - "bash -x /tmp/image-builder/boot/boot.sh" - ] - } - } - """ - - preStop?: p.Exec | p.Http - postStart?: p.Exec | p.Http diff --git a/base/pkg/kusion_models/kube/frontend/container/port/container_port.k b/base/pkg/kusion_models/kube/frontend/container/port/container_port.k deleted file mode 100644 index 39653745..00000000 --- a/base/pkg/kusion_models/kube/frontend/container/port/container_port.k +++ /dev/null @@ -1,31 +0,0 @@ -schema ContainerPort: - """ ContainerPort represents a network port in a single container. - - Attributes - ---------- - name: str, default is Undefined, 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: "TCP" | "UDP" | "SCTP", default is "TCP", required. - A Container-level attribute. - The protocol for port. Must be UDP, TCP or SCTP. Default is TCP. - containerPort: int, default is Undefined, optional. - A Container-level attribute. - The number of port to expose on the container's IP address. - - Examples - -------- - p = ContainerPort { - name = "test" - protocol = "TCP" - containerPort = 8080 - } - """ - - name?: str - protocol: "TCP" | "UDP" | "SCTP" = "TCP" - containerPort: int - - check: - 1 <= containerPort <= 65535, "containerPort must be between 1 and 65535, inclusive" diff --git a/base/pkg/kusion_models/kube/frontend/container/probe/probe.k b/base/pkg/kusion_models/kube/frontend/container/probe/probe.k deleted file mode 100644 index d2d1ed3c..00000000 --- a/base/pkg/kusion_models/kube/frontend/container/probe/probe.k +++ /dev/null @@ -1,104 +0,0 @@ -schema Probe: - """ Probe describes a health check to be performed against a container - to determine whether it is alive or ready to receive traffic. - - Attributes - ---------- - handler: Exec|Http|Tcp, default is Undefined, required. - A Container-level attribute. - The action taken to determine the health of a container. - initialDelaySeconds: int, default is Undefined, optional. - A Container-level attribute. - The length of time before health checking is activated. In seconds. - timeoutSeconds: int, default is Undefined, optional. - A Container-level attribute. - The length of time before health checking times out. In seconds. - periodSeconds: int, default is 10, optional. - A Container-level attribute. - How often (in seconds) to perform the probe. - successThreshold: int, default is Undefined, optional. - A Container-level attribute. - Minimum consecutive successes for the probe to be considered successful after having failed. - failureThreshold: int, default is Undefined, optional. - A Container-level attribute. - Minimum consecutive failures for the probe to be considered failed after having succeeded. - - Examples - -------- - import base.pkg.kusion_models.kube.frontend.container.probe as p - - probe = p.Probe { - handler = p.Http { - path = "/healthz" - } - initialDelaySeconds = 10 - } - """ - - handler: Exec | Http | Tcp - - initialDelaySeconds?: int - timeoutSeconds?: int - periodSeconds?: int = 10 - successThreshold?: int - failureThreshold?: int - - check: - initialDelaySeconds >= 0 if initialDelaySeconds, "initialDelaySeconds must be greater than or equal to 0" - timeoutSeconds >= 0 if timeoutSeconds, "timeoutSeconds must be greater than or equal to 0" - periodSeconds >= 0 if periodSeconds, "periodSeconds must be greater than or equal to 0" - successThreshold >= 0 if successThreshold, "successThreshold must be greater than or equal to 0" - failureThreshold >= 0 if failureThreshold, "failureThreshold must be greater than or equal to 0" - -schema Exec: - """ Exec describes a "run in container" action. - - Attributes - ---------- - command: str, default is Undefined, required. - A Container-level attribute. - The command line to execute inside the container. - """ - - command: [str] - - check: - len(command) > 0, "command must be specified" - -schema Http: - """ Http describes an action based on HTTP Get requests. - - Attributes - ---------- - path: str, default is Undefined, required. - A Container-level attribute. - The Path to access on the HTTP server. e.g /healthz - port: int, default is Undefined, required. - A Container-level attribute. - The Number of the port to access on the container. - scheme: "HTTP" | "HTTPS", default is "HTTP", required. - A Container-level attribute. - Scheme to use for connecting to the host, defaults to HTTP. - """ - - path: str - port: int - scheme: "HTTP" | "HTTPS" = "HTTP" - - check: - 1 <= port <= 65535, "http port must be between 1 and 65535, inclusive" - -schema Tcp: - """ Tcp describes an action based on opening a socket. - - Attributes - ---------- - tcpSocket: int, default is Undefined, required. - A Container-level attribute. - The TCP socket port to connect to. - """ - - tcpSocket: int - - check: - tcpSocket >= 1 and tcpSocket <= 65535, "tcpSocket must be between 1 and 65535, inclusive" diff --git a/base/pkg/kusion_models/kube/frontend/ingress/ingress.k b/base/pkg/kusion_models/kube/frontend/ingress/ingress.k deleted file mode 100644 index 9defb776..00000000 --- a/base/pkg/kusion_models/kube/frontend/ingress/ingress.k +++ /dev/null @@ -1,72 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_kubernetes.api.networking.v1 as networking_v1 - -schema Ingress(common.Metadata): - """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. - - Attributes - ---------- - name: str - The name of the resource. - Name must be unique within a namespace. It's required when creating - resources, although some resources may allow a client to request the - generation of an appropriate name automatically. - Name is primarily intended for creation idempotence and configuration - definition. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/identifiers#names - Required. - labels: {str:str} - Labels is a map of string keys and values that can be used to - organize and categorize (scope and select) objects. - May match selectors of replication controllers and services. - More info: http://kubernetes.io/docs/user-guide/labels - Optional. - annotations: {str:str} - Annotations is an unstructured key value map stored with a - resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. - More info: http://kubernetes.io/docs/user-guide/annotations - Optional. - namespace: str - Namespaces are intended for use in environments with many users spread - across multiple teams, or projects. - For clusters with a few to tens of users, you should not need to create - or think about namespaces at all. Start using namespaces when you need the features they provide. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - Optional. - rules: [networking_v1beta1.IngressRule] - A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. - tls: [IngressTLS], default is Undefined, 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. - - Examples - -------- - ingress.Ingress { - name = "example-ingress" - rules = [ - { - host = "your-domain.com" - http.paths = [ - { - path = "/apple" - pathType = "Prefix" - backend.service: { - name = "app-service" - port.number = 5678 - } - } - ] - } - ] - tls = [ - { - hosts = ["your-domain.com"] - secretName = "example-ingress-tls" - } - ] - } - """ - rules?: [networking_v1.IngressRule] - tls?: [networking_v1.IngressTLS] diff --git a/base/pkg/kusion_models/kube/frontend/job.k b/base/pkg/kusion_models/kube/frontend/job.k deleted file mode 100644 index 63b1b2f3..00000000 --- a/base/pkg/kusion_models/kube/frontend/job.k +++ /dev/null @@ -1,115 +0,0 @@ -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_models.kube.frontend.configmap -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.frontend.serviceaccount as sa -import base.pkg.kusion_models.kube.frontend.sidecar as s -import base.pkg.kusion_models.kube.frontend.strategy -import base.pkg.kusion_models.kube.frontend.volume - -schema Job: - """ - Job is the common user interface for one-time jobs, which is defined by Kubernetes Job. - Job supports reliable parallel execution of Pods. - - Attributes - ---------- - activeDeadlineSeconds: int, default is Undefined, 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 - backoffLimit: int, default is 6, optional. - Specifies the number of retries before marking this job failed. Defaults to 6 - completionMode: str, default is Undefined, optional - CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. - completions: int, default is Undefined, optional. - Specifies the desired number of successfully finished pods the job should be run with. - More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - manualSelector: bool, default is Undefined, optional. - manualSelector controls generation of pod labels and pod selectors. - More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector - parallelism: int, default is Undefined, optional. - Specifies the maximum desired number of pods the job should run at any given time. - More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - suspend: bool, default is Undefined, optional - Suspend specifies whether the Job controller should create Pods or not. - ttlSecondsAfterFinished: int, default is Undefined, optional. - ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). - selector: apis.LabelSelector, default is Undefined, optional. - A label query over pods that should match the pod count. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - podMetadata: apis.ObjectMeta, default is Undefined, optional. - PodMetadata is metadata that all persisted resources must have, which includes all objects users must create. - labels: {str:str}, default is Undefined, optional. - Labels is a map of string keys and values that can be used to organize and categorize (scope and select) objects. - More info: http://kubernetes.io/docs/user-guide/labels - annotations: {str:str}, default is Undefined, optional. - Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. - More info: http://kubernetes.io/docs/user-guide/annotations - restartPolicy: str, default is Never, optional. - Restart policy for all containers within the pod. One of Always, OnFailure, Never. - Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy - mainContainer: container.Main, default is Undefined, required. - MainContainer describes the main container configuration that is expected to be run on the host. - image: str, default is Undefined, optional. - Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images - schedulingStrategy: strategy.SchedulingStrategy, default is Undefined, required. - SchedulingStrategy represents scheduling strategy. - sidecarContainers: [s.Sidecar], default is Undefined, optional. - SidecarContainers describes the list of sidecar container configuration that is expected to be run on the host. - initContainers: [s.Sidecar], default is Undefined, optional. - InitContainers describes the list of sidecar container configuration that is expected to be run on the host. - needNamespace: bool,default is True, optional. - NeedNamespace mark server is namespace scoped or not. - volumes: [volume.Volume], default is Undefined, optional. - Volumes represents a named volume and corresponding mounts in containers. - configMaps: [configmap.ConfigMap], default is Undefined, optional. - ConfigMaps is a list of ConfigMap which holds configuration data for server to consume. - serviceAccount: sa.ServiceAccount, default is Undefined, optional. - ServiceAccount is used to run this pod. - - Examples - -------- - import base.pkg.kusion_models.kube.frontend - - jobConfiguration: frontend.Job { - # main container - mainContainer = container.Main { - name = "pi" - command = ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] - } - image = "perl" - } - """ - __settings__: {str:str} = {"output_type" = "IGNORE"} - - # subset of batchv1.JobSpec - activeDeadlineSeconds?: int - backoffLimit?: int = 6 - completionMode?: "NonIndexed" | "Indexed" = "NonIndexed" - completions?: int - manualSelector?: bool - parallelism?: int - suspend?: bool - ttlSecondsAfterFinished?: int - selector?: {str:str} - - # subset of corev1.PodTemplateSpec - podMetadata?: apis.ObjectMeta - labels?: {str:str} - annotations?: {str:str} - restartPolicy?: "Never" | "OnFailure" = "Never" - - # main container configuration - mainContainer: container.Main - image: str = option("image") - schedulingStrategy?: strategy.SchedulingStrategy = strategy.SchedulingStrategy {} - - # sidecar container configurations - sidecarContainers?: [s.Sidecar] - # init container configurations - initContainers?: [s.Sidecar] - - # other - needNamespace?: bool = True - volumes?: [volume.Volume] - configMaps?: [configmap.ConfigMap] - serviceAccount?: sa.ServiceAccount diff --git a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k b/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k deleted file mode 100644 index a336938b..00000000 --- a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k +++ /dev/null @@ -1,28 +0,0 @@ -import base.pkg.kusion_kubernetes.api.rbac.v1 as rbacv1 -import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_models.kube.mixins - -schema ClusterRole(common.Metadata): - """ - rules : [PolicyRule], default is Undefined, optional - Rules holds all the PolicyRules for this ClusterRole - aggregationRule : AggregationRule, default is Undefined, optional - AggregationRule is an optional field that 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 stomped by the controller. - """ - mixin [ - mixins.MetadataMixin - ] - - namespace = Undefined - - rules?: [rbacv1.PolicyRule] - - aggregationRule?: rbacv1.AggregationRule - - kubernetes: rbacv1.ClusterRole = rbacv1.ClusterRole { - metadata = metadata - rules = rules - aggregationRule = aggregationRule - } - - assert not namespace, "namespace is not allowed in ClusterRole" diff --git a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k b/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k deleted file mode 100644 index 1de02b3f..00000000 --- a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k +++ /dev/null @@ -1,28 +0,0 @@ -import base.pkg.kusion_kubernetes.api.rbac.v1 as rbacv1 -import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_models.kube.mixins - -schema ClusterRoleBinding(common.Metadata): - """ - subjects : [Subject], default is Undefined, optional - Subjects holds references to the objects the role applies to. - roleRef : ClusterRole, default is Undefined, required - RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. - """ - mixin [ - mixins.MetadataMixin - ] - - namespace = Undefined - - subjects?: [rbacv1.Subject] - - roleRef: rbacv1.RoleRef - - kubernetes: rbacv1.ClusterRoleBinding = rbacv1.ClusterRoleBinding { - metadata = metadata - subjects = subjects - roleRef = roleRef - } - - assert not namespace, "namespace is not allowed in ClusterRoleBinding" \ No newline at end of file diff --git a/base/pkg/kusion_models/kube/frontend/rbac/role.k b/base/pkg/kusion_models/kube/frontend/rbac/role.k deleted file mode 100644 index b3588411..00000000 --- a/base/pkg/kusion_models/kube/frontend/rbac/role.k +++ /dev/null @@ -1,19 +0,0 @@ -import base.pkg.kusion_kubernetes.api.rbac.v1 as rbacv1 -import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_models.kube.mixins - -schema Role(common.Metadata): - """ - rules : [PolicyRule], default is Undefined, optional - Rules holds all the PolicyRules for this ClusterRole - """ - mixin [ - mixins.MetadataMixin - ] - - rules?: [rbacv1.PolicyRule] - - kubernetes: rbacv1.Role = rbacv1.Role { - metadata = metadata - rules = rules - } diff --git a/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k b/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k deleted file mode 100644 index a3655a9d..00000000 --- a/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k +++ /dev/null @@ -1,24 +0,0 @@ -import base.pkg.kusion_kubernetes.api.rbac.v1 as rbacv1 -import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_models.kube.mixins - -schema RoleBinding(common.Metadata): - """ - subjects : [Subject], default is Undefined, optional - Subjects holds references to the objects the role applies to. - roleRef : RoleRef, default is Undefined, required - RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. - """ - mixin [ - mixins.MetadataMixin - ] - - subjects?: [rbacv1.Subject] - - roleRef: rbacv1.RoleRef - - kubernetes: rbacv1.RoleBinding = rbacv1.RoleBinding { - metadata = metadata - subjects = subjects - roleRef = roleRef - } diff --git a/base/pkg/kusion_models/kube/frontend/resource/resource.k b/base/pkg/kusion_models/kube/frontend/resource/resource.k deleted file mode 100644 index 7d2ca2b2..00000000 --- a/base/pkg/kusion_models/kube/frontend/resource/resource.k +++ /dev/null @@ -1,33 +0,0 @@ -import units - -type Unit = units.NumberMultiplier - -schema Resource: - """ Resource describes the compute resource requirements. - - Attributes - ---------- - cpu: int | Unit, default is 1, required. - A Container-level attribute. - CPU, in cores, default 1 core. (500m = .5 cores) - memory: Unit, default is 1024Mi, required. - A Container-level attribute. - Memory, in bytes, default 1024Mi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) - disk: Unit, default is 10Gi, required. - A Container-level attribute. - Local disk storage, in bytes, default 10Gi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) - - Examples - -------- - import base.pkg.kusion_models.kube.frontend.resource as res - - res = res.Resource { - cpu = 2 - memory = 2048Mi - disk = 20Gi - } - """ - - cpu?: int | Unit = 1 - memory?: Unit = 1024Mi - disk?: Unit = 10Gi diff --git a/base/pkg/kusion_models/kube/frontend/resource/resource_requirements.k b/base/pkg/kusion_models/kube/frontend/resource/resource_requirements.k deleted file mode 100644 index d1fbcbf5..00000000 --- a/base/pkg/kusion_models/kube/frontend/resource/resource_requirements.k +++ /dev/null @@ -1,35 +0,0 @@ -schema ResourceRequirements: - """ ResourceRequirements describes the compute resource requirements.. - - Attributes - ---------- - limits: Resource, default is Undefined, required. - A Container-level attribute. - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - requests: Resource, default is Undefined, required. - A Container-level attribute. - 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/ - - Examples - -------- - import base.pkg.kusion_models.kube.frontend.resource as res - - res = res.ResourceRequirements { - limits = { - cpu = 1 - memory = 1Gi - disk = 20Gi - } - requests = { - cpu = 500m - memory = 512Mi - disk = 10Gi - } - } - """ - - limits: Resource - requests: Resource diff --git a/base/pkg/kusion_models/kube/frontend/secret/secret.k b/base/pkg/kusion_models/kube/frontend/secret/secret.k deleted file mode 100644 index babf0812..00000000 --- a/base/pkg/kusion_models/kube/frontend/secret/secret.k +++ /dev/null @@ -1,34 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.common - -schema Secret(common.Metadata): - """Secret holds secret data of a certain type. - The total bytes of the values in the Data field - must be less than MaxSecretSize bytes. - - Attributes - ---------- - data: {str:str}, default is Undefined, optional - Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. - More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data - stringData: {str:str}, default is Undefined, optional - stringData allows specifying non-binary secret data in string form. - More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data - type: str, default is Undefined, optional - Used to facilitate programmatic handling of secret data. - More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types - - Examples - -------- - secret = Secret { - name = "my-secret" - namespace = "my-secret-namespace" - data = { - foo = bar - bar = foo - } - $type = "kubernetes.io/service-account-token" - } - """ - data?: {str:str} - stringData?: {str:str} - type?: str diff --git a/base/pkg/kusion_models/kube/frontend/server.k b/base/pkg/kusion_models/kube/frontend/server.k deleted file mode 100644 index 306e7ccd..00000000 --- a/base/pkg/kusion_models/kube/frontend/server.k +++ /dev/null @@ -1,126 +0,0 @@ -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_models.kube.frontend.configmap -import base.pkg.kusion_models.kube.frontend.secret -import base.pkg.kusion_models.kube.frontend.service -import base.pkg.kusion_models.kube.frontend.serviceaccount as sa -import base.pkg.kusion_models.kube.frontend.ingress -import base.pkg.kusion_models.kube.frontend.container -import base.pkg.kusion_models.kube.frontend.volume -import base.pkg.kusion_models.kube.frontend.sidecar as s -import base.pkg.kusion_models.kube.frontend.strategy - -schema Server: - """Server is abstaction of Deployment and StatefulSet. - - Attributes - ---------- - workloadType: str, default is "Deployment", required. - Application workload type, default to 'Deployment' - replicas: int, default is 1, required. - Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. - image: str, default is Undefined, optional. - Docker image name. - More info: https://kubernetes.io/docs/concepts/containers/images - schedulingStrategy: strategy.SchedulingStrategy, default is Undefined, required. - SchedulingStrategy represents scheduling strategy. - mainContainer: container.Main, default is Undefined, required. - MainContainer describes the main container configuration that is expected to be run on the host. - sidecarContainers: [s.Sidecar], default is Undefined, optional. - SidecarContainers describes the list of sidecar container configuration that is expected to be run on the host. - initContainers: [s.Sidecar], default is Undefined, optional. - InitContainers describes the list of sidecar container configuration that is expected to be run on the host. - useBuiltInLabels: bool, default is False, optional. - UseBuiltInLabels indicates use built-in labels or not. - labels: {str:str}, default is Undefined, optional. - Labels is a map of string keys and values that can be used to organize and categorize (scope and select) objects. - More info: http://kubernetes.io/docs/user-guide/labels - annotations: {str:str}, default is Undefined, optional. - Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. - More info: http://kubernetes.io/docs/user-guide/annotations - useBuiltInSelector: bool, default is False, optional. - UseBuiltInSelector indicates use built-in selector or not. - selector: {str:str}, default is Undefined, optional. - Label selector for pods. Existing ReplicaSets/ whose pods are selected by this will be the ones affected by this deployment. - podMetadata: apis.ObjectMeta, default is Undefined, optional. - PodMetadata is metadata that all persisted resources must have, which includes all objects users must create. - volumes: [volume.Volume], default is Undefined, optional. - Volumes represents a named volume and corresponding mounts in containers. - needNamespace: bool,default is True, optional. - NeedNamespace mark server is namespace scoped or not. - enableMonitoring: bool,default is False, optional. - EnableMonitoring mark server is enable monitor or not. - configMaps: [configmap.ConfigMap], default is Undefined, optional. - ConfigMaps is a list of ConfigMap which holds configuration data for server to consume. - secrets: [secret.Secret], default is Undefined, optional. - Secrets is a list of Secret which hold secret data of a certain type. - services: [service.Service], default is Undefined, optional. - Services is a list of Service which partition a single Kubernetes cluster into multiple virtual clusters. - ingresses: [ingress.Ingress], default is Undefined, optional. - Ingresses is a list of Ingress which is collection of rules that allow inbound connections to reach the endpoints defined by a backend. - serviceAccount: sa.ServiceAccount, default is Undefined, optional. - ServiceAccount is used to run this pod. - - Examples - -------- - import base.pkg.kusion_models.kube.frontend - import base.pkg.kusion_models.kube.frontend.container - import base.pkg.kusion_models.kube.templates.resource as res_tpl - - appConfiguration: frontend.Server { - mainContainer = container.Main { - name = "php-redis" - env = [ - { - name = "GET_HOSTS_FROM" - value = "dns" - } - ] - ports = [{containerPort = 80}] - } - selector = { - tier = "frontend" - } - podMetadata.labels: { - tier = "frontend" - } - schedulingStrategy.resource = res_tpl.tiny - } - """ - __settings__: {str:str} = {"output_type" = "IGNORE"} - - # Application workload type, default to 'Deployment' - workloadType: "Deployment" | "StatefulSet" = "Deployment" - - # Application replicas - replicas: int = option("replicas") or 1 - - # Main container image - image: str = option("image") - # Main container resource - schedulingStrategy: strategy.SchedulingStrategy = strategy.SchedulingStrategy {} - - # Main container configuration - mainContainer: container.Main - # Sidecar container configurations - sidecarContainers?: [s.Sidecar] - # Init container configurations - initContainers?: [s.Sidecar] - - # Workload configuration - useBuiltInLabels?: bool = True - labels?: {str:str} - annotations?: {str:str} - useBuiltInSelector?: bool = True - selector?: {str:str} - podMetadata?: apis.ObjectMeta - volumes?: [volume.Volume] - - # Other configurations - needNamespace?: bool = True - enableMonitoring?: bool = False - - configMaps?: [configmap.ConfigMap] - secrets?: [secret.Secret] - services?: [service.Service] - ingresses?: [ingress.Ingress] - serviceAccount?: sa.ServiceAccount diff --git a/base/pkg/kusion_models/kube/frontend/service/service.k b/base/pkg/kusion_models/kube/frontend/service/service.k deleted file mode 100644 index fb30f999..00000000 --- a/base/pkg/kusion_models/kube/frontend/service/service.k +++ /dev/null @@ -1,84 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_kubernetes.api.core.v1 as corev1 - -schema Service(common.Metadata): - """Service are Kubernetes objects which partition a single Kubernetes cluster into multiple virtual clusters. - More info: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#Service - - Attributes - ---------- - ports: [{str:}], default is Undefined, optional. - 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 - selector: {str:str}, default is Undefined, optional. - Route service traffic to pods with label keys and values matching this selector. - More info: https://kubernetes.io/docs/concepts/services-networking/service/ - type: str, default is "ClusterIP", optional. - determines how the Service is exposed. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - clusterIP: str, default is None, optional. - clusterIP is the IP address of the service and is usually assigned randomly by the master. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - externalIPs: [str], default is Undefined, optional - externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. - externalName: str, default is Undefined, optional - externalName is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record). - externalTrafficPolicy: str, default is Undefined, optional - externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. - healthCheckNodePort: int, default is Undefined, optional - healthCheckNodePort specifies the healthcheck nodePort for the service. - internalTrafficPolicy: str, default is Undefined, optional - InternalTrafficPolicy specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. - ipFamilies: [str], default is Undefined, optional - ipFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service, and is gated by the "IPv6DualStack" feature gate. - ipFamilyPolicy: str, default is Undefined, optional - ipFamilyPolicy represents the dual-stack-ness requested or required by this Service, and is gated by the "IPv6DualStack" feature gate. - loadBalancerIP: str, default is Undefined, optional - Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. - loadBalancerSourceRanges: [str], default is Undefined, 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. - More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/ - ports: [ServicePort], default is Undefined, optional - 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 - publishNotReadyAddresses: bool, default is Undefined, optional - publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. - sessionAffinity : str, default is Undefined, optional - Supports "ClientIP" and "None". Used to maintain session affinity. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - sessionAffinityConfig : SessionAffinityConfig, default is Undefined, optional - sessionAffinityConfig contains the configurations of session affinity. - - Examples - -------- - service = Service { - name = "my-service-name" - namespace = "my-service-name" - labels.env = "dev" - ports = [ - { - name = "grpc-xds" - port = 15010 - } - { - name = "https-xds" - port = 15011 - } - ] - } - """ - selector?: {str:str} - ports?: [corev1.ServicePort] - clusterIP?: str - type?: str - externalIPs?: [str] - externalName?: str - externalTrafficPolicy?: str - healthCheckNodePort?: int - ipFamilyPolicy?: str - loadBalancerIP?: str - loadBalancerSourceRanges?: [str] - publishNotReadyAddresses?: bool - sessionAffinity?: str - sessionAffinityConfig?: {str:} diff --git a/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k b/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k deleted file mode 100644 index 5856108b..00000000 --- a/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k +++ /dev/null @@ -1,45 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.common - -schema ServiceAccount(common.Metadata): - """A service account provides an identity for processes that run in a Pod. - ServiceAccount binds together: - - a name, understood by users, and perhaps by peripheral systems, for an identity - - a principal that can be authenticated and authorized - - a set of secrets - More info: https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/service-account-v1/#ServiceAccount - - Attributes - ---------- - imagePullSecrets: [{str:str}], default is Undefined, optional. - ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. - More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod - secrets: [{str:str}], default is Undefined, optional. - Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. - More info: https://kubernetes.io/docs/concepts/configuration/secret - - Examples - -------- - my_service_account = ServiceAccount { - name: "my-service-account" - namespace = "my-service-account-namespace" - labels: { - tier: "monitoring" - } - imagePullSecrets: [ - { - name: "my-secret" - } - ] - secrets: [ - { - name: "my-secret" - } - ] - } - """ - - imagePullSecrets?: [{str:str}] - secrets?: [{str:str}] - - check: - name, "name must be specified and can't be empty or None or Undefined" diff --git a/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k b/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k deleted file mode 100644 index fc9eb911..00000000 --- a/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k +++ /dev/null @@ -1,87 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.container.probe as p -import base.pkg.kusion_models.kube.frontend.container.env as e -import base.pkg.kusion_models.kube.frontend.container.port as cp -import base.pkg.kusion_models.kube.frontend.container.lifecycle as lc -import base.pkg.kusion_models.kube.frontend.resource as res - -schema Sidecar: - """ Sidecar describes the sidecar container configuration that is expected to be run on the host. - - Attributes - ---------- - name: str, default is Undefined, required. - A Container-level attribute. - The container name. Each container in a pod must have a unique name. - command: [str], default is Undefined, optional. - A Container-level attribute. - The startup command of main process. The image's entrypoint is used if this is not provided. - args: [str], default is Undefined, optional. - A Container-level attribute. - The startup arguments of main process. The image's cmd is used if this is not provided. - env: [e.Env], default is Undefined, optional. - A Container-level attribute. - List of environment variables in the container. - envFrom: [EnvFromSource], default is Undefined, optional - A Container-level attribute. - List of sources to populate environment variables in the container. - image: str, default is Undefined, optional - A Container-level attribute. - Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images - livenessProbe: p.Probe, default is Undefined, optional. - A Container-level attribute. - The probe to check whether container is live or not. - readinessProbe: p.Probe, default is Undefined, optional. - A Container-level attribute. - The probe to check whether container is ready or not. - startupProbe: p.Probe, default is Undefined, optional. - A Container-level attribute. - The probe to indicates that the Pod has successfully initialized. - resource: str, default is "1 0: - ClusterRoleBinding += [r.kubernetes for r in rbac.ClusterRoleBinding.instances()] - if len(rbac.ClusterRole.instances()) > 0: - ClusterRole += [r.kubernetes for r in rbac.ClusterRole.instances()] - if len(rbac.RoleBinding.instances()) > 0: - RoleBinding += [r.kubernetes for r in rbac.RoleBinding.instances()] - if len(rbac.Role.instances()) > 0: - Role += [r.kubernetes for r in rbac.Role.instances()] -} - -# prometheus -__prometheus_map__: {str:[]} = { - PrometheusRule += monitoringv1.PrometheusRule.instances() - AlertmanagerConfig += monitoringv1alpha1.AlertmanagerConfig.instances() - Probe += monitoringv1.Probe.instances() - Prometheus += monitoringv1.Prometheus.instances() - Alertmanager += monitoringv1.Alertmanager.instances() -} - -# k8s -__k8s__: {str:[]} = { - Service += corev1.Service.instances() - ServiceAccount += corev1.ServiceAccount.instances() -} - -# merge resource map -__array_of_resource_map___: [{str:[]}] = [ - _inst?.kubernetes | __output_standalone__ \ - for _inst in __renderBackendInstances__ if _inst?.kubernetes -] | [__rbac_map__] | [__prometheus_map__] | [__k8s__] - -# remove duplicates -__resource_map___: {str: []} = { - _kind: [r for key, r in _res] \ - for _index, _resource_map in __array_of_resource_map___ \ - for _kind, _res in _resource_map if _kind not in ["__settings__"] -} - -# structure output -if option("__konfig_output_format__")?.lower() == "raw": - konfig_kubeKubernetes = { - _kind: [_resource | __output_standalone__ for _resource in _res] \ - for _kind, _res in __resource_map___ - } | __output_ignore__ -else: - # kubernetes id: apiVersion:Kind:Namespace:Name - getId = lambda _resource { - _resource.apiVersion + ":" + _resource.kind + ":" + (_resource.metadata.namespace + ":" if _resource.metadata.namespace else "") + _resource.metadata.name - } - x = { - _kind: [ - { - "id" = getId(_resource) - "type" = "Kubernetes" - "dependsOn" = [ - getId(dependOn) \ - for i, v in resource.kubernetesOrders if v == _kind \ - for k in resource.kubernetesOrders[:i] if k in __resource_map___ \ - for dependOn in __resource_map___[k] - ] - "attributes" = _resource | __output_inline__ - } | __output_standalone__ for _resource in _res - ] for _kind, _res in __resource_map___ - } | __output_ignore__ diff --git a/base/pkg/kusion_models/kube/resource/resource.k b/base/pkg/kusion_models/kube/resource/resource.k deleted file mode 100644 index 899c902d..00000000 --- a/base/pkg/kusion_models/kube/resource/resource.k +++ /dev/null @@ -1,3 +0,0 @@ -schema ResourceMapping: - [str]: any - diff --git a/base/pkg/kusion_models/kube/resource/resourceorder.k b/base/pkg/kusion_models/kube/resource/resourceorder.k deleted file mode 100644 index 957945da..00000000 --- a/base/pkg/kusion_models/kube/resource/resourceorder.k +++ /dev/null @@ -1,39 +0,0 @@ -kubernetesOrders: [str] = [ - "ClusterRole", - "ClusterRoleList", - "ClusterRoleBinding", - "ClusterRoleBindingList", - "CustomResourceDefinition", - "Namespace", - "NetworkPolicy", - "ResourceQuota", - "LimitRange", - "PodSecurityPolicy", - "PodDisruptionBudget", - "ServiceAccount", - "Secret", - "SecretList", - "ConfigMap", - "CustomResource", - "StorageClass", - "PersistentVolume", - "PersistentVolumeClaim", - "Role", - "RoleList", - "RoleBinding", - "RoleBindingList", - "Service", - "DaemonSet", - "Pod", - "ReplicationController", - "ReplicaSet", - "Deployment", - "HorizontalPodAutoscaler", - "StatefulSet", - "Job", - "CronJob", - "Ingress", - "APIService", - "ValidatingWebhookConfiguration" -] - diff --git a/base/pkg/kusion_models/kube/templates/resource.k b/base/pkg/kusion_models/kube/templates/resource.k deleted file mode 100644 index dd194949..00000000 --- a/base/pkg/kusion_models/kube/templates/resource.k +++ /dev/null @@ -1,49 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.resource as res - -tiny = res.Resource { - cpu = 100m - memory = 100Mi - disk = 1Gi -} - -small = res.Resource { - cpu = 1 - memory = 2Gi - disk = 20Gi -} - -medium = res.Resource { - cpu = 2 - memory = 4Gi - disk = 35Gi -} - -medium100G = res.Resource { - cpu = 2 - memory = 4Gi - disk = 100Gi -} - -large = res.Resource { - cpu = 4 - memory = 8Gi - disk = 70Gi -} - -large100G = res.Resource { - cpu = 4 - memory = 8Gi - disk = 100Gi -} - -large2X32G40G = res.Resource { - cpu = 8 - memory = 32Gi - disk = 40Gi -} - -large4X = res.Resource { - cpu = 16 - memory = 32Gi - disk = 20Gi -} diff --git a/base/pkg/kusion_models/kube/utils/application_builder.k b/base/pkg/kusion_models/kube/utils/application_builder.k deleted file mode 100644 index 33fab307..00000000 --- a/base/pkg/kusion_models/kube/utils/application_builder.k +++ /dev/null @@ -1,34 +0,0 @@ -import base.pkg.kusion_models.kube.metadata - -schema ApplicationBuilder: - """ApplicationBuilder contains the workload labels, selector and environments about the application - - Reference from: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ - """ - labels: {str:str} = { - "app.kubernetes.io/name": metadata.__META_APP_NAME - "app.kubernetes.io/env": metadata.__META_ENV_TYPE_NAME - "app.kubernetes.io/instance": "{}-{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME).lower() - "cluster.x-k8s.io/cluster-name": metadata.__META_CLUSTER_NAME - } - - selector: {str:str} = labels - - envs: [{str:}] = [ - { - name: "APP_NAME" - value: metadata.__META_APP_NAME - } - { - name: "ENVIRONMENT" - value: metadata.__META_ENV_TYPE_NAME - } - { - name: "INSTANCE" - value: "{}-{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME).lower() - } - { - name: "CLUSTER" - value: metadata.__META_CLUSTER_NAME - } - ] diff --git a/base/pkg/kusion_models/kube/utils/container_frontend2kube.k b/base/pkg/kusion_models/kube/utils/container_frontend2kube.k deleted file mode 100644 index 65580458..00000000 --- a/base/pkg/kusion_models/kube/utils/container_frontend2kube.k +++ /dev/null @@ -1,147 +0,0 @@ -import base.pkg.kusion_kubernetes.api.core.v1 as kubev1 - -ContainerFrontend2Kube = lambda c -> {str:} { - # Kube variable - _kubeResource = Undefined - _kubeEnvList = Undefined - _kubeEnvFromList = Undefined - _kubePortList = Undefined - _kubeReadinessProbe = Undefined - _kubeLivenessProbe = Undefined - _kubeStartupProbe = Undefined - _kubeLifecycle = Undefined - - # Convert frontend resource to kube resource - if c?.resource: - _kubeResource = Str2ResourceRequirements(c.resource).result - - # Convert frontend env to kube env - if c?.env: - _kubeEnvList = [ - { - name: e.name - value: e.value - valueFrom: { - fieldRef: e.valueFrom.fieldRef - configMapKeyRef: { - name: e.valueFrom.configMapKeyRef.name - key: e.valueFrom.configMapKeyRef.key - } if e.valueFrom.configMapKeyRef else Undefined - secretKeyRef: { - name: e.valueFrom.secretKeyRef.name - key: e.valueFrom.secretKeyRef.key - } if e.valueFrom.secretKeyRef else Undefined - resourceFieldRef: { - containerName: e.valueFrom.resourceFieldRef.containerName - resource: e.valueFrom.resourceFieldRef.resource - if e.valueFrom.resourceFieldRef.divisor: - divisor: str(e.valueFrom.resourceFieldRef.divisor) - } if e.valueFrom.resourceFieldRef else Undefined - } if e.valueFrom else Undefined - } for e in c.env - ] - - # Convert frontend envFrom to kube envFrom - if c?.envFrom: - _kubeEnvFromList = [ - { - configMapRef: { - name: ef.configMapRef - } if ef.configMapRef else Undefined - secretRef: { - name: ef.secretRef - } if ef.secretRef else Undefined - } for ef in c.envFrom - ] - - # Convert kube ports to kube ports - if c?.ports: - _kubePortList = [ - { - name: port.name - containerPort: port.containerPort - protocol: port.protocol - } for port in c.ports - ] - - # Convert frontend probe to kube probe - if c?.readinessProbe or c?.livenessProbe or c?.startupProbe: - _iacProbes = [ - c?.readinessProbe - c?.livenessProbe - c?.startupProbe - ] - _kubeProbes = [kubev1.Probe { - exec: kubev1.ExecAction { - command: _iacProbe.handler.command - } if typeof(_iacProbe.handler) == "Exec" else Undefined - httpGet: kubev1.HTTPGetAction { - path: _iacProbe.handler.path - port: _iacProbe.handler.port - scheme: _iacProbe.handler.scheme - } if typeof(_iacProbe.handler) == "Http" else Undefined - tcpSocket: kubev1.TCPSocketAction { - port: _iacProbe.handler.tcpSocket - } if typeof(_iacProbe.handler) == "Tcp" else Undefined - failureThreshold: _iacProbe.failureThreshold - initialDelaySeconds: _iacProbe.initialDelaySeconds - periodSeconds: _iacProbe.periodSeconds - successThreshold: _iacProbe.successThreshold - timeoutSeconds: _iacProbe.timeoutSeconds - } if _iacProbe else Undefined for _iacProbe in _iacProbes] - _kubeReadinessProbe = _kubeProbes[0] - _kubeLivenessProbe = _kubeProbes[1] - _kubeStartupProbe = _kubeProbes[2] - - # Convert frontend lifecycle to kube lifecycle - if c?.lifecycle: - _kubeLifecycle = { - preStop: { - exec: kubev1.ExecAction { - command: c.lifecycle.preStop.command - } if typeof(c.lifecycle.preStop) == "Exec" else Undefined - httpGet: kubev1.HTTPGetAction { - path: c.lifecycle.preStop.path - port: c.lifecycle.preStop.port - scheme: c.lifecycle.preStop.scheme - } if typeof(c.lifecycle.preStop) == "Http" else Undefined - tcpSocket: kubev1.TCPSocketAction { - port: c.lifecycle.preStop.tcpSocket - } if typeof(c.lifecycle.preStop) == "Tcp" else Undefined - } if c.lifecycle.preStop else Undefined - postStart: { - exec: kubev1.ExecAction { - command: c.lifecycle.postStart.command - } if typeof(c.lifecycle.preStop) == "Exec" else Undefined - httpGet: kubev1.HTTPGetAction { - path: c.lifecycle.postStart.path - port: c.lifecycle.postStart.port - scheme: c.lifecycle.postStart.scheme - } if typeof(c.lifecycle.preStop) == "Http" else Undefined - tcpSocket: kubev1.TCPSocketAction { - port: c.lifecycle.postStart.tcpSocket - } if typeof(c.lifecycle.preStop) == "Tcp" else Undefined - } if c.lifecycle.postStart else Undefined - } - - # Construct result - { - name: c?.name - image: c?.image - imagePullPolicy: c?.imagePullPolicy if "imagePullPolicy" in c else Undefined - resources: _kubeResource - env: _kubeEnvList - envFrom: _kubeEnvFromList - command: c?.command - args: c?.args - ports: _kubePortList - securityContext: c?.securityContext - readinessProbe: _kubeReadinessProbe - livenessProbe: _kubeLivenessProbe - startupProbe: _kubeStartupProbe - lifecycle: _kubeLifecycle - workingDir: c?.workingDir - terminationMessagePath: c?.terminationMessagePath if "terminationMessagePath" in c else Undefined - terminationMessagePolicy: c?.terminationMessagePolicy if "terminationMessagePolicy" in c else Undefined - } -} diff --git a/base/pkg/kusion_models/kube/utils/metadata_builder.k b/base/pkg/kusion_models/kube/utils/metadata_builder.k deleted file mode 100644 index 85db9af9..00000000 --- a/base/pkg/kusion_models/kube/utils/metadata_builder.k +++ /dev/null @@ -1,10 +0,0 @@ -import base.pkg.kusion_models.kube.metadata - -MetadataBuilder = lambda config -> {str:} { - { - name: metadata.__META_APP_NAME - namespace: metadata.__META_APP_NAME - labels: config?.labels - annotations: config?.annotations - } -} diff --git a/base/pkg/kusion_models/kube/utils/str2resource_requirements.k b/base/pkg/kusion_models/kube/utils/str2resource_requirements.k deleted file mode 100644 index 2f56c934..00000000 --- a/base/pkg/kusion_models/kube/utils/str2resource_requirements.k +++ /dev/null @@ -1,57 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.resource as res - -import regex - -schema Str2ResourceRequirements[resourcePara: str | res.Resource]: - resourceStr?: str = resourcePara as str if typeof(resourcePara) == "str" else None - resourceUnit?: res.Resource = resourcePara as res.Resource if typeof(resourcePara) == "Resource" else None - schedulingResourceItems: [str] = resourceStr?.split(",") or [] - - resource: [{str:}] = [{ - cpu = { - requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip() - limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip() - } - } if "cpu" in item else ({ - memory = { - requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip() - limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip() - } - } if "memory" in item else ({ - disk = { - requests = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[0])?.strip() - limits = (item.split("=")?[1] if len(item.split("=")) > 1 else item.split("<")?[-1])?.strip() - } - } if "disk" in item else Undefined)) for item in schedulingResourceItems] - - result: {str:} = { - requests = { - cpu = [r?.cpu?.requests for r in resource if r?.cpu?.requests]?[-1] or Undefined - memory = [r?.memory?.requests for r in resource if r?.memory?.requests]?[-1] or Undefined - "ephemeral-storage" = [r?.disk?.requests for r in resource if r?.disk?.requests]?[-1] or Undefined - } - limits = { - cpu = [r?.cpu?.limits for r in resource if r?.cpu?.limits]?[-1] or Undefined - memory = [r?.memory?.limits for r in resource if r?.memory?.limits]?[-1] or Undefined - "ephemeral-storage" = [r?.disk?.limits for r in resource if r?.disk?.limits]?[-1] or Undefined - } - } if resourceStr else { - requests = { - cpu = str(resourceUnit.cpu) - memory = str(resourceUnit.memory) - "ephemeral-storage" = str(resourceUnit.disk) if resourceUnit.disk else Undefined - } - limits = { - cpu = str(resourceUnit.cpu) - memory = str(resourceUnit.memory) - "ephemeral-storage" = str(resourceUnit.disk) if resourceUnit.disk else Undefined - } - } - - check: - regex.match(result?.requests?.cpu, r"^([+-]?[0-9.]+)([m]*[-+]?[0-9]*)$") if result?.requests?.cpu, "cpu must match specific regular expression" - regex.match(result?.requests?.memory, r"^([0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$") if result?.requests?.memory, "memory must match specific regular expression" - regex.match(result?.requests?["ephemeral-storage"], r"^([1-9][0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$") if result?.requests?["ephemeral-storage"], "disk must match specific regular expression" - regex.match(result?.limits?.cpu, r"^([+-]?[0-9.]+)([m]*[-+]?[0-9]*)$") if result?.limits?.cpu, "cpu must match specific regular expression" - regex.match(result?.limits?.memory, r"^([0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$") if result?.limits?.memory, "memory must match specific regular expression" - regex.match(result?.limits?["ephemeral-storage"], r"^([1-9][0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$") if result?.limits?["ephemeral-storage"], "disk must match specific regular expression" diff --git a/base/pkg/kusion_models/kube/utils/str2resource_requirements_test.k b/base/pkg/kusion_models/kube/utils/str2resource_requirements_test.k deleted file mode 100644 index d4de3c2c..00000000 --- a/base/pkg/kusion_models/kube/utils/str2resource_requirements_test.k +++ /dev/null @@ -1,20 +0,0 @@ -schema Str2ResourceRequirementsCase[case]: - value = case.value - expected = case.expected - result = Str2ResourceRequirements(value).result - assert result == expected, "test failed expected ${expected} got ${result}" - -schema TestStr2ResourceRequirements: - cases = [ - { - value = "cpu=100m,memory=100Mi,disk=1Gi" - expected = {'requests': {'cpu': '100m', 'memory': '100Mi', 'ephemeral-storage': '1Gi'}, 'limits': {'cpu': '100m', 'memory': '100Mi', 'ephemeral-storage': '1Gi'}} - } - { - value = "cpu=1,memory=2Gi,disk=20Gi" - expected = {'requests': {'cpu': '1', 'memory': '2Gi', 'ephemeral-storage': '20Gi'}, 'limits': {'cpu': '1', 'memory': '2Gi', 'ephemeral-storage': '20Gi'}} - } - ] - [ - Str2ResourceRequirementsCase(case) for case in cases - ] diff --git a/base/pkg/kusion_models/kube/utils/volume_patch.k b/base/pkg/kusion_models/kube/utils/volume_patch.k deleted file mode 100644 index 80718b2e..00000000 --- a/base/pkg/kusion_models/kube/utils/volume_patch.k +++ /dev/null @@ -1,17 +0,0 @@ -import base.pkg.kusion_models.kube.frontend.volume - -VolumePatch = lambda volumes: [volume.Volume], containers: [{str:}] -> [{str:}] { - """VolumePatch patches volumes into _containers and returns the patched _container""" - [ - _container | { - volumeMounts = sum([[ - { - name: volume.name - mountPath: mount.path - subPath: mount.subPath - readOnly: mount.readOnly or Undefined - } for mount in volume.mounts if mount.container == _container.name or mount.container == "*" - ] for volume in volumes] if volumes else [], []) - } for _container in containers - ] if containers else Undefined -} diff --git a/base/pkg/kusion_models/metadata/project.k b/base/pkg/kusion_models/metadata/project.k deleted file mode 100644 index c4c06e74..00000000 --- a/base/pkg/kusion_models/metadata/project.k +++ /dev/null @@ -1,6 +0,0 @@ -import kcl_plugin.project_context as ctx - -# Get project information from project.yaml by kcl plugin -_projectContext = ctx.get_project_context() - -__META_PROJECT_NAME = _projectContext['name'] diff --git a/base/pkg/kusion_models/metadata/stack.k b/base/pkg/kusion_models/metadata/stack.k deleted file mode 100644 index 959ae16f..00000000 --- a/base/pkg/kusion_models/metadata/stack.k +++ /dev/null @@ -1,6 +0,0 @@ -import kcl_plugin.project_context as ctx - -# Get stack information from stack.yaml by kcl plugin -_stackContext = ctx.get_stack_context() - -__META_STACK_NAME = _stackContext['name'] diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_advanced_cron_job.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_advanced_cron_job.k deleted file mode 100644 index 494793af..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_advanced_cron_job.k +++ /dev/null @@ -1,187 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema AdvancedCronJob: - """ AdvancedCronJob is the Schema for the advancedcronjobs API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "AdvancedCronJob", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1AdvancedCronJobSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1AdvancedCronJobStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "AdvancedCronJob" = "AdvancedCronJob" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1AdvancedCronJobSpec - - status?: AppsKruiseIoV1alpha1AdvancedCronJobStatus - -schema AppsKruiseIoV1alpha1AdvancedCronJobSpec: - """ AdvancedCronJobSpec defines the desired state of AdvancedCronJob - - Attributes - ---------- - concurrencyPolicy : str, default is Undefined, 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 - failedJobsHistoryLimit : int, default is Undefined, optional - The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. - paused : bool, default is Undefined, optional - Paused will pause the cron job. - schedule : str, default is Undefined, required - The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. - startingDeadlineSeconds : int, default is Undefined, optional - 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. - successfulJobsHistoryLimit : int, default is Undefined, optional - The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. - template : AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplate, default is Undefined, required - template - """ - - concurrencyPolicy?: "Allow" | "Forbid" | "Replace" - - failedJobsHistoryLimit?: int - - paused?: bool - - schedule: str - - startingDeadlineSeconds?: int - - successfulJobsHistoryLimit?: int - - template: AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplate - - check: - failedJobsHistoryLimit >= 0 - len(schedule) >= 0 - startingDeadlineSeconds >= 0 - successfulJobsHistoryLimit >= 0 - -schema AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplate: - """ Specifies the job that will be created when executing a CronJob. - - Attributes - ---------- - jobTemplate : any, default is Undefined, optional - Specifies the job that will be created when executing a CronJob. - broadcastJobTemplate : AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplate, default is Undefined, optional - broadcast job template - """ - - jobTemplate?: any - - broadcastJobTemplate?: AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplate - -schema AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplate: - """ Specifies the broadcastjob that will be created when executing a BroadcastCronJob. - - Attributes - ---------- - metadata : any, default is Undefined, optional - Standard object's metadata of the jobs created from this template. - spec : AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpec, default is Undefined, optional - spec - """ - - metadata?: any - - spec?: AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpec - -schema AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpec: - """ Specification of the desired behavior of the broadcastjob. - - Attributes - ---------- - parallelism : int, default is Undefined, optional - Parallelism 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 the work left to do is less than max parallelism. Not setting this value means no limit. - paused : bool, default is Undefined, optional - Paused will pause the job. - template : any, default is Undefined, required - Template describes the pod that will be created when executing a job. - completionPolicy : AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpecCompletionPolicy, default is Undefined, optional - completion policy - failurePolicy : AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpecFailurePolicy, default is Undefined, optional - failure policy - """ - - parallelism?: int - - paused?: bool - - template: any - - completionPolicy?: AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpecCompletionPolicy - - failurePolicy?: AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpecFailurePolicy - -schema AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpecCompletionPolicy: - """ CompletionPolicy indicates the completion policy of the job. Default is Always CompletionPolicyType - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, optional - ActiveDeadlineSeconds 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. Only works for Always type. - ttlSecondsAfterFinished : int, default is Undefined, 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. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature. Only works for Always type - $type : str, default is Undefined, optional - Type indicates the type of the CompletionPolicy Default is Always - """ - - activeDeadlineSeconds?: int - - ttlSecondsAfterFinished?: int - - $type?: str - -schema AppsKruiseIoV1alpha1AdvancedCronJobSpecTemplateBroadcastJobTemplateSpecFailurePolicy: - """ FailurePolicy indicates the behavior of the job, when failed pod is found. - - Attributes - ---------- - restartLimit : int, default is Undefined, optional - RestartLimit specifies the number of retries before marking the pod failed. - $type : str, default is Undefined, optional - Type indicates the type of FailurePolicyType. - """ - - restartLimit?: int - - $type?: str - -schema AppsKruiseIoV1alpha1AdvancedCronJobStatus: - """ AdvancedCronJobStatus defines the observed state of AdvancedCronJob - - Attributes - ---------- - active : [any], default is Undefined, optional - A list of pointers to currently running jobs. - lastScheduleTime : str, default is Undefined, optional - Information when was the last time the job was successfully scheduled. - $type : str, default is Undefined, optional - type - """ - - active?: [any] - - lastScheduleTime?: str - - $type?: str diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_broadcast_job.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_broadcast_job.k deleted file mode 100644 index e0135084..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_broadcast_job.k +++ /dev/null @@ -1,167 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema BroadcastJob: - """ BroadcastJob is the Schema for the broadcastjobs API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "BroadcastJob", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1BroadcastJobSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1BroadcastJobStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "BroadcastJob" = "BroadcastJob" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1BroadcastJobSpec - - status?: AppsKruiseIoV1alpha1BroadcastJobStatus - -schema AppsKruiseIoV1alpha1BroadcastJobSpec: - """ BroadcastJobSpec defines the desired state of BroadcastJob - - Attributes - ---------- - parallelism : int, default is Undefined, optional - Parallelism 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 the work left to do is less than max parallelism. Not setting this value means no limit. - paused : bool, default is Undefined, optional - Paused will pause the job. - template : any, default is Undefined, required - Template describes the pod that will be created when executing a job. - completionPolicy : AppsKruiseIoV1alpha1BroadcastJobSpecCompletionPolicy, default is Undefined, optional - completion policy - failurePolicy : AppsKruiseIoV1alpha1BroadcastJobSpecFailurePolicy, default is Undefined, optional - failure policy - """ - - parallelism?: int - - paused?: bool - - template: any - - completionPolicy?: AppsKruiseIoV1alpha1BroadcastJobSpecCompletionPolicy - - failurePolicy?: AppsKruiseIoV1alpha1BroadcastJobSpecFailurePolicy - -schema AppsKruiseIoV1alpha1BroadcastJobSpecCompletionPolicy: - """ CompletionPolicy indicates the completion policy of the job. Default is Always CompletionPolicyType - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, optional - ActiveDeadlineSeconds 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. Only works for Always type. - ttlSecondsAfterFinished : int, default is Undefined, 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. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature. Only works for Always type - $type : str, default is Undefined, optional - Type indicates the type of the CompletionPolicy Default is Always - """ - - activeDeadlineSeconds?: int - - ttlSecondsAfterFinished?: int - - $type?: str - -schema AppsKruiseIoV1alpha1BroadcastJobSpecFailurePolicy: - """ FailurePolicy indicates the behavior of the job, when failed pod is found. - - Attributes - ---------- - restartLimit : int, default is Undefined, optional - RestartLimit specifies the number of retries before marking the pod failed. - $type : str, default is Undefined, optional - Type indicates the type of FailurePolicyType. - """ - - restartLimit?: int - - $type?: str - -schema AppsKruiseIoV1alpha1BroadcastJobStatus: - """ BroadcastJobStatus defines the observed state of BroadcastJob - - Attributes - ---------- - active : int, default is Undefined, optional - The number of actively running pods. - completionTime : str, default is Undefined, optional - Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - conditions : [AppsKruiseIoV1alpha1BroadcastJobStatusConditionsItems0], default is Undefined, optional - The latest available observations of an object's current state. - desired : int, default is Undefined, optional - The desired number of pods, this is typically equal to the number of nodes satisfied to run pods. - failed : int, default is Undefined, optional - The number of pods which reached phase Failed. - phase : str, default is Undefined, optional - The phase of the job. - startTime : str, default is Undefined, optional - Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - succeeded : int, default is Undefined, optional - The number of pods which reached phase Succeeded. - """ - - active?: int - - completionTime?: str - - conditions?: [AppsKruiseIoV1alpha1BroadcastJobStatusConditionsItems0] - - desired?: int - - failed?: int - - phase?: str - - startTime?: str - - succeeded?: int - -schema AppsKruiseIoV1alpha1BroadcastJobStatusConditionsItems0: - """ JobCondition describes current state of a job. - - Attributes - ---------- - lastProbeTime : str, default is Undefined, optional - Last time the condition was checked. - lastTransitionTime : str, default is Undefined, optional - Last time the condition transit from one status to another. - message : str, default is Undefined, optional - Human readable message indicating details about last transition. - reason : str, default is Undefined, optional - (brief) reason for the condition's last transition. - status : str, default is Undefined, required - Status of the condition, one of True, False, Unknown. - $type : str, default is Undefined, required - Type of job condition, Complete or Failed. - """ - - lastProbeTime?: str - - lastTransitionTime?: str - - message?: str - - reason?: str - - status: str - - $type: str diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_clone_set.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_clone_set.k deleted file mode 100644 index bb108a9a..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_clone_set.k +++ /dev/null @@ -1,387 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema CloneSet: - """ CloneSet is the Schema for the clonesets API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "CloneSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1CloneSetSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1CloneSetStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "CloneSet" = "CloneSet" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1CloneSetSpec - - status?: AppsKruiseIoV1alpha1CloneSetStatus - -schema AppsKruiseIoV1alpha1CloneSetSpec: - """ CloneSetSpec defines the desired state of CloneSet - - Attributes - ---------- - minReadySeconds : int, default is Undefined, 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 : int, default is Undefined, optional - Replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template. If unspecified, defaults to 1. - revisionHistoryLimit : int, default is Undefined, optional - RevisionHistoryLimit is the maximum number of revisions that will be maintained in the CloneSet's revision history. The revision history consists of all revisions not represented by a currently applied CloneSetSpec version. The default value is 10. - template : any, default is Undefined, required - Template describes the pods that will be created. - volumeClaimTemplates : [any], default is Undefined, optional - VolumeClaimTemplates is a list of claims that pods are allowed to reference. Note that PVC will be deleted when its pod has been deleted. - lifecycle : AppsKruiseIoV1alpha1CloneSetSpecLifecycle, default is Undefined, optional - lifecycle - scaleStrategy : AppsKruiseIoV1alpha1CloneSetSpecScaleStrategy, default is Undefined, optional - scale strategy - selector : AppsKruiseIoV1alpha1CloneSetSpecSelector, default is Undefined, required - selector - updateStrategy : AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - minReadySeconds?: int - - replicas?: int - - revisionHistoryLimit?: int - - template: any - - volumeClaimTemplates?: [any] - - lifecycle?: AppsKruiseIoV1alpha1CloneSetSpecLifecycle - - scaleStrategy?: AppsKruiseIoV1alpha1CloneSetSpecScaleStrategy - - selector: AppsKruiseIoV1alpha1CloneSetSpecSelector - - updateStrategy?: AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategy - -schema AppsKruiseIoV1alpha1CloneSetSpecLifecycle: - """ Lifecycle defines the lifecycle hooks for Pods pre-delete, in-place update. - - Attributes - ---------- - inPlaceUpdate : AppsKruiseIoV1alpha1CloneSetSpecLifecycleInPlaceUpdate, default is Undefined, optional - in place update - preDelete : AppsKruiseIoV1alpha1CloneSetSpecLifecyclePreDelete, default is Undefined, optional - pre delete - """ - - inPlaceUpdate?: AppsKruiseIoV1alpha1CloneSetSpecLifecycleInPlaceUpdate - - preDelete?: AppsKruiseIoV1alpha1CloneSetSpecLifecyclePreDelete - -schema AppsKruiseIoV1alpha1CloneSetSpecLifecycleInPlaceUpdate: - """ InPlaceUpdate is the hook before Pod to update and after Pod has been updated. - - Attributes - ---------- - finalizersHandler : [str], default is Undefined, optional - finalizers handler - labelsHandler : {str:str}, default is Undefined, optional - labels handler - """ - - finalizersHandler?: [str] - - labelsHandler?: {str:str} - -schema AppsKruiseIoV1alpha1CloneSetSpecLifecyclePreDelete: - """ PreDelete is the hook before Pod to be deleted. - - Attributes - ---------- - finalizersHandler : [str], default is Undefined, optional - finalizers handler - labelsHandler : {str:str}, default is Undefined, optional - labels handler - """ - - finalizersHandler?: [str] - - labelsHandler?: {str:str} - -schema AppsKruiseIoV1alpha1CloneSetSpecScaleStrategy: - """ ScaleStrategy indicates the ScaleStrategy that will be employed to create and delete Pods in the CloneSet. - - Attributes - ---------- - podsToDelete : [str], default is Undefined, optional - PodsToDelete is the names of Pod should be deleted. Note that this list will be truncated for non-existing pod names. - """ - - podsToDelete?: [str] - -schema AppsKruiseIoV1alpha1CloneSetSpecSelector: - """ Selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1CloneSetSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1CloneSetSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1CloneSetSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategy: - """ UpdateStrategy indicates the UpdateStrategy that will be employed to update Pods in the CloneSet when a revision is made to Template. - - Attributes - ---------- - maxSurge : int, default is Undefined, optional - The maximum number of pods that can be scheduled above the desired replicas during update or specified delete. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. Defaults to 0. - maxUnavailable : int, default is Undefined, optional - The maximum number of pods that can be unavailable during update or scale. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up by default. When maxSurge > 0, absolute number is calculated from percentage by rounding down. Defaults to 20%. - partition : int, default is Undefined, optional - Partition is the desired number of pods in old revisions. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up by default. It means when partition is set during pods updating, (replicas - partition value) number of pods will be updated. Default value is 0. - paused : bool, default is Undefined, optional - Paused indicates that the CloneSet is paused. Default value is false - scatterStrategy : [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyScatterStrategyItems0], default is Undefined, optional - ScatterStrategy defines the scatter rules to make pods been scattered when update. This will avoid pods with the same key-value to be updated in one batch. - Note that pods will be scattered after priority sort. So, although priority strategy and scatter strategy can be applied together, we suggest to use either one of them. - If scatterStrategy is used, we suggest to just use one term. Otherwise, the update order can be hard to understand. - $type : str, default is Undefined, optional - Type indicates the type of the CloneSetUpdateStrategy. Default is ReCreate. - inPlaceUpdateStrategy : AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyInPlaceUpdateStrategy, default is Undefined, optional - in place update strategy - priorityStrategy : AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategy, default is Undefined, optional - priority strategy - """ - - maxSurge?: int - - maxUnavailable?: int - - partition?: int - - paused?: bool - - scatterStrategy?: [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyScatterStrategyItems0] - - $type?: str - - inPlaceUpdateStrategy?: AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyInPlaceUpdateStrategy - - priorityStrategy?: AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategy - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyInPlaceUpdateStrategy: - """ InPlaceUpdateStrategy contains strategies for in-place update. - - Attributes - ---------- - gracePeriodSeconds : int, default is Undefined, optional - GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec when in-place update a Pod. - """ - - gracePeriodSeconds?: int - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategy: - """ Priorities are the rules for calculating the priority of updating pods. Each pod to be updated, will pass through these terms and get a sum of weights. - - Attributes - ---------- - orderPriority : [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyOrderPriorityItems0], default is Undefined, optional - Order priority terms, pods will be sorted by the value of orderedKey. For example: ``` orderPriority: - orderedKey: key1 - orderedKey: key2 ``` First, all pods which have key1 in labels will be sorted by the value of key1. Then, the left pods which have no key1 but have key2 in labels will be sorted by the value of key2 and put behind those pods have key1. - weightPriority : [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0], default is Undefined, optional - Weight priority terms, pods will be sorted by the sum of all terms weight. - """ - - orderPriority?: [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyOrderPriorityItems0] - - weightPriority?: [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0] - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyOrderPriorityItems0: - """ UpdatePriorityOrder defines order priority. - - Attributes - ---------- - orderedKey : str, default is Undefined, required - Calculate priority by value of this key. Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value, such as getting 5 in value '5', getting 10 in value 'sts-10'. - """ - - orderedKey: str - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0: - """ UpdatePriorityWeightTerm defines weight priority. - - Attributes - ---------- - matchSelector : AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelector, default is Undefined, required - match selector - weight : int, default is Undefined, required - Weight associated with matching the corresponding matchExpressions, in the range 1-100. - """ - - matchSelector: AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelector - - weight: int - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelector: - """ MatchSelector is used to select by pod's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1CloneSetSpecUpdateStrategyScatterStrategyItems0: - """apps kruise io v1alpha1 clone set spec update strategy scatter strategy items0 - - Attributes - ---------- - key : str, default is Undefined, required - key - value : str, default is Undefined, required - value - """ - - key: str - - value: str - -schema AppsKruiseIoV1alpha1CloneSetStatus: - """ CloneSetStatus defines the observed state of CloneSet - - Attributes - ---------- - availableReplicas : int, default is Undefined, required - AvailableReplicas is the number of Pods created by the CloneSet controller that have a Ready Condition for at least minReadySeconds. - collisionCount : int, default is Undefined, optional - CollisionCount is the count of hash collisions for the CloneSet. The CloneSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. - conditions : [AppsKruiseIoV1alpha1CloneSetStatusConditionsItems0], default is Undefined, optional - Conditions represents the latest available observations of a CloneSet's current state. - currentRevision : str, default is Undefined, optional - currentRevision, if not empty, indicates the current revision version of the CloneSet. - labelSelector : str, default is Undefined, optional - LabelSelector is label selectors for query over pods that should match the replica count used by HPA. - observedGeneration : int, default is Undefined, optional - ObservedGeneration is the most recent generation observed for this CloneSet. It corresponds to the CloneSet's generation, which is updated on mutation by the API Server. - readyReplicas : int, default is Undefined, required - ReadyReplicas is the number of Pods created by the CloneSet controller that have a Ready Condition. - replicas : int, default is Undefined, required - Replicas is the number of Pods created by the CloneSet controller. - updateRevision : str, default is Undefined, optional - UpdateRevision, if not empty, indicates the latest revision of the CloneSet. - updatedReadyReplicas : int, default is Undefined, required - UpdatedReadyReplicas is the number of Pods created by the CloneSet controller from the CloneSet version indicated by updateRevision and have a Ready Condition. - updatedReplicas : int, default is Undefined, required - UpdatedReplicas is the number of Pods created by the CloneSet controller from the CloneSet version indicated by updateRevision. - """ - - availableReplicas: int - - collisionCount?: int - - conditions?: [AppsKruiseIoV1alpha1CloneSetStatusConditionsItems0] - - currentRevision?: str - - labelSelector?: str - - observedGeneration?: int - - readyReplicas: int - - replicas: int - - updateRevision?: str - - updatedReadyReplicas: int - - updatedReplicas: int - -schema AppsKruiseIoV1alpha1CloneSetStatusConditionsItems0: - """ CloneSetCondition describes the state of a CloneSet at a certain point. - - Attributes - ---------- - lastTransitionTime : str, default is Undefined, optional - Last time the condition transitioned from one status to another. - message : str, default is Undefined, optional - A human readable message indicating details about the transition. - reason : str, default is Undefined, optional - The reason for the condition's last transition. - status : str, default is Undefined, required - Status of the condition, one of True, False, Unknown. - $type : str, default is Undefined, required - Type of CloneSet condition. - """ - - lastTransitionTime?: str - - message?: str - - reason?: str - - status: str - - $type: str diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_container_recreate_request.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_container_recreate_request.k deleted file mode 100644 index dfc8a4fb..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_container_recreate_request.k +++ /dev/null @@ -1,170 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema ContainerRecreateRequest: - """ ContainerRecreateRequest is the Schema for the containerrecreaterequests API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "ContainerRecreateRequest", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1ContainerRecreateRequestSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1ContainerRecreateRequestStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "ContainerRecreateRequest" = "ContainerRecreateRequest" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1ContainerRecreateRequestSpec - - status?: AppsKruiseIoV1alpha1ContainerRecreateRequestStatus - -schema AppsKruiseIoV1alpha1ContainerRecreateRequestSpec: - """ ContainerRecreateRequestSpec defines the desired state of ContainerRecreateRequest - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, optional - ActiveDeadlineSeconds is the deadline duration of this ContainerRecreateRequest. - containers : [AppsKruiseIoV1alpha1ContainerRecreateRequestSpecContainersItems0], default is Undefined, required - Containers contains the containers that need to recreate in the Pod. - podName : str, default is Undefined, required - PodName is name of the Pod that owns the recreated containers. - ttlSecondsAfterFinished : int, default is Undefined, optional - TTLSecondsAfterFinished is the TTL duration after this ContainerRecreateRequest has completed. - strategy : AppsKruiseIoV1alpha1ContainerRecreateRequestSpecStrategy, default is Undefined, optional - strategy - """ - - activeDeadlineSeconds?: int - - containers: [AppsKruiseIoV1alpha1ContainerRecreateRequestSpecContainersItems0] - - podName: str - - ttlSecondsAfterFinished?: int - - strategy?: AppsKruiseIoV1alpha1ContainerRecreateRequestSpecStrategy - -schema AppsKruiseIoV1alpha1ContainerRecreateRequestSpecContainersItems0: - """ ContainerRecreateRequestContainer defines the container that need to recreate. - - Attributes - ---------- - name : str, default is Undefined, required - Name of the container that need to recreate. It must be existing in the real pod.Spec.Containers. - ports : [any], default is Undefined, optional - Ports is synced from the real container in Pod spec during this ContainerRecreateRequest creating. Populated by the system. Read-only. - preStop : any, default is Undefined, optional - PreStop is synced from the real container in Pod spec during this ContainerRecreateRequest creating. Populated by the system. Read-only. - statusContext : AppsKruiseIoV1alpha1ContainerRecreateRequestSpecContainersItems0StatusContext, default is Undefined, optional - status context - """ - - name: str - - ports?: [any] - - preStop?: any - - statusContext?: AppsKruiseIoV1alpha1ContainerRecreateRequestSpecContainersItems0StatusContext - -schema AppsKruiseIoV1alpha1ContainerRecreateRequestSpecContainersItems0StatusContext: - """ StatusContext is synced from the real Pod status during this ContainerRecreateRequest creating. Populated by the system. Read-only. - - Attributes - ---------- - containerID : str, default is Undefined, required - Container's ID in the format 'docker://'. - restartCount : int, default is Undefined, required - The number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed. Note that this is calculated from dead containers. But those containers are subject to garbage collection. This value will get capped at 5 by GC. - """ - - containerID: str - - restartCount: int - -schema AppsKruiseIoV1alpha1ContainerRecreateRequestSpecStrategy: - """ Strategy defines strategies for containers recreation. - - Attributes - ---------- - failurePolicy : str, default is Undefined, optional - FailurePolicy decides whether to continue if one container fails to recreate - minStartedSeconds : int, default is Undefined, optional - Minimum number of seconds for which a newly created container should be started and ready without any of its container crashing, for it to be considered Succeeded. Defaults to 0 (container will be considered Succeeded as soon as it is started and ready) - orderedRecreate : bool, default is Undefined, optional - OrderedRecreate indicates whether to recreate the next container only if the previous one has recreated completely. - terminationGracePeriodSeconds : int, default is Undefined, optional - TerminationGracePeriodSeconds is the optional duration in seconds to wait the container terminating gracefully. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, we will use pod.Spec.TerminationGracePeriodSeconds as default value. - unreadyGracePeriodSeconds : int, default is Undefined, optional - UnreadyGracePeriodSeconds is the optional duration in seconds to mark Pod as not ready over this duration before executing preStop hook and stopping the container. - """ - - failurePolicy?: str - - minStartedSeconds?: int - - orderedRecreate?: bool - - terminationGracePeriodSeconds?: int - - unreadyGracePeriodSeconds?: int - -schema AppsKruiseIoV1alpha1ContainerRecreateRequestStatus: - """ ContainerRecreateRequestStatus defines the observed state of ContainerRecreateRequest - - Attributes - ---------- - completionTime : str, default is Undefined, optional - Represents time when the ContainerRecreateRequest was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - containerRecreateStates : [AppsKruiseIoV1alpha1ContainerRecreateRequestStatusContainerRecreateStatesItems0], default is Undefined, optional - ContainerRecreateStates contains the recreation states of the containers. - message : str, default is Undefined, optional - A human readable message indicating details about this ContainerRecreateRequest. - phase : str, default is Undefined, required - Phase of this ContainerRecreateRequest, e.g. Pending, Recreating, Completed - """ - - completionTime?: str - - containerRecreateStates?: [AppsKruiseIoV1alpha1ContainerRecreateRequestStatusContainerRecreateStatesItems0] - - message?: str - - phase: str - -schema AppsKruiseIoV1alpha1ContainerRecreateRequestStatusContainerRecreateStatesItems0: - """ ContainerRecreateRequestContainerRecreateState contains the recreation state of the container. - - Attributes - ---------- - message : str, default is Undefined, optional - A human readable message indicating details about this state. - name : str, default is Undefined, required - Name of the container. - phase : str, default is Undefined, required - Phase indicates the recreation phase of the container. - """ - - message?: str - - name: str - - phase: str diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_daemon_set.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_daemon_set.k deleted file mode 100644 index 4c00e8c6..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_daemon_set.k +++ /dev/null @@ -1,259 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema DaemonSet: - """ DaemonSet is the Schema for the daemonsets API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "DaemonSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1DaemonSetSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1DaemonSetStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "DaemonSet" = "DaemonSet" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1DaemonSetSpec - - status?: AppsKruiseIoV1alpha1DaemonSetStatus - -schema AppsKruiseIoV1alpha1DaemonSetSpec: - """ DaemonSetSpec defines the desired state of DaemonSet - - Attributes - ---------- - burstReplicas : int, default is Undefined, optional - BurstReplicas is a rate limiter for booting pods on a lot of pods. The default value is 250 - minReadySeconds : int, default is Undefined, optional - The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready). - revisionHistoryLimit : int, default is Undefined, optional - The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. - template : any, default is Undefined, required - 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/replicationcontroller#pod-template - selector : AppsKruiseIoV1alpha1DaemonSetSpecSelector, default is Undefined, required - selector - updateStrategy : AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - burstReplicas?: int - - minReadySeconds?: int - - revisionHistoryLimit?: int - - template: any - - selector: AppsKruiseIoV1alpha1DaemonSetSpecSelector - - updateStrategy?: AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategy - -schema AppsKruiseIoV1alpha1DaemonSetSpecSelector: - """ A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1DaemonSetSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1DaemonSetSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1DaemonSetSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategy: - """ An update strategy to replace existing DaemonSet pods with new pods. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate. - rollingUpdate : AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdate, default is Undefined, optional - rolling update - """ - - $type?: str - - rollingUpdate?: AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdate - -schema AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdate: - """ Rolling update config params. Present only if type = "RollingUpdate". - - Attributes - ---------- - maxSurge : int, default is Undefined, optional - Only when type=SurgingRollingUpdateType, it works. The maximum number of DaemonSet pods that can be scheduled above the desired number of pods during the update. Value can be an absolute number (ex: 5) or a percentage of the total number of DaemonSet pods at the start of the update (ex: 10%). The absolute number is calculated from the percentage by rounding up. This cannot be 0. The 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 2 pods running at any given time. The update starts by starting replacements for at most 30% of those DaemonSet pods. Once the new pods are available it then stops the existing pods before proceeding onto other DaemonSet pods, thus ensuring that at most 130% of the desired final number of DaemonSet pods are running at all times during the update. - maxUnavailable : int, default is Undefined, optional - 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. - partition : int, default is Undefined, optional - The number of DaemonSet pods remained to be old version. Default value is 0. Maximum value is status.DesiredNumberScheduled, which means no pod will be updated. - paused : bool, default is Undefined, optional - Indicates that the daemon set is paused and will not be processed by the daemon set controller. - rollingUpdateType : str, default is Undefined, optional - Type is to specify which kind of rollingUpdate. - selector : AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdateSelector, default is Undefined, optional - selector - """ - - maxSurge?: int - - maxUnavailable?: int - - partition?: int - - paused?: bool - - rollingUpdateType?: str - - selector?: AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdateSelector - -schema AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdateSelector: - """ A label query over nodes that are managed by the daemon set RollingUpdate. Must match in order to be controlled. It must match the node's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdateSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdateSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1DaemonSetSpecUpdateStrategyRollingUpdateSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1DaemonSetStatus: - """ DaemonSetStatus defines the observed state of DaemonSet - - Attributes - ---------- - collisionCount : int, default is Undefined, optional - Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. - conditions : [AppsKruiseIoV1alpha1DaemonSetStatusConditionsItems0], default is Undefined, optional - Represents the latest available observations of a DaemonSet's current state. - currentNumberScheduled : int, default is Undefined, required - The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - daemonSetHash : str, default is Undefined, required - DaemonSetHash is the controller-revision-hash, which represents the latest version of the DaemonSet. - desiredNumberScheduled : int, default is Undefined, required - The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - numberAvailable : int, default is Undefined, optional - The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds) - numberMisscheduled : int, default is Undefined, required - The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - numberReady : int, default is Undefined, required - The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready. - numberUnavailable : int, default is Undefined, optional - The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds) - observedGeneration : int, default is Undefined, optional - The most recent generation observed by the daemon set controller. - updatedNumberScheduled : int, default is Undefined, required - The total number of nodes that are running updated daemon pod - """ - - collisionCount?: int - - conditions?: [AppsKruiseIoV1alpha1DaemonSetStatusConditionsItems0] - - currentNumberScheduled: int - - daemonSetHash: str - - desiredNumberScheduled: int - - numberAvailable?: int - - numberMisscheduled: int - - numberReady: int - - numberUnavailable?: int - - observedGeneration?: int - - updatedNumberScheduled: int - -schema AppsKruiseIoV1alpha1DaemonSetStatusConditionsItems0: - """ DaemonSetCondition describes the state of a DaemonSet at a certain point. - - Attributes - ---------- - lastTransitionTime : str, default is Undefined, optional - Last time the condition transitioned from one status to another. - message : str, default is Undefined, optional - A human readable message indicating details about the transition. - reason : str, default is Undefined, optional - The reason for the condition's last transition. - status : str, default is Undefined, required - Status of the condition, one of True, False, Unknown. - $type : str, default is Undefined, required - Type of DaemonSet condition. - """ - - lastTransitionTime?: str - - message?: str - - reason?: str - - status: str - - $type: str diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_image_pull_job.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_image_pull_job.k deleted file mode 100644 index 6618bb0c..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_image_pull_job.k +++ /dev/null @@ -1,216 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema ImagePullJob: - """ ImagePullJob is the Schema for the imagepulljobs API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "ImagePullJob", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1ImagePullJobSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1ImagePullJobStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "ImagePullJob" = "ImagePullJob" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1ImagePullJobSpec - - status?: AppsKruiseIoV1alpha1ImagePullJobStatus - -schema AppsKruiseIoV1alpha1ImagePullJobSpec: - """ ImagePullJobSpec defines the desired state of ImagePullJob - - Attributes - ---------- - image : str, default is Undefined, required - Image is the image to be pulled by the job - parallelism : int, default is Undefined, optional - Parallelism is the requested parallelism, it can be set to any non-negative value. If it is unspecified, it defaults to 1. If it is specified as 0, then the Job is effectively paused until it is increased. - pullSecrets : [str], default is Undefined, optional - ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling the image. 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. - completionPolicy : AppsKruiseIoV1alpha1ImagePullJobSpecCompletionPolicy, default is Undefined, required - completion policy - podSelector : AppsKruiseIoV1alpha1ImagePullJobSpecPodSelector, default is Undefined, optional - pod selector - pullPolicy : AppsKruiseIoV1alpha1ImagePullJobSpecPullPolicy, default is Undefined, optional - pull policy - selector : AppsKruiseIoV1alpha1ImagePullJobSpecSelector, default is Undefined, optional - selector - """ - - image: str - - parallelism?: int - - pullSecrets?: [str] - - completionPolicy: AppsKruiseIoV1alpha1ImagePullJobSpecCompletionPolicy - - podSelector?: AppsKruiseIoV1alpha1ImagePullJobSpecPodSelector - - pullPolicy?: AppsKruiseIoV1alpha1ImagePullJobSpecPullPolicy - - selector?: AppsKruiseIoV1alpha1ImagePullJobSpecSelector - -schema AppsKruiseIoV1alpha1ImagePullJobSpecCompletionPolicy: - """ CompletionPolicy indicates the completion policy of the job. Default is Always CompletionPolicyType. - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, optional - ActiveDeadlineSeconds 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. Only works for Always type. - ttlSecondsAfterFinished : int, default is Undefined, 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. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature. Only works for Always type - $type : str, default is Undefined, optional - Type indicates the type of the CompletionPolicy Default is Always - """ - - activeDeadlineSeconds?: int - - ttlSecondsAfterFinished?: int - - $type?: str - -schema AppsKruiseIoV1alpha1ImagePullJobSpecPodSelector: - """ PodSelector is a query over pods that should pull image on nodes of these pods. Mutually exclusive with Selector. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1ImagePullJobSpecPodSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1ImagePullJobSpecPodSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1ImagePullJobSpecPodSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1ImagePullJobSpecPullPolicy: - """ PullPolicy is an optional field to set parameters of the pulling task. If not specified, the system will use the default values. - - Attributes - ---------- - backoffLimit : int, default is Undefined, optional - Specifies the number of retries before marking the pulling task failed. Defaults to 3 - timeoutSeconds : int, default is Undefined, optional - Specifies the timeout of the pulling task. Defaults to 600 - """ - - backoffLimit?: int - - timeoutSeconds?: int - -schema AppsKruiseIoV1alpha1ImagePullJobSpecSelector: - """ Selector is a query over nodes that should match the job. nil to match all nodes. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1ImagePullJobSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - names : [str], default is Undefined, optional - Names specify a set of nodes to execute the job. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1ImagePullJobSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - - names?: [str] - -schema AppsKruiseIoV1alpha1ImagePullJobSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1ImagePullJobStatus: - """ ImagePullJobStatus defines the observed state of ImagePullJob - - Attributes - ---------- - active : int, default is Undefined, optional - The number of actively running pulling tasks. - completionTime : str, default is Undefined, optional - Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - desired : int, default is Undefined, required - The desired number of pulling tasks, this is typically equal to the number of nodes satisfied. - failed : int, default is Undefined, optional - The number of pulling tasks which reached phase Failed. - failedNodes : [str], default is Undefined, optional - The nodes that failed to pull the image. - message : str, default is Undefined, optional - The text prompt for job running status. - startTime : str, default is Undefined, optional - Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - succeeded : int, default is Undefined, optional - The number of pulling tasks which reached phase Succeeded. - """ - - active?: int - - completionTime?: str - - desired: int - - failed?: int - - failedNodes?: [str] - - message?: str - - startTime?: str - - succeeded?: int diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_node_image.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_node_image.k deleted file mode 100644 index 2ff5e750..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_node_image.k +++ /dev/null @@ -1,249 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema NodeImage: - """ NodeImage is the Schema for the nodeimages API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "NodeImage", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1NodeImageSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1NodeImageStatus, default is Undefined, optional - status - """ - - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "NodeImage" = "NodeImage" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1NodeImageSpec - - status?: AppsKruiseIoV1alpha1NodeImageStatus - - -schema AppsKruiseIoV1alpha1NodeImageSpec: - """ NodeImageSpec defines the desired state of NodeImage - - Attributes - ---------- - images : {str:AppsKruiseIoV1alpha1NodeImageSpecImagesAnon}, default is Undefined, optional - Specifies images to be pulled on this node It can not be more than 256 for each NodeImage - """ - - - images?: {str:AppsKruiseIoV1alpha1NodeImageSpecImagesAnon} - - -schema AppsKruiseIoV1alpha1NodeImageSpecImagesAnon: - """ ImageSpec defines the pulling spec of an image - - Attributes - ---------- - pullSecrets : [AppsKruiseIoV1alpha1NodeImageSpecImagesAnonPullSecretsItems0], default is Undefined, optional - PullSecrets is an optional list of references to secrets in the same namespace to use for pulling the image. 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. - tags : [AppsKruiseIoV1alpha1NodeImageSpecImagesAnonTagsItems0], default is Undefined, required - Tags is a list of versions of this image - """ - - - pullSecrets?: [AppsKruiseIoV1alpha1NodeImageSpecImagesAnonPullSecretsItems0] - - tags: [AppsKruiseIoV1alpha1NodeImageSpecImagesAnonTagsItems0] - - -schema AppsKruiseIoV1alpha1NodeImageSpecImagesAnonPullSecretsItems0: - """ ReferenceObject comprises a resource name, with a mandatory namespace, rendered as "/". - - Attributes - ---------- - name : str, default is Undefined, optional - name - namespace : str, default is Undefined, optional - namespace - """ - - - name?: str - - namespace?: str - - -schema AppsKruiseIoV1alpha1NodeImageSpecImagesAnonTagsItems0: - """ ImageTagSpec defines the pulling spec of an image tag - - Attributes - ---------- - createdAt : str, default is Undefined, optional - Specifies the create time of this tag - ownerReferences : [any], default is Undefined, optional - List of objects depended by this object. If this image is managed by a controller, then an entry in this list will point to this controller. - pullPolicy : AppsKruiseIoV1alpha1NodeImageSpecImagesAnonTagsItems0PullPolicy, default is Undefined, optional - pull policy - tag : str, default is Undefined, required - Specifies the image tag - version : int, default is Undefined, optional - An opaque value that represents the internal version of this tag that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. Populated by the system. Read-only. Value must be treated as opaque by clients and . - """ - - - createdAt?: str - - ownerReferences?: [any] - - pullPolicy?: AppsKruiseIoV1alpha1NodeImageSpecImagesAnonTagsItems0PullPolicy - - tag: str - - version?: int - - -schema AppsKruiseIoV1alpha1NodeImageSpecImagesAnonTagsItems0PullPolicy: - """ PullPolicy is an optional field to set parameters of the pulling task. If not specified, the system will use the default values. - - Attributes - ---------- - activeDeadlineSeconds : int, default is Undefined, optional - ActiveDeadlineSeconds specifies the duration in seconds relative to the startTime that the task may be active before the system tries to terminate it; value must be positive integer. if not specified, the system will never terminate it. - backoffLimit : int, default is Undefined, optional - Specifies the number of retries before marking the pulling task failed. Defaults to 3 - timeoutSeconds : int, default is Undefined, optional - Specifies the timeout of the pulling task. Defaults to 600 - ttlSecondsAfterFinished : int, default is Undefined, optional - TTLSecondsAfterFinished limits the lifetime of a pulling task that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the task finishes, it is eligible to be automatically deleted. If this field is unset, the task won't be automatically deleted. If this field is set to zero, the task becomes eligible to be deleted immediately after it finishes. - """ - - - activeDeadlineSeconds?: int - - backoffLimit?: int - - timeoutSeconds?: int - - ttlSecondsAfterFinished?: int - - -schema AppsKruiseIoV1alpha1NodeImageStatus: - """ NodeImageStatus defines the observed state of NodeImage - - Attributes - ---------- - desired : int, default is Undefined, required - The desired number of pulling tasks, this is typically equal to the number of images in spec. - failed : int, default is Undefined, optional - The number of pulling tasks which reached phase Failed. - imageStatuses : {str:AppsKruiseIoV1alpha1NodeImageStatusImageStatusesAnon}, default is Undefined, optional - all statuses of active image pulling tasks - pulling : int, default is Undefined, optional - The number of pulling tasks which are not finished. - succeeded : int, default is Undefined, optional - The number of pulling tasks which reached phase Succeeded. - firstSyncStatus : AppsKruiseIoV1alpha1NodeImageStatusFirstSyncStatus, default is Undefined, optional - first sync status - """ - - - desired: int - - failed?: int - - imageStatuses?: {str:AppsKruiseIoV1alpha1NodeImageStatusImageStatusesAnon} - - pulling?: int - - succeeded?: int - - firstSyncStatus?: AppsKruiseIoV1alpha1NodeImageStatusFirstSyncStatus - - -schema AppsKruiseIoV1alpha1NodeImageStatusFirstSyncStatus: - """ The first of all job has finished on this node. When a node is added to the cluster, we want to know the time when the node's image pulling is completed, and use it to trigger the operation of the upper system. - - Attributes - ---------- - message : str, default is Undefined, optional - message - status : str, default is Undefined, optional - SyncStatusPhase defines the node status - syncAt : str, default is Undefined, optional - sync at - """ - - - message?: str - - status?: str - - syncAt?: str - - -schema AppsKruiseIoV1alpha1NodeImageStatusImageStatusesAnon: - """ ImageStatus defines the pulling status of an image - - Attributes - ---------- - tags : [AppsKruiseIoV1alpha1NodeImageStatusImageStatusesAnonTagsItems0], default is Undefined, required - Represents statuses of pulling tasks on this node - """ - - - tags: [AppsKruiseIoV1alpha1NodeImageStatusImageStatusesAnonTagsItems0] - - -schema AppsKruiseIoV1alpha1NodeImageStatusImageStatusesAnonTagsItems0: - """ ImageTagStatus defines the pulling status of an image tag - - Attributes - ---------- - completionTime : str, default is Undefined, optional - Represents time when the pulling task was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - imageID : str, default is Undefined, optional - Represents the ID of this image. - message : str, default is Undefined, optional - Represents the summary informations of this node - phase : str, default is Undefined, required - Represents the image pulling task phase. - progress : int, default is Undefined, optional - Represents the pulling progress of this tag, which is beetween 0-100. There is no guarantee of monotonic consistency, and it may be a rollback due to retry during pulling. - startTime : str, default is Undefined, optional - Represents time when the pulling task was acknowledged by the image puller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. - tag : str, default is Undefined, required - Represents the image tag. - version : int, default is Undefined, optional - Represents the internal version of this tag that the daemon handled. - """ - - - completionTime?: str - - imageID?: str - - message?: str - - phase: str - - progress?: int - - startTime?: str - - tag: str - - version?: int - - diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_sidecar_set.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_sidecar_set.k deleted file mode 100644 index 3a82fded..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_sidecar_set.k +++ /dev/null @@ -1,372 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema SidecarSet: - """ SidecarSet is the Schema for the sidecarsets API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "SidecarSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1SidecarSetSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1SidecarSetStatus, default is Undefined, optional - status - """ - - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "SidecarSet" = "SidecarSet" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1SidecarSetSpec - - status?: AppsKruiseIoV1alpha1SidecarSetStatus - - -schema AppsKruiseIoV1alpha1SidecarSetSpec: - """ SidecarSetSpec defines the desired state of SidecarSet - - Attributes - ---------- - containers : [AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0], default is Undefined, optional - Containers is the list of sidecar containers to be injected into the selected pod - initContainers : [AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0], default is Undefined, optional - Containers is the list of init containers to be injected into the selected pod We will inject those containers by their name in ascending order We only inject init containers when a new pod is created, it does not apply to any existing pod - namespace : str, default is Undefined, optional - Namespace sidecarSet will only match the pods in the namespace otherwise, match pods in all namespaces(in cluster) - volumes : [any], default is Undefined, optional - List of volumes that can be mounted by sidecar containers - selector : AppsKruiseIoV1alpha1SidecarSetSpecSelector, default is Undefined, optional - selector - updateStrategy : AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - - containers?: [AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0] - - initContainers?: [AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0] - - namespace?: str - - volumes?: [any] - - selector?: AppsKruiseIoV1alpha1SidecarSetSpecSelector - - updateStrategy?: AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategy - - -schema AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0: - """ SidecarContainer defines the container of Sidecar - - Attributes - ---------- - podInjectPolicy : str, default is Undefined, optional - The rules that injected SidecarContainer into Pod.spec.containers, not takes effect in initContainers If BeforeAppContainer, the SidecarContainer will be injected in front of the pod.spec.containers otherwise it will be injected into the back. default BeforeAppContainerType - shareVolumePolicy : AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0ShareVolumePolicy, default is Undefined, optional - share volume policy - transferEnv : [AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0TransferEnvItems0], default is Undefined, optional - TransferEnv will transfer env info from other container SourceContainerName is pod.spec.container[x].name; EnvName is pod.spec.container[x].Env.name - upgradeStrategy : AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0UpgradeStrategy, default is Undefined, optional - upgrade strategy - """ - - - podInjectPolicy?: str - - shareVolumePolicy?: AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0ShareVolumePolicy - - transferEnv?: [AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0TransferEnvItems0] - - upgradeStrategy?: AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0UpgradeStrategy - - -schema AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0ShareVolumePolicy: - """ If ShareVolumePolicy is enabled, the sidecar container will share the other container's VolumeMounts in the pod(don't contains the injected sidecar container). - - Attributes - ---------- - $type : str, default is Undefined, optional - type - """ - - - $type?: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0TransferEnvItems0: - """apps kruise io v1alpha1 sidecar set spec containers items0 transfer env items0 - - Attributes - ---------- - envName : str, default is Undefined, optional - env name - sourceContainerName : str, default is Undefined, optional - source container name - """ - - - envName?: str - - sourceContainerName?: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecContainersItems0UpgradeStrategy: - """ sidecarContainer upgrade strategy, include: ColdUpgrade, HotUpgrade - - Attributes - ---------- - hotUpgradeEmptyImage : str, default is Undefined, optional - when HotUpgrade, HotUpgradeEmptyImage is used to complete the hot upgrading process HotUpgradeEmptyImage is consistent of sidecar container in Command, Args, Liveness probe, etc. but it does no actual work. - upgradeType : str, default is Undefined, optional - when sidecar container is stateless, use ColdUpgrade otherwise HotUpgrade are more HotUpgrade. examples for istio envoy container is suitable for HotUpgrade default is ColdUpgrade - """ - - - hotUpgradeEmptyImage?: str - - upgradeType?: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0: - """ SidecarContainer defines the container of Sidecar - - Attributes - ---------- - podInjectPolicy : str, default is Undefined, optional - The rules that injected SidecarContainer into Pod.spec.containers, not takes effect in initContainers If BeforeAppContainer, the SidecarContainer will be injected in front of the pod.spec.containers otherwise it will be injected into the back. default BeforeAppContainerType - shareVolumePolicy : AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0ShareVolumePolicy, default is Undefined, optional - share volume policy - transferEnv : [AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0TransferEnvItems0], default is Undefined, optional - TransferEnv will transfer env info from other container SourceContainerName is pod.spec.container[x].name; EnvName is pod.spec.container[x].Env.name - upgradeStrategy : AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0UpgradeStrategy, default is Undefined, optional - upgrade strategy - """ - - - podInjectPolicy?: str - - shareVolumePolicy?: AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0ShareVolumePolicy - - transferEnv?: [AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0TransferEnvItems0] - - upgradeStrategy?: AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0UpgradeStrategy - - -schema AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0ShareVolumePolicy: - """ If ShareVolumePolicy is enabled, the sidecar container will share the other container's VolumeMounts in the pod(don't contains the injected sidecar container). - - Attributes - ---------- - $type : str, default is Undefined, optional - type - """ - - - $type?: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0TransferEnvItems0: - """apps kruise io v1alpha1 sidecar set spec init containers items0 transfer env items0 - - Attributes - ---------- - envName : str, default is Undefined, optional - env name - sourceContainerName : str, default is Undefined, optional - source container name - """ - - - envName?: str - - sourceContainerName?: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecInitContainersItems0UpgradeStrategy: - """ sidecarContainer upgrade strategy, include: ColdUpgrade, HotUpgrade - - Attributes - ---------- - hotUpgradeEmptyImage : str, default is Undefined, optional - when HotUpgrade, HotUpgradeEmptyImage is used to complete the hot upgrading process HotUpgradeEmptyImage is consistent of sidecar container in Command, Args, Liveness probe, etc. but it does no actual work. - upgradeType : str, default is Undefined, optional - when sidecar container is stateless, use ColdUpgrade otherwise HotUpgrade are more HotUpgrade. examples for istio envoy container is suitable for HotUpgrade default is ColdUpgrade - """ - - - hotUpgradeEmptyImage?: str - - upgradeType?: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecSelector: - """ selector is a label query over pods that should be injected - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1SidecarSetSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - - matchExpressions?: [AppsKruiseIoV1alpha1SidecarSetSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - - -schema AppsKruiseIoV1alpha1SidecarSetSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - - key: str - - operator: str - - values?: [str] - - -schema AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategy: - """ The sidecarset updateStrategy to use to replace existing pods with new ones. - - Attributes - ---------- - maxUnavailable : int, default is Undefined, optional - The maximum number of SidecarSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of SidecarSet 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. - partition : int, default is Undefined, optional - Partition is the desired number of pods in old revisions. It means when partition is set during pods updating, (replicas - partition) number of pods will be updated. Default value is 0. - paused : bool, default is Undefined, optional - Paused indicates that the SidecarSet is paused to update the injected pods, but it don't affect the webhook inject sidecar container into the newly created pods. default is false - scatterStrategy : [AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategyScatterStrategyItems0], default is Undefined, optional - ScatterStrategy defines the scatter rules to make pods been scattered when update. This will avoid pods with the same key-value to be updated in one batch. - Note that pods will be scattered after priority sort. So, although priority strategy and scatter strategy can be applied together, we suggest to use either one of them. - If scatterStrategy is used, we suggest to just use one term. Otherwise, the update order can be hard to understand. - $type : str, default is Undefined, optional - Type is NotUpdate, the SidecarSet don't update the injected pods, it will only inject sidecar container into the newly created pods. Type is RollingUpdate, the SidecarSet will update the injected pods to the latest version on RollingUpdate Strategy. default is RollingUpdate - selector : AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategySelector, default is Undefined, optional - selector - """ - - - maxUnavailable?: int - - partition?: int - - paused?: bool - - scatterStrategy?: [AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategyScatterStrategyItems0] - - $type?: str - - selector?: AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategySelector - - -schema AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategyScatterStrategyItems0: - """apps kruise io v1alpha1 sidecar set spec update strategy scatter strategy items0 - - Attributes - ---------- - key : str, default is Undefined, required - key - value : str, default is Undefined, required - value - """ - - - key: str - - value: str - - -schema AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategySelector: - """ If selector is not nil, this upgrade will only update the selected pods. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategySelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - - matchExpressions?: [AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategySelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - - -schema AppsKruiseIoV1alpha1SidecarSetSpecUpdateStrategySelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - - key: str - - operator: str - - values?: [str] - - -schema AppsKruiseIoV1alpha1SidecarSetStatus: - """ SidecarSetStatus defines the observed state of SidecarSet - - Attributes - ---------- - matchedPods : int, default is Undefined, required - matchedPods is the number of Pods whose labels are matched with this SidecarSet's selector and are created after sidecarset creates - observedGeneration : int, default is Undefined, optional - observedGeneration is the most recent generation observed for this SidecarSet. It corresponds to the SidecarSet's generation, which is updated on mutation by the API Server. - readyPods : int, default is Undefined, required - readyPods is the number of matched Pods that have a ready condition - updatedPods : int, default is Undefined, required - updatedPods is the number of matched Pods that are injected with the latest SidecarSet's containers - updatedReadyPods : int, default is Undefined, optional - updatedReadyPods is the number of matched pods that updated and ready - """ - - - matchedPods: int - - observedGeneration?: int - - readyPods: int - - updatedPods: int - - updatedReadyPods?: int - - diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_stateful_set.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_stateful_set.k deleted file mode 100644 index bc2f0a07..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_stateful_set.k +++ /dev/null @@ -1,307 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema StatefulSet: - """ StatefulSet is the Schema for the statefulsets API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "StatefulSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1StatefulSetSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1StatefulSetStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "StatefulSet" = "StatefulSet" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1StatefulSetSpec - - status?: AppsKruiseIoV1alpha1StatefulSetStatus - -schema AppsKruiseIoV1alpha1StatefulSetSpec: - """ StatefulSetSpec defines the desired state of StatefulSet - - Attributes - ---------- - podManagementPolicy : str, default is Undefined, 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. - replicas : int, default is Undefined, optional - replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. TODO: Consider a rename of this field. - revisionHistoryLimit : int, default is Undefined, optional - revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. - serviceName : str, default is Undefined, optional - serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller. - template : any, default is Undefined, required - template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. - volumeClaimTemplates : [any], default is Undefined, optional - volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. TODO: Define the behavior if a claim already exists with the same name. - selector : AppsKruiseIoV1alpha1StatefulSetSpecSelector, default is Undefined, required - selector - updateStrategy : AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - podManagementPolicy?: str - - replicas?: int - - revisionHistoryLimit?: int - - serviceName?: str - - template: any - - volumeClaimTemplates?: [any] - - selector: AppsKruiseIoV1alpha1StatefulSetSpecSelector - - updateStrategy?: AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategy - -schema AppsKruiseIoV1alpha1StatefulSetSpecSelector: - """ selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1StatefulSetSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1StatefulSetSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1StatefulSetSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategy: - """ updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate. - rollingUpdate : AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdate, default is Undefined, optional - rolling update - """ - - $type?: str - - rollingUpdate?: AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdate - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdate: - """ RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - - Attributes - ---------- - maxUnavailable : int, default is Undefined, optional - 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. Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy. Defaults to 1. - minReadySeconds : int, default is Undefined, optional - MinReadySeconds indicates how long will the pod be considered ready after it's updated. MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy. It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady. Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy. Default value is 0, max is 300. - partition : int, default is Undefined, optional - Partition indicates the ordinal at which the StatefulSet should be partitioned by default. But if unorderedUpdate has been set: - Partition indicates the number of pods with non-updated revisions when rolling update. - It means controller will update $(replicas - partition) number of pod. Default value is 0. - paused : bool, default is Undefined, optional - Paused indicates that the StatefulSet is paused. Default value is false - podUpdatePolicy : str, default is Undefined, optional - PodUpdatePolicy indicates how pods should be updated Default value is "ReCreate" - inPlaceUpdateStrategy : AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy, default is Undefined, optional - in place update strategy - unorderedUpdate : AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdate, default is Undefined, optional - unordered update - """ - - maxUnavailable?: int - - minReadySeconds?: int - - partition?: int - - paused?: bool - - podUpdatePolicy?: str - - inPlaceUpdateStrategy?: AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy - - unorderedUpdate?: AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdate - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy: - """ InPlaceUpdateStrategy contains strategies for in-place update. - - Attributes - ---------- - gracePeriodSeconds : int, default is Undefined, optional - GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec when in-place update a Pod. - """ - - gracePeriodSeconds?: int - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdate: - """ UnorderedUpdate contains strategies for non-ordered update. If it is not nil, pods will be updated with non-ordered sequence. Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy - - Attributes - ---------- - priorityStrategy : AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy, default is Undefined, optional - priority strategy - """ - - priorityStrategy?: AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy: - """ Priorities are the rules for calculating the priority of updating pods. Each pod to be updated, will pass through these terms and get a sum of weights. - - Attributes - ---------- - orderPriority : [AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0], default is Undefined, optional - Order priority terms, pods will be sorted by the value of orderedKey. For example: ``` orderPriority: - orderedKey: key1 - orderedKey: key2 ``` First, all pods which have key1 in labels will be sorted by the value of key1. Then, the left pods which have no key1 but have key2 in labels will be sorted by the value of key2 and put behind those pods have key1. - weightPriority : [AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0], default is Undefined, optional - Weight priority terms, pods will be sorted by the sum of all terms weight. - """ - - orderPriority?: [AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0] - - weightPriority?: [AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0] - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0: - """ UpdatePriorityOrder defines order priority. - - Attributes - ---------- - orderedKey : str, default is Undefined, required - Calculate priority by value of this key. Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value, such as getting 5 in value '5', getting 10 in value 'sts-10'. - """ - - orderedKey: str - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0: - """ UpdatePriorityWeightTerm defines weight priority. - - Attributes - ---------- - matchSelector : AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector, default is Undefined, required - match selector - weight : int, default is Undefined, required - Weight associated with matching the corresponding matchExpressions, in the range 1-100. - """ - - matchSelector: AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector - - weight: int - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector: - """ MatchSelector is used to select by pod's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1StatefulSetStatus: - """ StatefulSetStatus defines the observed state of StatefulSet - - Attributes - ---------- - availableReplicas : int, default is Undefined, required - AvailableReplicas is the number of Pods created by the StatefulSet controller that have been ready for minReadySeconds. - collisionCount : int, default is Undefined, optional - collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. - conditions : [any], default is Undefined, optional - Represents the latest available observations of a statefulset's current state. - currentReplicas : int, default is Undefined, required - currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision. - currentRevision : str, default is Undefined, optional - currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas). - labelSelector : str, default is Undefined, optional - LabelSelector is label selectors for query over pods that should match the replica count used by HPA. - observedGeneration : int, default is Undefined, optional - observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet's generation, which is updated on mutation by the API Server. - readyReplicas : int, default is Undefined, required - readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition. - replicas : int, default is Undefined, required - replicas is the number of Pods created by the StatefulSet controller. - updateRevision : str, default is Undefined, optional - updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas) - updatedReplicas : int, default is Undefined, required - updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision. - """ - - availableReplicas: int - - collisionCount?: int - - conditions?: [any] - - currentReplicas: int - - currentRevision?: str - - labelSelector?: str - - observedGeneration?: int - - readyReplicas: int - - replicas: int - - updateRevision?: str - - updatedReplicas: int diff --git a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_united_deployment.k b/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_united_deployment.k deleted file mode 100644 index 015c80b0..00000000 --- a/base/pkg/kusion_openkruise/apps/v1alpha1/apps_kruise_io_v1alpha1_united_deployment.k +++ /dev/null @@ -1,826 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema UnitedDeployment: - """ UnitedDeployment is the Schema for the uniteddeployments API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1alpha1", required - 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 - kind : str, default is "UnitedDeployment", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1UnitedDeploymentSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1alpha1UnitedDeploymentStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1alpha1" = "apps.kruise.io/v1alpha1" - - kind: "UnitedDeployment" = "UnitedDeployment" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1alpha1UnitedDeploymentSpec - - status?: AppsKruiseIoV1alpha1UnitedDeploymentStatus - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpec: - """ UnitedDeploymentSpec defines the desired state of UnitedDeployment. - - Attributes - ---------- - replicas : int, default is Undefined, optional - Replicas is the total desired replicas of all the subsets. If unspecified, defaults to 1. - revisionHistoryLimit : int, default is Undefined, optional - Indicates the number of histories to be conserved. If unspecified, defaults to 10. - selector : AppsKruiseIoV1alpha1UnitedDeploymentSpecSelector, default is Undefined, required - selector - template : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplate, default is Undefined, optional - template - topology : AppsKruiseIoV1alpha1UnitedDeploymentSpecTopology, default is Undefined, optional - topology - updateStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - replicas?: int - - revisionHistoryLimit?: int - - selector: AppsKruiseIoV1alpha1UnitedDeploymentSpecSelector - - template?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplate - - topology?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTopology - - updateStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecUpdateStrategy - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecSelector: - """ Selector is a label query over pods that should match the replica count. It must match the pod template's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1UnitedDeploymentSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplate: - """ Template describes the subset that will be created. - - Attributes - ---------- - advancedStatefulSetTemplate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplate, default is Undefined, optional - advanced stateful set template - cloneSetTemplate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplate, default is Undefined, optional - clone set template - deploymentTemplate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateDeploymentTemplate, default is Undefined, optional - deployment template - statefulSetTemplate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateStatefulSetTemplate, default is Undefined, optional - stateful set template - """ - - advancedStatefulSetTemplate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplate - - cloneSetTemplate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplate - - deploymentTemplate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateDeploymentTemplate - - statefulSetTemplate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateStatefulSetTemplate - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplate: - """ AdvancedStatefulSet template - - Attributes - ---------- - metadata : any, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpec, default is Undefined, required - spec - """ - - metadata?: any - - spec: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpec - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpec: - """ StatefulSetSpec defines the desired state of StatefulSet - - Attributes - ---------- - podManagementPolicy : str, default is Undefined, 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. - replicas : int, default is Undefined, optional - replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. TODO: Consider a rename of this field. - revisionHistoryLimit : int, default is Undefined, optional - revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. - serviceName : str, default is Undefined, optional - serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller. - template : any, default is Undefined, required - template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. - volumeClaimTemplates : [any], default is Undefined, optional - volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. TODO: Define the behavior if a claim already exists with the same name. - selector : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecSelector, default is Undefined, required - selector - updateStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - podManagementPolicy?: str - - replicas?: int - - revisionHistoryLimit?: int - - serviceName?: str - - template: any - - volumeClaimTemplates?: [any] - - selector: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecSelector - - updateStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategy - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecSelector: - """ selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategy: - """ updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate. - rollingUpdate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdate, default is Undefined, optional - rolling update - """ - - $type?: str - - rollingUpdate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdate - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdate: - """ RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - - Attributes - ---------- - maxUnavailable : int, default is Undefined, optional - 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. Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy. Defaults to 1. - minReadySeconds : int, default is Undefined, optional - MinReadySeconds indicates how long will the pod be considered ready after it's updated. MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy. It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady. Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy. Default value is 0, max is 300. - partition : int, default is Undefined, optional - Partition indicates the ordinal at which the StatefulSet should be partitioned by default. But if unorderedUpdate has been set: - Partition indicates the number of pods with non-updated revisions when rolling update. - It means controller will update $(replicas - partition) number of pod. Default value is 0. - paused : bool, default is Undefined, optional - Paused indicates that the StatefulSet is paused. Default value is false - podUpdatePolicy : str, default is Undefined, optional - PodUpdatePolicy indicates how pods should be updated Default value is "ReCreate" - inPlaceUpdateStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy, default is Undefined, optional - in place update strategy - unorderedUpdate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdate, default is Undefined, optional - unordered update - """ - - maxUnavailable?: int - - minReadySeconds?: int - - partition?: int - - paused?: bool - - podUpdatePolicy?: str - - inPlaceUpdateStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy - - unorderedUpdate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdate - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy: - """ InPlaceUpdateStrategy contains strategies for in-place update. - - Attributes - ---------- - gracePeriodSeconds : int, default is Undefined, optional - GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec when in-place update a Pod. - """ - - gracePeriodSeconds?: int - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdate: - """ UnorderedUpdate contains strategies for non-ordered update. If it is not nil, pods will be updated with non-ordered sequence. Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy - - Attributes - ---------- - priorityStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy, default is Undefined, optional - priority strategy - """ - - priorityStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy: - """ Priorities are the rules for calculating the priority of updating pods. Each pod to be updated, will pass through these terms and get a sum of weights. - - Attributes - ---------- - orderPriority : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0], default is Undefined, optional - Order priority terms, pods will be sorted by the value of orderedKey. For example: ``` orderPriority: - orderedKey: key1 - orderedKey: key2 ``` First, all pods which have key1 in labels will be sorted by the value of key1. Then, the left pods which have no key1 but have key2 in labels will be sorted by the value of key2 and put behind those pods have key1. - weightPriority : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0], default is Undefined, optional - Weight priority terms, pods will be sorted by the sum of all terms weight. - """ - - orderPriority?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0] - - weightPriority?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0: - """ UpdatePriorityOrder defines order priority. - - Attributes - ---------- - orderedKey : str, default is Undefined, required - Calculate priority by value of this key. Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value, such as getting 5 in value '5', getting 10 in value 'sts-10'. - """ - - orderedKey: str - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0: - """ UpdatePriorityWeightTerm defines weight priority. - - Attributes - ---------- - matchSelector : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector, default is Undefined, required - match selector - weight : int, default is Undefined, required - Weight associated with matching the corresponding matchExpressions, in the range 1-100. - """ - - matchSelector: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector - - weight: int - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector: - """ MatchSelector is used to select by pod's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateAdvancedStatefulSetTemplateSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplate: - """ CloneSet template - - Attributes - ---------- - metadata : any, default is Undefined, optional - metadata - spec : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpec, default is Undefined, required - spec - """ - - metadata?: any - - spec: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpec - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpec: - """ CloneSetSpec defines the desired state of CloneSet - - Attributes - ---------- - minReadySeconds : int, default is Undefined, 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 : int, default is Undefined, optional - Replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template. If unspecified, defaults to 1. - revisionHistoryLimit : int, default is Undefined, optional - RevisionHistoryLimit is the maximum number of revisions that will be maintained in the CloneSet's revision history. The revision history consists of all revisions not represented by a currently applied CloneSetSpec version. The default value is 10. - template : any, default is Undefined, required - Template describes the pods that will be created. - volumeClaimTemplates : [any], default is Undefined, optional - VolumeClaimTemplates is a list of claims that pods are allowed to reference. Note that PVC will be deleted when its pod has been deleted. - lifecycle : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecycle, default is Undefined, optional - lifecycle - scaleStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecScaleStrategy, default is Undefined, optional - scale strategy - selector : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecSelector, default is Undefined, required - selector - updateStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - minReadySeconds?: int - - replicas?: int - - revisionHistoryLimit?: int - - template: any - - volumeClaimTemplates?: [any] - - lifecycle?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecycle - - scaleStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecScaleStrategy - - selector: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecSelector - - updateStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategy - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecycle: - """ Lifecycle defines the lifecycle hooks for Pods pre-delete, in-place update. - - Attributes - ---------- - inPlaceUpdate : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecycleInPlaceUpdate, default is Undefined, optional - in place update - preDelete : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecyclePreDelete, default is Undefined, optional - pre delete - """ - - inPlaceUpdate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecycleInPlaceUpdate - - preDelete?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecyclePreDelete - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecycleInPlaceUpdate: - """ InPlaceUpdate is the hook before Pod to update and after Pod has been updated. - - Attributes - ---------- - finalizersHandler : [str], default is Undefined, optional - finalizers handler - labelsHandler : {str:str}, default is Undefined, optional - labels handler - """ - - finalizersHandler?: [str] - - labelsHandler?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecLifecyclePreDelete: - """ PreDelete is the hook before Pod to be deleted. - - Attributes - ---------- - finalizersHandler : [str], default is Undefined, optional - finalizers handler - labelsHandler : {str:str}, default is Undefined, optional - labels handler - """ - - finalizersHandler?: [str] - - labelsHandler?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecScaleStrategy: - """ ScaleStrategy indicates the ScaleStrategy that will be employed to create and delete Pods in the CloneSet. - - Attributes - ---------- - podsToDelete : [str], default is Undefined, optional - PodsToDelete is the names of Pod should be deleted. Note that this list will be truncated for non-existing pod names. - """ - - podsToDelete?: [str] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecSelector: - """ Selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategy: - """ UpdateStrategy indicates the UpdateStrategy that will be employed to update Pods in the CloneSet when a revision is made to Template. - - Attributes - ---------- - maxSurge : int, default is Undefined, optional - The maximum number of pods that can be scheduled above the desired replicas during update or specified delete. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. Defaults to 0. - maxUnavailable : int, default is Undefined, optional - The maximum number of pods that can be unavailable during update or scale. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up by default. When maxSurge > 0, absolute number is calculated from percentage by rounding down. Defaults to 20%. - partition : int, default is Undefined, optional - Partition is the desired number of pods in old revisions. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up by default. It means when partition is set during pods updating, (replicas - partition value) number of pods will be updated. Default value is 0. - paused : bool, default is Undefined, optional - Paused indicates that the CloneSet is paused. Default value is false - scatterStrategy : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyScatterStrategyItems0], default is Undefined, optional - ScatterStrategy defines the scatter rules to make pods been scattered when update. This will avoid pods with the same key-value to be updated in one batch. - Note that pods will be scattered after priority sort. So, although priority strategy and scatter strategy can be applied together, we suggest to use either one of them. - If scatterStrategy is used, we suggest to just use one term. Otherwise, the update order can be hard to understand. - $type : str, default is Undefined, optional - Type indicates the type of the CloneSetUpdateStrategy. Default is ReCreate. - inPlaceUpdateStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyInPlaceUpdateStrategy, default is Undefined, optional - in place update strategy - priorityStrategy : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategy, default is Undefined, optional - priority strategy - """ - - maxSurge?: int - - maxUnavailable?: int - - partition?: int - - paused?: bool - - scatterStrategy?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyScatterStrategyItems0] - - $type?: str - - inPlaceUpdateStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyInPlaceUpdateStrategy - - priorityStrategy?: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategy - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyInPlaceUpdateStrategy: - """ InPlaceUpdateStrategy contains strategies for in-place update. - - Attributes - ---------- - gracePeriodSeconds : int, default is Undefined, optional - GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec when in-place update a Pod. - """ - - gracePeriodSeconds?: int - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategy: - """ Priorities are the rules for calculating the priority of updating pods. Each pod to be updated, will pass through these terms and get a sum of weights. - - Attributes - ---------- - orderPriority : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyOrderPriorityItems0], default is Undefined, optional - Order priority terms, pods will be sorted by the value of orderedKey. For example: ``` orderPriority: - orderedKey: key1 - orderedKey: key2 ``` First, all pods which have key1 in labels will be sorted by the value of key1. Then, the left pods which have no key1 but have key2 in labels will be sorted by the value of key2 and put behind those pods have key1. - weightPriority : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0], default is Undefined, optional - Weight priority terms, pods will be sorted by the sum of all terms weight. - """ - - orderPriority?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyOrderPriorityItems0] - - weightPriority?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyOrderPriorityItems0: - """ UpdatePriorityOrder defines order priority. - - Attributes - ---------- - orderedKey : str, default is Undefined, required - Calculate priority by value of this key. Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value, such as getting 5 in value '5', getting 10 in value 'sts-10'. - """ - - orderedKey: str - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0: - """ UpdatePriorityWeightTerm defines weight priority. - - Attributes - ---------- - matchSelector : AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelector, default is Undefined, required - match selector - weight : int, default is Undefined, required - Weight associated with matching the corresponding matchExpressions, in the range 1-100. - """ - - matchSelector: AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelector - - weight: int - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelector: - """ MatchSelector is used to select by pod's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyPriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateCloneSetTemplateSpecUpdateStrategyScatterStrategyItems0: - """apps kruise io v1alpha1 united deployment spec template clone set template spec update strategy scatter strategy items0 - - Attributes - ---------- - key : str, default is Undefined, required - key - value : str, default is Undefined, required - value - """ - - key: str - - value: str - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateDeploymentTemplate: - """ Deployment template - - Attributes - ---------- - metadata : any, default is Undefined, optional - metadata - spec : any, default is Undefined, required - DeploymentSpec is the specification of the desired behavior of the Deployment. - """ - - metadata?: any - - spec: any - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTemplateStatefulSetTemplate: - """ StatefulSet template - - Attributes - ---------- - metadata : any, default is Undefined, optional - metadata - spec : any, default is Undefined, required - A StatefulSetSpec is the specification of a StatefulSet. - """ - - metadata?: any - - spec: any - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTopology: - """ Topology describes the pods distribution detail between each of subsets. - - Attributes - ---------- - subsets : [AppsKruiseIoV1alpha1UnitedDeploymentSpecTopologySubsetsItems0], default is Undefined, optional - Contains the details of each subset. Each element in this array represents one subset which will be provisioned and managed by UnitedDeployment. - """ - - subsets?: [AppsKruiseIoV1alpha1UnitedDeploymentSpecTopologySubsetsItems0] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecTopologySubsetsItems0: - """ Subset defines the detail of a subset. - - Attributes - ---------- - name : str, default is Undefined, required - Indicates subset name as a DNS_LABEL, which will be used to generate subset workload name prefix in the format '--'. Name should be unique between all of the subsets under one UnitedDeployment. - nodeSelectorTerm : any, default is Undefined, optional - Indicates the node selector to form the subset. Depending on the node selector, pods provisioned could be distributed across multiple groups of nodes. A subset's nodeSelectorTerm is not allowed to be updated. - replicas : int, default is Undefined, optional - Indicates the number of the pod to be created under this subset. Replicas could also be percentage like '10%', which means 10% of UnitedDeployment replicas of pods will be distributed under this subset. If nil, the number of replicas in this subset is determined by controller. Controller will try to keep all the subsets with nil replicas have average pods. - tolerations : [any], default is Undefined, optional - Indicates the tolerations the pods under this subset have. A subset's tolerations is not allowed to be updated. - """ - - name: str - - nodeSelectorTerm?: any - - replicas?: int - - tolerations?: [any] - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecUpdateStrategy: - """ UpdateStrategy indicates the strategy the UnitedDeployment use to preform the update, when template is changed. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type of UnitedDeployment update strategy. Default is Manual. - manualUpdate : AppsKruiseIoV1alpha1UnitedDeploymentSpecUpdateStrategyManualUpdate, default is Undefined, optional - manual update - """ - - $type?: str - - manualUpdate?: AppsKruiseIoV1alpha1UnitedDeploymentSpecUpdateStrategyManualUpdate - -schema AppsKruiseIoV1alpha1UnitedDeploymentSpecUpdateStrategyManualUpdate: - """ Includes all of the parameters a Manual update strategy needs. - - Attributes - ---------- - partitions : {str:int}, default is Undefined, optional - Indicates number of subset partition. - """ - - partitions?: {str:int} - -schema AppsKruiseIoV1alpha1UnitedDeploymentStatus: - """ UnitedDeploymentStatus defines the observed state of UnitedDeployment. - - Attributes - ---------- - collisionCount : int, default is Undefined, optional - Count of hash collisions for the UnitedDeployment. The UnitedDeployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. - conditions : [AppsKruiseIoV1alpha1UnitedDeploymentStatusConditionsItems0], default is Undefined, optional - Represents the latest available observations of a UnitedDeployment's current state. - currentRevision : str, default is Undefined, required - CurrentRevision, if not empty, indicates the current version of the UnitedDeployment. - observedGeneration : int, default is Undefined, optional - ObservedGeneration is the most recent generation observed for this UnitedDeployment. It corresponds to the UnitedDeployment's generation, which is updated on mutation by the API Server. - readyReplicas : int, default is Undefined, optional - The number of ready replicas. - replicas : int, default is Undefined, required - Replicas is the most recently observed number of replicas. - subsetReplicas : {str:int}, default is Undefined, optional - Records the topology detail information of the replicas of each subset. - updatedReadyReplicas : int, default is Undefined, optional - The number of ready current revision replicas for this UnitedDeployment. - updatedReplicas : int, default is Undefined, required - The number of pods in current version. - updateStatus : AppsKruiseIoV1alpha1UnitedDeploymentStatusUpdateStatus, default is Undefined, optional - update status - """ - - collisionCount?: int - - conditions?: [AppsKruiseIoV1alpha1UnitedDeploymentStatusConditionsItems0] - - currentRevision: str - - observedGeneration?: int - - readyReplicas?: int - - replicas: int - - subsetReplicas?: {str:int} - - updatedReadyReplicas?: int - - updatedReplicas: int - - updateStatus?: AppsKruiseIoV1alpha1UnitedDeploymentStatusUpdateStatus - -schema AppsKruiseIoV1alpha1UnitedDeploymentStatusConditionsItems0: - """ UnitedDeploymentCondition describes current state of a UnitedDeployment. - - Attributes - ---------- - lastTransitionTime : str, default is Undefined, optional - Last time the condition transitioned from one status to another. - message : str, default is Undefined, optional - A human readable message indicating details about the transition. - reason : str, default is Undefined, optional - The reason for the condition's last transition. - status : str, default is Undefined, optional - Status of the condition, one of True, False, Unknown. - $type : str, default is Undefined, optional - Type of in place set condition. - """ - - lastTransitionTime?: str - - message?: str - - reason?: str - - status?: str - - $type?: str - -schema AppsKruiseIoV1alpha1UnitedDeploymentStatusUpdateStatus: - """ Records the information of update progress. - - Attributes - ---------- - currentPartitions : {str:int}, default is Undefined, optional - Records the current partition. - updatedRevision : str, default is Undefined, optional - Records the latest revision. - """ - - currentPartitions?: {str:int} - - updatedRevision?: str diff --git a/base/pkg/kusion_openkruise/apps/v1beta1/apps_kruise_io_v1beta1_stateful_set.k b/base/pkg/kusion_openkruise/apps/v1beta1/apps_kruise_io_v1beta1_stateful_set.k deleted file mode 100644 index a954ad31..00000000 --- a/base/pkg/kusion_openkruise/apps/v1beta1/apps_kruise_io_v1beta1_stateful_set.k +++ /dev/null @@ -1,307 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - -schema StatefulSet: - """ StatefulSet is the Schema for the statefulsets API - - Attributes - ---------- - __settings__ : {str:str}, default is {"output_type": "STANDALONE"}, optional - existence of this attribute indicates that the model will be treated standalone by KCLVM. - apiVersion : str, default is "apps.kruise.io/v1beta1", required - 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 - kind : str, default is "StatefulSet", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AppsKruiseIoV1beta1StatefulSetSpec, default is Undefined, optional - spec - status : AppsKruiseIoV1beta1StatefulSetStatus, default is Undefined, optional - status - """ - - __settings__?: {str:str} = {"output_type": "STANDALONE"} - - apiVersion: "apps.kruise.io/v1beta1" = "apps.kruise.io/v1beta1" - - kind: "StatefulSet" = "StatefulSet" - - metadata?: apis.ObjectMeta - - spec?: AppsKruiseIoV1beta1StatefulSetSpec - - status?: AppsKruiseIoV1beta1StatefulSetStatus - -schema AppsKruiseIoV1beta1StatefulSetSpec: - """ StatefulSetSpec defines the desired state of StatefulSet - - Attributes - ---------- - podManagementPolicy : str, default is Undefined, 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. - replicas : int, default is Undefined, optional - replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. TODO: Consider a rename of this field. - revisionHistoryLimit : int, default is Undefined, optional - revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. - serviceName : str, default is Undefined, optional - serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller. - template : any, default is Undefined, required - template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. - volumeClaimTemplates : [any], default is Undefined, optional - volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. TODO: Define the behavior if a claim already exists with the same name. - selector : AppsKruiseIoV1beta1StatefulSetSpecSelector, default is Undefined, required - selector - updateStrategy : AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategy, default is Undefined, optional - update strategy - """ - - podManagementPolicy?: str - - replicas?: int - - revisionHistoryLimit?: int - - serviceName?: str - - template: any - - volumeClaimTemplates?: [any] - - selector: AppsKruiseIoV1beta1StatefulSetSpecSelector - - updateStrategy?: AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategy - -schema AppsKruiseIoV1beta1StatefulSetSpecSelector: - """ selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1beta1StatefulSetSpecSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1beta1StatefulSetSpecSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1beta1StatefulSetSpecSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategy: - """ updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. - - Attributes - ---------- - $type : str, default is Undefined, optional - Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate. - rollingUpdate : AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdate, default is Undefined, optional - rolling update - """ - - $type?: str - - rollingUpdate?: AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdate - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdate: - """ RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - - Attributes - ---------- - maxUnavailable : int, default is Undefined, optional - 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. Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy. Defaults to 1. - minReadySeconds : int, default is Undefined, optional - MinReadySeconds indicates how long will the pod be considered ready after it's updated. MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy. It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady. Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy. Default value is 0, max is 300. - partition : int, default is Undefined, optional - Partition indicates the ordinal at which the StatefulSet should be partitioned by default. But if unorderedUpdate has been set: - Partition indicates the number of pods with non-updated revisions when rolling update. - It means controller will update $(replicas - partition) number of pod. Default value is 0. - paused : bool, default is Undefined, optional - Paused indicates that the StatefulSet is paused. Default value is false - podUpdatePolicy : str, default is Undefined, optional - PodUpdatePolicy indicates how pods should be updated Default value is "ReCreate" - inPlaceUpdateStrategy : AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy, default is Undefined, optional - in place update strategy - unorderedUpdate : AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdate, default is Undefined, optional - unordered update - """ - - maxUnavailable?: int - - minReadySeconds?: int - - partition?: int - - paused?: bool - - podUpdatePolicy?: str - - inPlaceUpdateStrategy?: AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy - - unorderedUpdate?: AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdate - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateInPlaceUpdateStrategy: - """ InPlaceUpdateStrategy contains strategies for in-place update. - - Attributes - ---------- - gracePeriodSeconds : int, default is Undefined, optional - GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec when in-place update a Pod. - """ - - gracePeriodSeconds?: int - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdate: - """ UnorderedUpdate contains strategies for non-ordered update. If it is not nil, pods will be updated with non-ordered sequence. Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy - - Attributes - ---------- - priorityStrategy : AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy, default is Undefined, optional - priority strategy - """ - - priorityStrategy?: AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategy: - """ Priorities are the rules for calculating the priority of updating pods. Each pod to be updated, will pass through these terms and get a sum of weights. - - Attributes - ---------- - orderPriority : [AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0], default is Undefined, optional - Order priority terms, pods will be sorted by the value of orderedKey. For example: ``` orderPriority: - orderedKey: key1 - orderedKey: key2 ``` First, all pods which have key1 in labels will be sorted by the value of key1. Then, the left pods which have no key1 but have key2 in labels will be sorted by the value of key2 and put behind those pods have key1. - weightPriority : [AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0], default is Undefined, optional - Weight priority terms, pods will be sorted by the sum of all terms weight. - """ - - orderPriority?: [AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0] - - weightPriority?: [AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0] - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyOrderPriorityItems0: - """ UpdatePriorityOrder defines order priority. - - Attributes - ---------- - orderedKey : str, default is Undefined, required - Calculate priority by value of this key. Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value, such as getting 5 in value '5', getting 10 in value 'sts-10'. - """ - - orderedKey: str - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0: - """ UpdatePriorityWeightTerm defines weight priority. - - Attributes - ---------- - matchSelector : AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector, default is Undefined, required - match selector - weight : int, default is Undefined, required - Weight associated with matching the corresponding matchExpressions, in the range 1-100. - """ - - matchSelector: AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector - - weight: int - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelector: - """ MatchSelector is used to select by pod's labels. - - Attributes - ---------- - matchExpressions : [AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0], default is Undefined, optional - matchExpressions is a list of label selector requirements. The requirements are ANDed. - matchLabels : {str:str}, default is Undefined, optional - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - """ - - matchExpressions?: [AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0] - - matchLabels?: {str:str} - -schema AppsKruiseIoV1beta1StatefulSetSpecUpdateStrategyRollingUpdateUnorderedUpdatePriorityStrategyWeightPriorityItems0MatchSelectorMatchExpressionsItems0: - """ A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - - Attributes - ---------- - key : str, default is Undefined, required - key is the label key that the selector applies to. - operator : str, default is Undefined, required - operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - values : [str], default is Undefined, optional - values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - """ - - key: str - - operator: str - - values?: [str] - -schema AppsKruiseIoV1beta1StatefulSetStatus: - """ StatefulSetStatus defines the observed state of StatefulSet - - Attributes - ---------- - availableReplicas : int, default is Undefined, required - AvailableReplicas is the number of Pods created by the StatefulSet controller that have been ready for minReadySeconds. - collisionCount : int, default is Undefined, optional - collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. - conditions : [any], default is Undefined, optional - Represents the latest available observations of a statefulset's current state. - currentReplicas : int, default is Undefined, required - currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision. - currentRevision : str, default is Undefined, optional - currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas). - labelSelector : str, default is Undefined, optional - LabelSelector is label selectors for query over pods that should match the replica count used by HPA. - observedGeneration : int, default is Undefined, optional - observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet's generation, which is updated on mutation by the API Server. - readyReplicas : int, default is Undefined, required - readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition. - replicas : int, default is Undefined, required - replicas is the number of Pods created by the StatefulSet controller. - updateRevision : str, default is Undefined, optional - updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas) - updatedReplicas : int, default is Undefined, required - updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision. - """ - - availableReplicas: int - - collisionCount?: int - - conditions?: [any] - - currentReplicas: int - - currentRevision?: str - - labelSelector?: str - - observedGeneration?: int - - readyReplicas: int - - replicas: int - - updateRevision?: str - - updatedReplicas: int diff --git a/base/pkg/kusion_prometheus/mixins/monitor_mixin.k b/base/pkg/kusion_prometheus/mixins/monitor_mixin.k deleted file mode 100644 index 09cced5c..00000000 --- a/base/pkg/kusion_prometheus/mixins/monitor_mixin.k +++ /dev/null @@ -1,50 +0,0 @@ -import base.pkg.kusion_models.kube.metadata -import base.pkg.kusion_models.kube.protocol -import base.pkg.kusion_models.kube.resource -import base.pkg.kusion_models.kube.utils -import base.pkg.kusion_prometheus.monitoring.v1 as monitoringv1 - -mixin MonitorMixin for protocol.ServerProtocol: - # enable prometheus monitoring - if config.enableMonitoring: - # generate ServiceMonitor if service is configured - if config.services: - kubernetes: resource.ResourceMapping { - ServiceMonitor = [ - monitoringv1.ServiceMonitor { - metadata: utils.MetadataBuilder(_s) | { - name = _s?.name or "{}-{}-{}".format(metadata.__META_APP_NAME, metadata.__META_ENV_TYPE_NAME, _i) - } - spec.selector.matchLabels = _s?.selector or workloadAttributes?.spec?.selector?.matchLabels - # set endpoints with ServicePort - spec.endpoints = [ - { - if p.name: - port = p.name - else: - targetPort = p.port - } for p in _s?.ports - ] - } for _i, _s in config.services - ] - } - # else use PodMointor - else: - kubernetes: resource.ResourceMapping { - PodMonitor = [ - monitoringv1.PodMonitor { - metadata = workloadAttributes.metadata - metadata.labels: workloadAttributes.spec.template.metadata.labels - spec.selector.matchLabels = workloadAttributes.spec.selector.matchLabels - # set endpoints with containerPort - spec.podMetricsEndpoints = [ - { - if p.name: - port = p.name - else: - targetPort = p.containerPort - } for p in mainContainer.ports - ] - } - ] - } diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k b/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k deleted file mode 100644 index a413fd8e..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k +++ /dev/null @@ -1,18 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AlertingSpec: - """ Define details regarding alerting. - - Attributes - ---------- - alertmanagers : [AlertmanagerEndpoints], default is Undefined, required - AlertmanagerEndpoints Prometheus should fire alerts against. - """ - - - alertmanagers: [AlertmanagerEndpoints] - \ No newline at end of file diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k deleted file mode 100644 index 34eab9f5..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k +++ /dev/null @@ -1,36 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis - - -schema Alertmanager: - """ Alertmanager describes an Alertmanager cluster. - - Attributes - ---------- - apiVersion : str, default is "monitoring.coreos.com/v1", required - 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 - kind : str, default is "Alertmanager", required - 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 - metadata : apis.ObjectMeta, default is Undefined, optional - metadata - spec : AlertmanagerSpec, default is Undefined, required - spec - status : AlertmanagerStatus, default is Undefined, optional - status - """ - - - __settings__?: {str:str} = {"output_type": "IGNORE"} - - apiVersion: "monitoring.coreos.com/v1" = "monitoring.coreos.com/v1" - - kind: "Alertmanager" = "Alertmanager" - - metadata?: apis.ObjectMeta - - spec: AlertmanagerSpec - - status?: AlertmanagerStatus diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k deleted file mode 100644 index ebd74f79..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k +++ /dev/null @@ -1,25 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AlertmanagerConfiguration: - """ EXPERIMENTAL: alertmanagerConfiguration specifies the configuration of Alertmanager. If defined, it takes precedence over the `configSecret` field. This field may change in future releases. - - Attributes - ---------- - name : str, default is Undefined, required - The name of the AlertmanagerConfig resource which is used to generate the Alertmanager configuration. It must be defined in the same namespace as the Alertmanager object. The operator will not enforce a `namespace` label for routes and inhibition rules. - templates : [SecretOrConfigMap], default is Undefined, optional - Custom notification templates. - global : AlertmanagerGlobalConfig, default is Undefined, optional - global - """ - - - name: str - - templates?: [SecretOrConfigMap] - - global?: AlertmanagerGlobalConfig diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k deleted file mode 100644 index ae3d2795..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k +++ /dev/null @@ -1,58 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import regex - - -schema AlertmanagerEndpoints: - """ AlertmanagerEndpoints defines a selection of a single Endpoints object containing alertmanager IPs to fire alerts against. - - Attributes - ---------- - apiVersion : str, default is Undefined, optional - Version of the Alertmanager API that Prometheus uses to send alerts. It can be "v1" or "v2". - authorization : SafeAuthorization, default is Undefined, optional - authorization - bearerTokenFile : str, default is Undefined, optional - BearerTokenFile to read from filesystem to use when authenticating to Alertmanager. - name : str, default is Undefined, required - Name of Endpoints object in Namespace. - namespace : str, default is Undefined, required - Namespace of Endpoints object. - pathPrefix : str, default is Undefined, optional - Prefix for the HTTP path alerts are pushed to. - port : int or str, default is Undefined, required - Port the Alertmanager API is exposed on. - scheme : str, default is Undefined, optional - Scheme to use when firing alerts. - timeout : str, default is Undefined, optional - Timeout is a per-target Alertmanager timeout when pushing alerts. - tlsConfig : TLSConfig, default is Undefined, optional - tls config - """ - - - apiVersion?: str - - authorization?: SafeAuthorization - - bearerTokenFile?: str - - name: str - - namespace: str - - pathPrefix?: str - - port: int | str - - scheme?: str - - timeout?: str - - tlsConfig?: TLSConfig - - - check: - regex.match(timeout, r"^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$") if timeout diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k deleted file mode 100644 index faa2d2c6..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k +++ /dev/null @@ -1,26 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import regex - - -schema AlertmanagerGlobalConfig: - """ Defines the global parameters of the Alertmanager configuration. - - Attributes - ---------- - resolveTimeout : str, default is Undefined, optional - ResolveTimeout is the default value used by alertmanager if the alert does not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt. - httpConfig : HTTPConfig, default is Undefined, optional - http config - """ - - - resolveTimeout?: str - - httpConfig?: HTTPConfig - - - check: - regex.match(resolveTimeout, r"^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$") if resolveTimeout diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k deleted file mode 100644 index e7edff7e..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k +++ /dev/null @@ -1,201 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 -import regex - - -schema AlertmanagerSpec: - """ Specification of the desired behavior of the Alertmanager cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - - Attributes - ---------- - additionalPeers : [str], default is Undefined, optional - AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster. - baseImage : str, default is Undefined, optional - Base image that is used to deploy pods, without tag. Deprecated: use 'image' instead - clusterAdvertiseAddress : str, default is Undefined, optional - ClusterAdvertiseAddress is the explicit address to advertise in cluster. Needs to be provided for non RFC1918 [1] (public) addresses. [1] RFC1918: https://tools.ietf.org/html/rfc1918 - clusterGossipInterval : str, default is Undefined, optional - Interval between gossip attempts. - clusterPeerTimeout : str, default is Undefined, optional - Timeout for cluster peering. - clusterPushpullInterval : str, default is Undefined, optional - Interval between pushpull attempts. - configMaps : [str], default is Undefined, optional - ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. The ConfigMaps are mounted into /etc/alertmanager/configmaps/ in the 'alertmanager' container. - configSecret : str, default is Undefined, optional - ConfigSecret is the name of a Kubernetes Secret in the same namespace as the Alertmanager object, which contains the configuration for this Alertmanager instance. If empty, it defaults to 'alertmanager-'. - The Alertmanager configuration should be available under the `alertmanager.yaml` key. Additional keys from the original secret are copied to the generated secret. - If either the secret or the `alertmanager.yaml` key is missing, the operator provisions an Alertmanager configuration with one empty receiver (effectively dropping alert notifications). - containers : [v1.Container], default is Undefined, optional - Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to an Alertmanager pod. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `alertmanager` and `config-reloader`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - externalUrl : str, default is Undefined, optional - The external URL the Alertmanager instances will be available under. This is necessary to generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name. - forceEnableClusterMode : bool, default is Undefined, optional - ForceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica. Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each. - hostAliases : [HostAlias], default is Undefined, optional - Pods' hostAliases configuration - image : str, default is Undefined, optional - Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Alertmanager is being configured. - imagePullSecrets : [v1.LocalObjectReference], default is Undefined, optional - An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod - initContainers : [v1.Container], default is Undefined, optional - InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Alertmanager configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - listenLocal : bool, default is Undefined, optional - ListenLocal makes the Alertmanager server listen on loopback, so that it does not bind against the Pod IP. Note this is only for the Alertmanager UI, not the gossip communication. - logFormat : str, default is Undefined, optional - Log format for Alertmanager to be configured with. - logLevel : str, default is Undefined, optional - Log level for Alertmanager to be configured with. - minReadySeconds : int, default is Undefined, 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) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. - nodeSelector : {str:str}, default is Undefined, optional - Define which Nodes the Pods are scheduled on. - paused : bool, default is Undefined, optional - If set to true all actions on the underlying managed objects are not goint to be performed, except for delete actions. - portName : str, default is Undefined, optional - Port name used for the pods and governing service. This defaults to web - priorityClassName : str, default is Undefined, optional - Priority class assigned to the Pods - replicas : int, default is Undefined, optional - Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size. - retention : str, default is "120h", optional - Time duration Alertmanager shall retain data for. Default is '120h', and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours). - routePrefix : str, default is Undefined, optional - The route prefix Alertmanager registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. - secrets : [str], default is Undefined, optional - Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-`. The Secrets are mounted into /etc/alertmanager/secrets/ in the 'alertmanager' container. - serviceAccountName : str, default is Undefined, optional - ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. - sha : str, default is Undefined, optional - SHA of Alertmanager container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set. Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. - tag : str, default is Undefined, optional - Tag of Alertmanager container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set. Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. - tolerations : [v1.Toleration], default is Undefined, optional - If specified, the pod's tolerations. - topologySpreadConstraints : [v1.TopologySpreadConstraint], default is Undefined, optional - If specified, the pod's topology spread constraints. - version : str, default is Undefined, optional - Version the cluster should be on. - volumeMounts : [v1.VolumeMount], default is Undefined, optional - VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container, that are generated as a result of StorageSpec objects. - volumes : [v1.Volume], default is Undefined, optional - Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. - affinity : v1.Affinity, default is Undefined, optional - affinity - alertmanagerConfigNamespaceSelector : apis.LabelSelector, default is Undefined, optional - alertmanager config namespace selector - alertmanagerConfigSelector : apis.LabelSelector, default is Undefined, optional - alertmanager config selector - alertmanagerConfiguration : AlertmanagerConfiguration, default is Undefined, optional - alertmanager configuration - podMetadata : EmbeddedObjectMetadata, default is Undefined, optional - pod metadata - resources : v1.ResourceRequirements, default is Undefined, optional - resources - securityContext : v1.PodSecurityContext, default is Undefined, optional - security context - storage : StorageSpec, default is Undefined, optional - storage - web : AlertmanagerWebSpec, default is Undefined, optional - web - """ - - - additionalPeers?: [str] - - baseImage?: str - - clusterAdvertiseAddress?: str - - clusterGossipInterval?: str - - clusterPeerTimeout?: str - - clusterPushpullInterval?: str - - configMaps?: [str] - - configSecret?: str - - containers?: [v1.Container] - - externalUrl?: str - - forceEnableClusterMode?: bool - - hostAliases?: [HostAlias] - - image?: str - - imagePullSecrets?: [v1.LocalObjectReference] - - initContainers?: [v1.Container] - - listenLocal?: bool - - logFormat?: "" | "logfmt" | "json" - - logLevel?: "" | "debug" | "info" | "warn" | "error" - - minReadySeconds?: int - - nodeSelector?: {str:str} - - paused?: bool - - portName?: str - - priorityClassName?: str - - replicas?: int - - retention?: str = "120h" - - routePrefix?: str - - secrets?: [str] - - serviceAccountName?: str - - sha?: str - - tag?: str - - tolerations?: [v1.Toleration] - - topologySpreadConstraints?: [v1.TopologySpreadConstraint] - - version?: str - - volumeMounts?: [v1.VolumeMount] - - volumes?: [v1.Volume] - - affinity?: v1.Affinity - - alertmanagerConfigNamespaceSelector?: apis.LabelSelector - - alertmanagerConfigSelector?: apis.LabelSelector - - alertmanagerConfiguration?: AlertmanagerConfiguration - - podMetadata?: EmbeddedObjectMetadata - - resources?: v1.ResourceRequirements - - securityContext?: v1.PodSecurityContext - - storage?: StorageSpec - - web?: AlertmanagerWebSpec - - - check: - regex.match(clusterGossipInterval, r"^(0|(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$") if clusterGossipInterval - regex.match(clusterPeerTimeout, r"^(0|(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$") if clusterPeerTimeout - regex.match(clusterPushpullInterval, r"^(0|(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$") if clusterPushpullInterval - regex.match(retention, r"^(0|(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$") if retention diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k deleted file mode 100644 index d32b30a9..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k +++ /dev/null @@ -1,33 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AlertmanagerStatus: - """ Most recent observed status of the Alertmanager cluster. Read-only. Not included when requesting from the apiserver, only from the Prometheus Operator API itself. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - - Attributes - ---------- - availableReplicas : int, default is Undefined, required - Total number of available pods (ready for at least minReadySeconds) targeted by this Alertmanager cluster. - paused : bool, default is Undefined, required - Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed. - replicas : int, default is Undefined, required - Total number of non-terminated pods targeted by this Alertmanager cluster (their labels match the selector). - unavailableReplicas : int, default is Undefined, required - Total number of unavailable pods targeted by this Alertmanager cluster. - updatedReplicas : int, default is Undefined, required - Total number of non-terminated pods targeted by this Alertmanager cluster that have the desired version spec. - """ - - - availableReplicas: int - - paused: bool - - replicas: int - - unavailableReplicas: int - - updatedReplicas: int diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k deleted file mode 100644 index 0f597347..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k +++ /dev/null @@ -1,21 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AlertmanagerWebSpec: - """ Defines the web command line flags when starting Alertmanager. - - Attributes - ---------- - httpConfig : WebHTTPConfig, default is Undefined, optional - http config - tlsConfig : WebTLSConfig, default is Undefined, optional - tls config - """ - - - httpConfig?: WebHTTPConfig - - tlsConfig?: WebTLSConfig diff --git a/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k b/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k deleted file mode 100644 index 4b5b8096..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k +++ /dev/null @@ -1,38 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema APIServerConfig: - """ APIServerConfig allows specifying a host and auth methods to access apiserver. If left empty, Prometheus is assumed to run inside of the cluster and will discover API servers automatically and use the pod's CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/. - - Attributes - ---------- - bearerToken : str, default is Undefined, optional - Bearer token for accessing apiserver. - bearerTokenFile : str, default is Undefined, optional - File to read bearer token for accessing apiserver. - host : str, default is Undefined, required - Host of apiserver. A valid string consisting of a hostname or IP followed by an optional port number - authorization : Authorization, default is Undefined, optional - authorization - basicAuth : BasicAuth, default is Undefined, optional - basic auth - tlsConfig : TLSConfig, default is Undefined, optional - tls config - """ - - - bearerToken?: str - - bearerTokenFile?: str - - host: str - - authorization?: Authorization - - basicAuth?: BasicAuth - - tlsConfig?: TLSConfig - \ No newline at end of file diff --git a/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k b/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k deleted file mode 100644 index 7581e407..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k +++ /dev/null @@ -1,18 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema ArbitraryFSAccessThroughSMsConfig: - """ ArbitraryFSAccessThroughSMs configures whether configuration based on a service monitor can access arbitrary files on the file system of the Prometheus container e.g. bearer token files. - - Attributes - ---------- - deny : bool, default is Undefined, optional - deny - """ - - - deny?: bool - \ No newline at end of file diff --git a/base/pkg/kusion_prometheus/monitoring/v1/argument.k b/base/pkg/kusion_prometheus/monitoring/v1/argument.k deleted file mode 100644 index 81958ca8..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/argument.k +++ /dev/null @@ -1,26 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Argument: - """ Argument as part of the AdditionalArgs list. - - Attributes - ---------- - name : str, default is Undefined, required - Name of the argument, e.g. "scrape.discovery-reload-interval". - value : str, default is Undefined, optional - Argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile) - """ - - - name: str - - value?: str - - - check: - len(name) >= 1 - \ No newline at end of file diff --git a/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k b/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k deleted file mode 100644 index abf076d6..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k +++ /dev/null @@ -1,17 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema AttachMetadata: - """ Attaches node metadata to discovered targets. Only valid for role: pod. Only valid in Prometheus versions 2.35.0 and newer. - - Attributes - ---------- - node : bool, default is Undefined, optional - When set to true, Prometheus must have permissions to get Nodes. - """ - - - node?: bool diff --git a/base/pkg/kusion_prometheus/monitoring/v1/authorization.k b/base/pkg/kusion_prometheus/monitoring/v1/authorization.k deleted file mode 100644 index 3f86417f..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/authorization.k +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" - - -schema Authorization(SafeAuthorization): - """ Authorization section for remote write - - Attributes - ---------- - credentialsFile : str, default is Undefined, optional - File to read a secret from, mutually exclusive with Credentials (from SafeAuthorization) - """ - - credentialsFile?: str diff --git a/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k b/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k deleted file mode 100644 index 95b1309f..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k +++ /dev/null @@ -1,22 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.api.core.v1 - - -schema BasicAuth: - """ BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints - - Attributes - ---------- - password : v1.SecretKeySelector, default is Undefined, optional - password - username : v1.SecretKeySelector, default is Undefined, optional - username - """ - - - password?: v1.SecretKeySelector - - username?: v1.SecretKeySelector diff --git a/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k b/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k deleted file mode 100644 index 2c526ac7..00000000 --- a/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k +++ /dev/null @@ -1,271 +0,0 @@ -""" -This file was generated by the KCL auto-gen tool. DO NOT EDIT. -Editing this file might prove futile when you re-run the KCL auto-gen generate command. -""" -import base.pkg.kusion_kubernetes.apimachinery.apis -import base.pkg.kusion_kubernetes.api.core.v1 -import regex - - -schema CommonPrometheusFields: - """ CommonPrometheusFields are the options available to both the Prometheus server and agent. - - Attributes - ---------- - podMetadata : PodMetadata, default is Undefined, optional - pod metadata - serviceMonitorSelector : apis.LabelSelector, default is Undefined, optional - service monitor selector - serviceMonitorNamespaceSelector : apis.LabelSelector, default is Undefined, optional - service monitor namespace selector - podMonitorSelector : apis.LabelSelector, default is Undefined, optional - pod monitor selector - podMonitorNamespaceSelector : apis.LabelSelector, default is Undefined, optional - pod monitor namespace selector - probeNamespaceSelector : apis.LabelSelector, default is Undefined, optional - probe namespace selector - probeSelector : apis.LabelSelector, default is Undefined, optional - probe selector - version : str, default is Undefined, optional - Version of Prometheus to be deployed. - paused : bool, default is Undefined, optional - When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects. - image : str, default is Undefined, optional - Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Prometheus is being configured. - imagePullSecrets : [v1.LocalObjectReference], default is Undefined, optional - An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod - replicas : int, default is Undefined, optional - Number of replicas of each shard to deploy for a Prometheus deployment. Number of replicas multiplied by shards is the total number of Pods created. - shards : int, default is Undefined, optional - EXPERIMENTAL: Number of shards to distribute targets onto. Number of replicas multiplied by shards is the total number of Pods created. Note that scaling down shards will not reshard data onto remaining instances, it must be manually moved. Increasing shards will not reshard data either but it will continue to be available from the same instances. To query globally use Thanos sidecar and Thanos querier or remote write data to a central location. Sharding is done on the content of the `__address__` target meta-label. - replicaExternalLabelName : str, default is Undefined, optional - Name of Prometheus external label used to denote replica name. Defaults to the value of `prometheus_replica`. External label will _not_ be added when value is set to empty string (`""`). - prometheusExternalLabelName : str, default is Undefined, optional - Name of Prometheus external label used to denote Prometheus instance name. Defaults to the value of `prometheus`. External label will _not_ be added when value is set to empty string (`""`). - logFormat : str, default is Undefined, optional - Log format for Prometheus to be configured with. - logLevel : str, default is Undefined, optional - Log level for Prometheus to be configured with. - scrapeInterval : str, default is "30s", optional - Interval between consecutive scrapes. Default: `30s` - scrapeTimeout : str, default is Undefined, optional - Number of seconds to wait for target to respond before erroring. - externalLabels : {str:str}, default is Undefined, optional - The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager). - enableFeatures : [str], default is Undefined, optional - Enable access to Prometheus disabled features. By default, no features are enabled. Enabling disabled features is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. For more information see https://prometheus.io/docs/prometheus/latest/disabled_features/ - enableRemoteWriteReceiver : bool, default is Undefined, optional - Enable Prometheus to be used as a receiver for the Prometheus remote write protocol. Defaults to the value of `false`. WARNING: This is not considered an efficient way of ingesting samples. Use it with caution for specific low-volume use cases. It is not suitable for replacing the ingestion via scraping and turning Prometheus into a push-based metrics collection system. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver Only valid in Prometheus versions 2.33.0 and newer. - externalUrl : str, default is Undefined, optional - The external URL the Prometheus instances will be available under. This is necessary to generate correct URLs. This is necessary if Prometheus is not served from root of a DNS name. - routePrefix : str, default is Undefined, optional - The route prefix Prometheus registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. - storage : StorageSpec, default is Undefined, optional - Storage defines the configured storage for a group Prometheus servers. - volumeMounts : [v1.VolumeMount], default is Undefined, optional - VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the prometheus container, that are generated as a result of StorageSpec objects. - volumes : [v1.volumes], default is Undefined, optional - Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. - web : PrometheusWebSpec, default is Undefined, optional - web - resources : v1.ResourceRequirements, default is Undefined, optional - resources - nodeSelector : {str:str}, default is Undefined, optional - Define which Nodes the Pods are scheduled on. - serviceAccountName : str, default is Undefined, optional - ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. - secrets : [str], default is Undefined, optional - Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-`. The Secrets are mounted into /etc/prometheus/secrets/ in the 'prometheus' container. - configMaps : [str], default is Undefined, optional - ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. The ConfigMaps are mounted into /etc/prometheus/configmaps/ in the 'prometheus' container. - affinity : v1.Affinity, default is Undefined, optional - affinity - tolerations : [v1.Toleration], default is Undefined, optional - If specified, the pod's tolerations. - topologySpreadConstraints : [v1.TopologySpreadConstraint], default is Undefined, optional - If specified, the pod's topology spread constraints. - remoteWrite : [RemoteWriteSpec], default is Undefined, optional - remoteWrite is the list of remote write configurations. - securityContext : v1.PodSecurityContext, default is Undefined, optional - security context - listenLocal : bool, default is Undefined, optional - ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against the Pod IP. - initContainers : [v1.Container], default is Undefined, optional - InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Prometheus configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch. The current init container name is: `init-config-reloader`. Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - containers : [v1.Container], default is Undefined, optional - Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to a Prometheus pod or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `prometheus`, `config-reloader`, and `thanos-sidecar`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - additionalScrapeConfigs : v1.SecretKeySelector, default is Undefined, optional - additional scrape configs - apiserverConfig : APIServerConfig, default is Undefined, optional - apiserver config - portName : str, default is Undefined, optional - Port name used for the pods and governing service. This defaults to web - priorityClassName : str, default is Undefined, optional - Priority class assigned to the Pods - arbitraryFSAccessThroughSMs : ArbitraryFSAccessThroughSMsConfig, default is Undefined, optional - arbitrary f s access through s ms - overrideHonorLabels : bool, default is Undefined, optional - When true, Prometheus resolves label conflicts by renaming the labels in the scraped data to "exported_