diff --git a/.github/actions/exists/action.yaml b/.github/actions/exists/action.yaml index 7f9c6ddc..4f11f556 100644 --- a/.github/actions/exists/action.yaml +++ b/.github/actions/exists/action.yaml @@ -18,4 +18,4 @@ runs: - shell: bash id: check run: | - echo "result=${{ inputs.value != '' }}" >> $GITHUB_OUTPUT \ No newline at end of file + echo "result=${{ inputs.value != '' }}" >> $GITHUB_OUTPUT diff --git a/.github/actions/setup-caches/action.yaml b/.github/actions/setup-caches/action.yaml index 57fa6d3b..7b823de7 100644 --- a/.github/actions/setup-caches/action.yaml +++ b/.github/actions/setup-caches/action.yaml @@ -17,4 +17,4 @@ runs: if: ${{ inputs.build-cache-key }} with: path: ~/.cache/go-build - key: ${{ runner.os }}-build-cache-${{ inputs.build-cache-key }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }} \ No newline at end of file + key: ${{ runner.os }}-build-cache-${{ inputs.build-cache-key }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }} diff --git a/.github/configs/ct.yaml b/.github/configs/ct.yaml index 7cf864bc..5093fd70 100644 --- a/.github/configs/ct.yaml +++ b/.github/configs/ct.yaml @@ -4,7 +4,7 @@ chart-dirs: - charts chart-repos: - capsule=https://projectcapsule.github.io/charts/ -helm-extra-args: "--timeout 600s" +helm-extra-args: "--timeout 600s" validate-chart-schema: false validate-maintainers: false validate-yaml: true diff --git a/.github/configs/lintconf.yaml b/.github/configs/lintconf.yaml index 947c5028..577d81e6 100644 --- a/.github/configs/lintconf.yaml +++ b/.github/configs/lintconf.yaml @@ -1,6 +1,12 @@ - --- +ignore: + - config/ + - charts/*/templates/ + - charts/**/templates/ rules: + truthy: + level: warning + check-keys: false braces: min-spaces-inside: 0 max-spaces-inside: 0 @@ -39,5 +45,3 @@ rules: new-lines: type: unix trailing-spaces: enable - truthy: - level: warning diff --git a/.github/workflows/check-actions.yml b/.github/workflows/check-actions.yml index 5fe73cf9..e0a263c6 100644 --- a/.github/workflows/check-actions.yml +++ b/.github/workflows/check-actions.yml @@ -3,7 +3,8 @@ permissions: {} on: pull_request: - branches: [ "main" ] + branches: + - "*" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -18,7 +19,7 @@ jobs: - name: Ensure SHA pinned actions uses: zgosalvez/github-actions-ensure-sha-pinned-actions@c3a2b64f69b7a1542a68f44d9edbd9ec3fc1455e # v3.0.20 with: - # slsa-github-generator requires using a semver tag for reusable workflows. + # slsa-github-generator requires using a semver tag for reusable workflows. # See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators allowlist: | - slsa-framework/slsa-github-generator \ No newline at end of file + slsa-framework/slsa-github-generator diff --git a/.github/workflows/check-commit.yml b/.github/workflows/check-commit.yml index b7fc37ce..5c8ed7e3 100644 --- a/.github/workflows/check-commit.yml +++ b/.github/workflows/check-commit.yml @@ -3,14 +3,15 @@ permissions: {} on: push: - branches: [ "*" ] + branches: + - "*" pull_request: - branches: [ "*" ] + branches: + - "*" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - jobs: commit_lint: runs-on: ubuntu-24.04 @@ -19,5 +20,3 @@ jobs: with: fetch-depth: 0 - uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1 - with: - firstParent: true diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index d809ac7b..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Codecov -permissions: {} - -on: - pull_request: - branches: [ "main" ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - codecov: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Setup caches - uses: ./.github/actions/setup-caches - timeout-minutes: 5 - continue-on-error: true - with: - build-cache-key: codecov - - name: Check secret - id: checksecret - uses: ./.github/actions/exists - with: - value: ${{ secrets.CODECOV_TOKEN }} - - name: Generate Code Coverage Report - if: steps.checksecret.outputs.result == 'true' - run: make test - - name: Upload Report to Codecov - if: steps.checksecret.outputs.result == 'true' - uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 - with: - file: ./coverage.out - fail_ci_if_error: true - verbose: true diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..8b624a19 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,84 @@ +name: Coverage + +on: + push: + branches: + - "main" + pull_request: + types: [opened, reopened, synchronize] + branches: + - "main" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + compliance: + name: "License Compliance" + runs-on: ubuntu-24.04 + steps: + - name: "Checkout Code" + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Check secret + id: checksecret + uses: ./.github/actions/exists + with: + value: ${{ secrets.FOSSA_API_KEY }} + - name: "Run FOSSA Scan" + if: steps.checksecret.outputs.result == 'true' + uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0 + with: + api-key: ${{ secrets.FOSSA_API_KEY }} + - name: "Run FOSSA Test" + if: steps.checksecret.outputs.result == 'true' + uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0 + with: + api-key: ${{ secrets.FOSSA_API_KEY }} + run-tests: true + sast: + name: "SAST" + runs-on: ubuntu-24.04 + env: + GO111MODULE: on + permissions: + security-events: write + actions: read + contents: read + steps: + - name: Checkout Source + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 + with: + go-version-file: 'go.mod' + - name: Run Gosec Security Scanner + uses: securego/gosec@e0cca6fe95306b7e7790d6f1bf6a7bec6d622459 # v2.22.0 + with: + args: '-no-fail -fmt sarif -out gosec.sarif ./...' + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@08bc0cf022445eacafaa248bf48da20f26b8fd40 + with: + sarif_file: gosec.sarif + unit_tests: + name: "Unit tests" + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 + with: + go-version-file: 'go.mod' + - name: Unit Test + run: make test + - name: Check secret + id: checksecret + uses: ./.github/actions/exists + with: + value: ${{ secrets.CODECOV_TOKEN }} + - name: Upload Report to Codecov + if: ${{ steps.checksecret.outputs.result == 'true' }} + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 + with: + file: ./coverage.out + fail_ci_if_error: true + verbose: true diff --git a/.github/workflows/diff.yml b/.github/workflows/diff.yml deleted file mode 100644 index ad82e069..00000000 --- a/.github/workflows/diff.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Diff checks -permissions: {} - -on: - push: - branches: [ "*" ] - pull_request: - branches: [ "*" ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - diff: - name: diff - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 - with: - go-version-file: 'go.mod' - - run: make manifests - - name: Checking if YAML installer file is not aligned - run: if [[ $(git diff | wc -l) -gt 0 ]]; then echo ">>> Untracked generated files have not been committed" && git --no-pager diff && exit 1; fi - - name: Checking if YAML installer generated untracked files - run: test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" - - name: Checking if source code is not formatted - run: test -z "$(git diff 2> /dev/null)" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..d40e0ed6 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,45 @@ +name: Build images +permissions: {} +on: + pull_request: + branches: + - "*" + paths: + - '.github/workflows/docker-*.yml' + - 'api/**' + - 'controllers/**' + - 'pkg/**' + - 'e2e/*' + - '.ko.yaml' + - 'go.*' + - 'main.go' + - 'Makefile' + +jobs: + build-images: + runs-on: ubuntu-latest + permissions: + security-events: write + actions: read + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: ko build + run: VERSION=${{ github.sha }} make ko-build-all + - name: Trivy Scan Image + uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0 + with: + scan-type: 'fs' + ignore-unfixed: true + format: 'sarif' + output: 'trivy-results.sarif' + severity: 'CRITICAL,HIGH' + env: + # Trivy is returning TOOMANYREQUESTS + # See: https://github.com/aquasecurity/trivy-action/issues/389#issuecomment-2385416577 + TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db:2' + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@08bc0cf022445eacafaa248bf48da20f26b8fd40 + with: + sarif_file: 'trivy-results.sarif' diff --git a/.github/workflows/docs-lint.yml b/.github/workflows/docs-lint.yml index 26ee7ec0..8bc48843 100644 --- a/.github/workflows/docs-lint.yml +++ b/.github/workflows/docs-lint.yml @@ -3,12 +3,14 @@ permissions: {} on: push: - branches: [ "*" ] + branches: + - "*" paths: - '.github/workflows/docs-lint.yml' - 'docs/content/**' pull_request: - branches: [ "*" ] + branches: + - "*" paths: - '.github/workflows/docs-lint.yml' - 'docs/content/**' @@ -28,4 +30,4 @@ jobs: - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 18 - - run: make docs-lint \ No newline at end of file + - run: make docs-lint diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a2cc1183..8cbf2637 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -3,7 +3,8 @@ permissions: {} on: pull_request: - branches: [ "*" ] + branches: + - "*" paths: - '.github/workflows/e2e.yml' - 'api/**' @@ -25,7 +26,15 @@ jobs: strategy: fail-fast: false matrix: - k8s-version: [ 'v1.24.7', 'v1.25.3', 'v1.26.3', 'v1.27.2', 'v1.28.0', 'v1.29.0', 'v1.30.0', 'v1.31.0' ] + k8s-version: + - "v1.24.7" + - "v1.25.3" + - "v1.26.3" + - "v1.27.2" + - "v1.28.0" + - "v1.29.0" + - "v1.30.0" + - "v1.31.0" runs-on: ubuntu-24.04 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml deleted file mode 100644 index b044cd54..00000000 --- a/.github/workflows/fossa.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: FOSSA -permissions: {} - -on: - push: - branches: [ "*" ] - pull_request: - branches: [ "*" ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - fossa-scan: - runs-on: ubuntu-24.04 - steps: - - name: "Checkout Code" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Check secret - id: checksecret - uses: ./.github/actions/exists - with: - value: ${{ secrets.FOSSA_API_KEY }} - - name: "Run FOSSA Scan" - if: steps.checksecret.outputs.result == 'true' - uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0 - with: - api-key: ${{ secrets.FOSSA_API_KEY }} - - name: "Run FOSSA Test" - if: steps.checksecret.outputs.result == 'true' - uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0 - with: - api-key: ${{ secrets.FOSSA_API_KEY }} - run-tests: true diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml deleted file mode 100644 index ed1fb9f6..00000000 --- a/.github/workflows/gosec.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI gosec -permissions: - # required for all workflows - security-events: write - # only required for workflows in private repositories - actions: read - contents: read -on: - push: - branches: [ "*" ] - pull_request: - branches: [ "*" ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - tests: - runs-on: ubuntu-24.04 - env: - GO111MODULE: on - steps: - - name: Checkout Source - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 - with: - go-version-file: 'go.mod' - - name: Run Gosec Security Scanner - uses: securego/gosec@e0cca6fe95306b7e7790d6f1bf6a7bec6d622459 # v2.22.0 - with: - args: '-no-fail -fmt sarif -out gosec.sarif ./...' - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@08bc0cf022445eacafaa248bf48da20f26b8fd40 - with: - sarif_file: gosec.sarif - diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml index 16dd4860..cdf7944e 100644 --- a/.github/workflows/helm-publish.yml +++ b/.github/workflows/helm-publish.yml @@ -1,5 +1,6 @@ name: Publish charts permissions: read-all + on: push: tags: diff --git a/.github/workflows/helm-test.yml b/.github/workflows/helm-test.yml index ae7c126a..f1591bcc 100644 --- a/.github/workflows/helm-test.yml +++ b/.github/workflows/helm-test.yml @@ -3,13 +3,25 @@ permissions: {} on: pull_request: - branches: [ "main" ] + branches: + - "main" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + linter-artifacthub: + runs-on: ubuntu-latest + container: + image: artifacthub/ah + options: --user root + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Run ah lint + working-directory: ./charts/ + run: ah lint lint: runs-on: ubuntu-24.04 steps: @@ -31,7 +43,7 @@ jobs: fi - name: Run chart-testing (lint) run: ct lint --debug --config ./.github/configs/ct.yaml --lint-conf ./.github/configs/lintconf.yaml - + - name: Run docs-testing (helm-docs) id: helm-docs run: | @@ -43,7 +55,17 @@ jobs: else echo -e '\033[0;32mDocumentation up to date\033[0m ✔' fi - + - name: Run schema-testing (helm-schema) + id: helm-schema + run: | + make helm-schema + if [[ $(git diff --stat) != '' ]]; then + echo -e '\033[0;31mSchema outdated! (Run make helm-schema locally and commit)\033[0m ❌' + git diff --color + exit 1 + else + echo -e '\033[0;32mSchema up to date\033[0m ✔' + fi - name: Run chart-testing (install) run: HELM_KIND_CONFIG="./hack/kind-cluster.yml" make helm-test - if: steps.list-changed.outputs.changed == 'true' \ No newline at end of file + if: steps.list-changed.outputs.changed == 'true' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 943a62ec..23f6fe99 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,17 +1,45 @@ name: Linting permissions: {} - on: push: - branches: [ "*" ] + branches: + - "*" pull_request: - branches: [ "*" ] - + branches: + - "*" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - jobs: + manifests: + name: diff + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 + with: + go-version-file: 'go.mod' + - name: Generate manifests + run: | + make manifests + if [[ $(git diff --stat) != '' ]]; then + echo -e '\033[0;31mManifests outdated! (Run make manifests locally and commit)\033[0m ❌' + git diff --color + exit 1 + else + echo -e '\033[0;32mDocumentation up to date\033[0m ✔' + fi + yamllint: + name: yamllint + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install yamllint + run: pip install yamllint + - name: Lint YAML files + run: yamllint -c=.github/configs/lintconf.yaml . golangci: name: lint runs-on: ubuntu-24.04 diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index 980a35d0..b6a823f4 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -19,7 +19,8 @@ jobs: # differently from the e2e workflow # we don't need all the versions of kubernetes # to generate the seccomp profile. - k8s-version: [ 'v1.30.0' ] + k8s-version: + - "v1.30.0" runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 954f2e27..de6a8470 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -39,4 +39,4 @@ jobs: - name: Upload to code-scanning uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 with: - sarif_file: results.sarif \ No newline at end of file + sarif_file: results.sarif diff --git a/.github/workflows/seccomp.yaml b/.github/workflows/seccomp.yaml index c4435583..2498a112 100644 --- a/.github/workflows/seccomp.yaml +++ b/.github/workflows/seccomp.yaml @@ -3,14 +3,16 @@ permissions: {} on: pull_request: - branches: [ "*" ] + branches: + - "*" paths: - '.github/workflows/e2e.yml' - 'api/**' - 'controllers/**' - 'pkg/**' - 'e2e/*' - - 'Dockerfile' + - '.ko.yaml' + - 'Dockerfile.tracing' - 'go.*' - 'main.go' - 'Makefile' @@ -25,10 +27,8 @@ jobs: strategy: fail-fast: false matrix: - # differently from the e2e workflow - # we don't need all the versions of kubernetes - # to generate the seccomp profile. - k8s-version: [ 'v1.30.0' ] + k8s-version: + - "v1.30.0" runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -51,4 +51,3 @@ jobs: with: name: capsule-seccomp path: capsule-seccomp.json - diff --git a/.golangci.yml b/.golangci.yml index 7e5849c6..9b5edc24 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,3 @@ - linters-settings: govet: check-shadowing: true @@ -58,13 +57,10 @@ linters: - deadcode - ifshort - nonamedreturns - -service: - golangci-lint-version: 1.56.x - run: timeout: 3m - go: '1.21' + allow-parallel-runners: true + tests: false skip-files: - "zz_.*\\.go$" - ".+\\.generated.go" diff --git a/.goreleaser.yml b/.goreleaser.yml index 1b566914..e062891d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -34,7 +34,7 @@ release: Thanks to all the contributors! **Full Changelog**: https://github.com/projectcapsule/{{ .ProjectName }}/compare/{{ .PreviousTag }}...{{ .Tag }} - + **Docker Images** - `ghcr.io/projectcapsule/{{ .ProjectName }}:{{ .Version }}` - `ghcr.io/projectcapsule/{{ .ProjectName }}:latest` diff --git a/.ko.yaml b/.ko.yaml index 203c3f24..c5b78621 100644 --- a/.ko.yaml +++ b/.ko.yaml @@ -6,4 +6,4 @@ builds: - id: capsule main: ./ ldflags: - - '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}' \ No newline at end of file + - '{{ if index .Env "LD_FLAGS" }}{{ .Env.LD_FLAGS }}{{ end }}' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f347e5b..4669e768 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,9 +2,9 @@ repos: - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook rev: v9.20.0 hooks: - - id: commitlint - stages: [commit-msg] - additional_dependencies: ['@commitlint/config-conventional', 'commitlint-plugin-function-rules'] + - id: commitlint + stages: [commit-msg] + additional_dependencies: ['@commitlint/config-conventional', 'commitlint-plugin-function-rules'] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: @@ -13,40 +13,46 @@ repos: - id: double-quote-string-fixer - id: end-of-file-fixer - id: trailing-whitespace +- repo: https://github.com/adrienverge/yamllint + rev: v1.29.0 + hooks: + - id: yamllint + args: [-c=.github/configs/lintconf.yaml] - repo: local hooks: - - id: run-helm-docs - name: Execute helm-docs - entry: make helm-docs - language: system - files: ^charts/ - - id: run-helm-schema - name: Execute helm-schema - entry: make helm-schema - language: system - files: ^charts/ - - id: run-helm-lint - name: Execute helm-lint - entry: make helm-lint - language: system - files: ^charts/ - - id: golangci-lint - name: Execute golangci-lint - entry: make golint - language: system - files: \.go$ -- repo: https://github.com/tekwizely/pre-commit-golang - rev: v1.0.0-rc.1 - hooks: - - id: go-vet - - id: go-vet-mod - - id: go-vet-pkg - - id: go-vet-repo-mod - - id: go-vet-repo-pkg - - id: go-revive - - id: go-revive-mod - - id: go-revive-repo-mod - - id: go-sec-mod - - id: go-sec-pkg - - id: go-sec-repo-mod - - id: go-sec-repo-pkg + - id: run-helm-docs + name: Execute helm-docs + entry: make helm-docs + language: system + files: ^charts/ + - id: run-helm-schema + name: Execute helm-schema + entry: make helm-schema + language: system + files: ^charts/ + - id: run-helm-lint + name: Execute helm-lint + entry: make helm-lint + language: system + files: ^charts/ + # Currently too slow smw + # - id: golangci-lint + # name: Execute golangci-lint + # entry: make golint + # language: system + # files: \.go$ +# - repo: https://github.com/tekwizely/pre-commit-golang +# rev: v1.0.0-rc.1 +# hooks: +# - id: go-vet +# - id: go-vet-mod +# - id: go-vet-pkg +# - id: go-vet-repo-mod +# - id: go-vet-repo-pkg +# - id: go-revive +# - id: go-revive-mod +# - id: go-revive-repo-mod +# - id: go-sec-mod +# - id: go-sec-pkg +# - id: go-sec-repo-mod +# - id: go-sec-repo-pkg diff --git a/Makefile b/Makefile index 3ad94f3b..a7d1f206 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,8 @@ run: generate manifests go run . # Generate manifests e.g. CRD, RBAC etc. -manifests: controller-gen - $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=charts/capsule/crds +manifests: generate + $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=charts/capsule/crds # Generate code generate: controller-gen @@ -68,15 +68,14 @@ generate: controller-gen # Helm SRC_ROOT = $(shell git rev-parse --show-toplevel) -helm-docs: HELMDOCS_VERSION := v1.11.0 -helm-docs: docker - @docker run -v "$(SRC_ROOT):/helm-docs" jnorwood/helm-docs:$(HELMDOCS_VERSION) --chart-search-root /helm-docs +helm-docs: helm-doc + $(HELM_DOCS) --chart-search-root ./charts -helm-lint: docker - @docker run -v "$(SRC_ROOT):/workdir" --entrypoint /bin/sh quay.io/helmpack/chart-testing:$(CT_VERSION) -c "cd /workdir; ct lint --config .github/configs/ct.yaml --lint-conf .github/configs/lintconf.yaml --all --debug" +helm-lint: ct + @$(CT) lint --config .github/configs/ct.yaml --validate-yaml=false --all --debug helm-schema: helm-plugin-schema - cd charts/capsule && $(HELM) schema + cd charts/capsule && $(HELM) schema -output values.schema.json helm-test: HELM_KIND_CONFIG ?= "" helm-test: kind ct ko-build-all @@ -89,9 +88,9 @@ helm-test-exec: kind $(MAKE) docker-build-capsule-trace $(MAKE) e2e-load-image CLUSTER_NAME=capsule-charts IMAGE=$(CAPSULE_IMG) VERSION=latest $(MAKE) e2e-load-image CLUSTER_NAME=capsule-charts IMAGE=$(CAPSULE_IMG) VERSION=tracing - @kubectl create ns capsule-system || true - @kubectl apply --server-side=true -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml - @kubectl apply --server-side=true -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml + @$(KUBECTL) create ns capsule-system || true + @$(KUBECTL) apply --server-side=true -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.crds.yaml + @$(KUBECTL) apply --server-side=true -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml @$(CT) install --config $(SRC_ROOT)/.github/configs/ct.yaml --namespace=capsule-system --all --debug docker: @@ -123,7 +122,6 @@ IP.1 = $(LAPTOP_HOST_IP) endef export TLS_CNF dev-setup: - kubectl -n capsule-system scale deployment capsule-controller-manager --replicas=0 || true mkdir -p /tmp/k8s-webhook-server/serving-certs echo "$${TLS_CNF}" > _tls.cnf openssl req -newkey rsa:4096 -days 3650 -nodes -x509 \ @@ -132,13 +130,13 @@ dev-setup: -config _tls.cnf \ -keyout /tmp/k8s-webhook-server/serving-certs/tls.key \ -out /tmp/k8s-webhook-server/serving-certs/tls.crt - kubectl create secret tls capsule-tls -n capsule-system \ + $(KUBECTL) create secret tls capsule-tls -n capsule-system \ --cert=/tmp/k8s-webhook-server/serving-certs/tls.crt\ --key=/tmp/k8s-webhook-server/serving-certs/tls.key || true rm -f _tls.cnf export WEBHOOK_URL="https://$${LAPTOP_HOST_IP}:9443"; \ export CA_BUNDLE=`openssl base64 -in /tmp/k8s-webhook-server/serving-certs/tls.crt | tr -d '\n'`; \ - helm upgrade \ + $(HELM) upgrade \ --dependency-update \ --debug \ --install \ @@ -151,6 +149,7 @@ dev-setup: --set "webhooks.service.caBundle=$${CA_BUNDLE}" \ capsule \ ./charts/capsule + $(KUBECTL) -n capsule-system scale deployment capsule-controller-manager --replicas=0 || true #################### # -- Docker @@ -209,95 +208,15 @@ ko-publish-capsule: ko-login ## Build and publish kyvernopre image (with ko) .PHONY: ko-publish-all ko-publish-all: ko-publish-capsule - -#################### -# -- Helm Plugins -#################### - -HELM_SCHEMA_VERSION := "" -helm-plugin-schema: - $(HELM) plugin install https://github.com/losisin/helm-values-schema-json.git --version $(HELM_SCHEMA_VERSION) || true - -#################### -# -- Binaries -#################### - -CONTROLLER_GEN := $(shell pwd)/bin/controller-gen -CONTROLLER_GEN_VERSION := v0.16.1 -controller-gen: ## Download controller-gen locally if necessary. - $(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)) - -GINKGO := $(shell pwd)/bin/ginkgo -ginkgo: ## Download ginkgo locally if necessary. - $(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo) - -CT := $(shell pwd)/bin/ct -CT_VERSION := v3.10.1 -ct: ## Download ct locally if necessary. - $(call go-install-tool,$(CT),github.com/helm/chart-testing/v3/ct@$(CT_VERSION)) - -KIND := $(shell pwd)/bin/kind -KIND_VERSION := v0.17.0 -kind: ## Download kind locally if necessary. - $(call go-install-tool,$(KIND),sigs.k8s.io/kind/cmd/kind@$(KIND_VERSION)) - -KUSTOMIZE := $(shell pwd)/bin/kustomize -KUSTOMIZE_VERSION := 3.8.7 -kustomize: ## Download kustomize locally if necessary. - $(call install-kustomize,$(KUSTOMIZE),$(KUSTOMIZE_VERSION)) - -KO = $(shell pwd)/bin/ko -KO_VERSION = v0.14.1 -ko: - $(call go-install-tool,$(KO),github.com/google/ko@$(KO_VERSION)) - -HARPOON := $(shell pwd)/bin/harpoon -HARPOON_VERSION := v0.9.4 -harpoon: ## Download harpoon locally if necessary. - @mkdir $(shell pwd)/bin - @curl -s https://raw.githubusercontent.com/alegrey91/harpoon/main/install | \ - sudo bash -s -- --install-version $(HARPOON_VERSION) --install-dir $(shell pwd)/bin - -#################### -# -- Helpers -#################### -pull-upstream: - git remote add upstream https://github.com/capsuleproject/capsule.git - git fetch --all && git pull upstream - -define install-kustomize -@[ -f $(1) ] || { \ -set -e ;\ -echo "Installing v$(2)" ;\ -cd bin ;\ -wget "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" ;\ -bash ./install_kustomize.sh $(2) ;\ -} -endef - -# go-install-tool will 'go install' any package $2 and install it to $1. -PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) -define go-install-tool -@[ -f $(1) ] || { \ -set -e ;\ -GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ -} -endef - # Sorting imports .PHONY: goimports goimports: goimports -w -l -local "github.com/projectcapsule/capsule" . -GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint -GOLANGCI_LINT_VERSION = v1.56.2 -golangci-lint: ## Download golangci-lint locally if necessary. - $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)) - # Linting code as PR is expecting .PHONY: golint golint: golangci-lint - $(GOLANGCI_LINT) run -c .golangci.yml + $(GOLANGCI_LINT) run -c .golangci.yml --verbose --fix # Running e2e tests in a KinD instance .PHONY: e2e @@ -306,12 +225,12 @@ e2e: ginkgo e2e-build: kind $(KIND) create cluster --wait=60s --name $(CLUSTER_NAME) --image kindest/node:$${KIND_K8S_VERSION:-v1.27.0} - $(MAKE) e2e-load-image CLUSTER_NAME=$(CLUSTER_NAME) IMAGE=$(CAPSULE_IMG) VERSION=$(VERSION) $(MAKE) e2e-install .PHONY: e2e-install e2e-install: - helm upgrade \ + $(MAKE) e2e-load-image CLUSTER_NAME=$(CLUSTER_NAME) IMAGE=$(CAPSULE_IMG) VERSION=$(VERSION) + $(HELM) upgrade \ --dependency-update \ --debug \ --install \ @@ -326,7 +245,7 @@ e2e-install: ./charts/capsule .PHONY: trace-install -trace-install: +trace-install: helm upgrade \ --dependency-update \ --debug \ @@ -349,7 +268,7 @@ trace-e2e: kind $(MAKE) e2e-exec $(KIND) delete cluster --name capsule-tracing -.PHONY: trace-unit +.PHONY: trace-unit trace-unit: harpoon $(HARPOON) analyze -e .git/ -e assets/ -e charts/ -e config/ -e docs/ -e e2e/ -e hack/ --directory /tmp/artifacts/ --save $(HARPOON) hunt -D /tmp/results -F harpoon-report.yml --include-cmd-stdout --save @@ -359,7 +278,6 @@ seccomp: $(HARPOON) build --add-syscall-sets=dynamic,docker -D /tmp/results --name capsule-seccomp.json --save .PHONY: e2e-load-image -e2e-load-image: LOAD_IMAGE ?= $(IMAGE):$(VERSION) e2e-load-image: kind ko-build-all $(KIND) load docker-image $(IMAGE):$(VERSION) --name $(CLUSTER_NAME) @@ -374,3 +292,96 @@ e2e-destroy: kind SPELL_CHECKER = npx spellchecker-cli docs-lint: cd docs/content && $(SPELL_CHECKER) -f "*.md" "*/*.md" "!general/crds-apis.md" -d dictionary.txt + +#################### +# -- Helpers +#################### +pull-upstream: + git remote add upstream https://github.com/capsuleproject/capsule.git + git fetch --all && git pull upstream + +## Location to install dependencies to +LOCALBIN ?= $(shell pwd)/bin +$(LOCALBIN): + mkdir -p $(LOCALBIN) + +#################### +# -- Helm Plugins +#################### + +HELM_SCHEMA_VERSION := "" +helm-plugin-schema: + @$(HELM) plugin install https://github.com/losisin/helm-values-schema-json.git --version $(HELM_SCHEMA_VERSION) || true + +HELM_DOCS := $(LOCALBIN)/helm-docs +HELM_DOCS_VERSION := v1.14.1 +HELM_DOCS_LOOKUP := norwoodj/helm-docs +helm-doc: + @test -s $(HELM_DOCS) || \ + $(call go-install-tool,$(HELM_DOCS),github.com/$(HELM_DOCS_LOOKUP)/cmd/helm-docs@$(HELM_DOCS_VERSION)) + +#################### +# -- Tools +#################### +CONTROLLER_GEN := $(LOCALBIN)/controller-gen +CONTROLLER_GEN_VERSION ?= v0.16.3 +CONTROLLER_GEN_LOOKUP := kubernetes-sigs/controller-tools +controller-gen: + @test -s $(CONTROLLER_GEN) && $(CONTROLLER_GEN) --version | grep -q $(CONTROLLER_GEN_VERSION) || \ + $(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)) + +GINKGO := $(LOCALBIN)/ginkgo +ginkgo: + $(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo) + +CT := $(LOCALBIN)/ct +CT_VERSION := v3.11.0 +CT_LOOKUP := helm/chart-testing +ct: + @test -s $(CT) && $(CT) version | grep -q $(CT_VERSION) || \ + $(call go-install-tool,$(CT),github.com/$(CT_LOOKUP)/v3/ct@$(CT_VERSION)) + +KIND := $(LOCALBIN)/kind +KIND_VERSION := v0.17.0 +KIND_LOOKUP := kubernetes-sigs/kind +kind: + @test -s $(KIND) && $(KIND) --version | grep -q $(KIND_VERSION) || \ + $(call go-install-tool,$(KIND),sigs.k8s.io/kind/cmd/kind@$(KIND_VERSION)) + +KO := $(LOCALBIN)/ko +KO_VERSION := v0.14.1 +KO_LOOKUP := google/ko +ko: + @test -s $(KO) && $(KO) -h | grep -q $(KO_VERSION) || \ + $(call go-install-tool,$(KO),github.com/$(KO_LOOKUP)@$(KO_VERSION)) + +GOLANGCI_LINT := $(LOCALBIN)/golangci-lint +GOLANGCI_LINT_VERSION := v1.63.4 +GOLANGCI_LINT_LOOKUP := golangci/golangci-lint +golangci-lint: ## Download golangci-lint locally if necessary. + @test -s $(GOLANGCI_LINT) && $(GOLANGCI_LINT) -h | grep -q $(GOLANGCI_LINT_VERSION) || \ + $(call go-install-tool,$(GOLANGCI_LINT),github.com/$(GOLANGCI_LINT_LOOKUP)/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)) + +APIDOCS_GEN := $(LOCALBIN)/crdoc +APIDOCS_GEN_VERSION := v0.6.2 +APIDOCS_GEN_LOOKUP := fybrik/crdoc +apidocs-gen: ## Download crdoc locally if necessary. + @test -s $(APIDOCS_GEN) && $(APIDOCS_GEN) --version | grep -q $(APIDOCS_GEN_VERSION) || \ + $(call go-install-tool,$(APIDOCS_GEN),fybrik.io/crdoc@$(APIDOCS_GEN_VERSION)) + +HARPOON := $(LOCALBIN)/harpoon +HARPOON_VERSION := v0.9.4 +HARPOON_LOOKUP := alegrey91/harpoon +harpoon: + @mkdir $(LOCALBIN) + @curl -s https://raw.githubusercontent.com/alegrey91/harpoon/main/install | \ + sudo bash -s -- --install-version $(HARPOON_VERSION) --install-dir $(LOCALBIN) + +# go-install-tool will 'go install' any package $2 and install it to $1. +PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) +define go-install-tool +[ -f $(1) ] || { \ + set -e ;\ + GOBIN=$(LOCALBIN) go install $(2) ;\ +} +endef diff --git a/README.md b/README.md index 7206edba..3ceb9356 100644 --- a/README.md +++ b/README.md @@ -82,24 +82,6 @@ Please, check the project [documentation](https://projectcapsule.dev) for the co Capsule is Open Source with Apache 2 license and any contribution is welcome. -## Chart Development - -### Chart Linting - -The chart is linted with [ct](https://github.com/helm/chart-testing). You can run the linter locally with this command: - -``` -make helm-lint -``` - -### Chart Documentation - -The documentation for each chart is done with [helm-docs](https://github.com/norwoodj/helm-docs). This way we can ensure that values are consistent with the chart documentation. Run this anytime you make changes to a `values.yaml` file: - -``` -make helm-docs -``` - ## Community meeting Join the community, share and learn from it. You can find all the resources to how to contribute code and docs, connect with people in the [community repository](https://github.com/projectcapsule/capsule-community). @@ -118,6 +100,12 @@ You can find how the Capsule project is governed [here](https://projectcapsule.d Please, refer to the maintainers file available [here](.github/maintainers.yaml). +## CLOMonitor + +CLOMonitor is a tool that periodically checks open source projects repositories to verify they meet certain project health best practices. + +[![CloMonitor report summary](https://clomonitor.io/api/projects/cncf/capsule/report-summary?theme=light)](https://clomonitor.io/projects/cncf/capsule) + ### Changelog Read how we log changes [here](CHANGELOG.md) @@ -142,4 +130,4 @@ All OCI release artifacts include a Software Bill of Materials (SBOM) in Cyclone - Q. Do you provide commercial support? - A. Yes, we're available to help and provide commercial support. [Clastix](https://clastix.io) is the company behind Capsule. Please, contact us for a quote. + A. Yes, we're available to help and provide commercial support. [Clastix](https://clastix.io) is the company behind Capsule. Please, contact us for a quote. diff --git a/SECURITY-INSIGHTS.yml b/SECURITY-INSIGHTS.yml index 21e16e0b..007cd6b8 100644 --- a/SECURITY-INSIGHTS.yml +++ b/SECURITY-INSIGHTS.yml @@ -57,4 +57,3 @@ security-contacts: - type: email value: cncf-capsule-maintainers@lists.cncf.io primary: true - diff --git a/charts/capsule/.helmignore b/charts/capsule/.helmignore index ced94a2f..39045fab 100644 --- a/charts/capsule/.helmignore +++ b/charts/capsule/.helmignore @@ -22,3 +22,4 @@ *.tmproj .vscode/ README.md.gotmpl +artifacthub-repo.yml diff --git a/charts/capsule/Chart.yaml b/charts/capsule/Chart.yaml index 81964a60..86b8d4a2 100644 --- a/charts/capsule/Chart.yaml +++ b/charts/capsule/Chart.yaml @@ -40,7 +40,5 @@ annotations: - name: Documentation url: https://projectcapsule.dev/ artifacthub.io/changes: | - - kind: fixed - description: added scope for mutating webhook configurations - - kind: changed - description: moved job configuration from jobs to global.jobs.kubectl + - kind: added + description: oci chart reference diff --git a/charts/capsule/README.md b/charts/capsule/README.md index 50f743fa..5a9a2d33 100644 --- a/charts/capsule/README.md +++ b/charts/capsule/README.md @@ -35,6 +35,8 @@ The following Values have changed key or Value: ## Installation +**When using OCI we recommend our dedicated [OCI Repository](https://artifacthub.io/packages/helm/capsule/capsule) for this chart** + The Capsule Operator requires it's CRDs to be installed before the operator itself. Since the Helm CRD lifecycle has limitations, we recommend to install the CRDs separately. Our chart supports the installation of crds via a dedicated Release. The Capsule Operator Chart can be used to instantly deploy the Capsule Operator on your Kubernetes cluster. diff --git a/charts/capsule/README.md.gotmpl b/charts/capsule/README.md.gotmpl index e6d3849e..e3b46784 100644 --- a/charts/capsule/README.md.gotmpl +++ b/charts/capsule/README.md.gotmpl @@ -16,7 +16,7 @@ Use the Capsule Operator for easily implementing, managing, and maintaining mult * A [`kubeconfig`](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file accessing the Kubernetes cluster with cluster admin permissions. -## Major Changes +## Major Changes In the following sections you see actions which are required when you are upgrading to a specific version. @@ -25,7 +25,7 @@ In the following sections you see actions which are required when you are upgrad Introduces a new methode to manage all capsule CRDs and their lifecycle. We are no longer relying on the [native CRD hook with the Helm Chart](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). The hook only allows to manage CRDs on install and uninstall but we can't deliver updates to the CRDs. When you newly install the chart we recommend to set `crds.install` to `true`. This will manage the CRDs with the Helm Chart. This behavior is the new default. -#### Changed Values +#### Changed Values The following Values have changed key or Value: @@ -36,6 +36,8 @@ The following Values have changed key or Value: ## Installation +**When using OCI we recommend our dedicated [OCI Repository](https://artifacthub.io/packages/helm/capsule/capsule) for this chart** + The Capsule Operator requires it's CRDs to be installed before the operator itself. Since the Helm CRD lifecycle has limitations, we recommend to install the CRDs separately. Our chart supports the installation of crds via a dedicated Release. The Capsule Operator Chart can be used to instantly deploy the Capsule Operator on your Kubernetes cluster. diff --git a/charts/capsule/artifacthub-repo.yml b/charts/capsule/artifacthub-repo.yml new file mode 100644 index 00000000..3e059d2e --- /dev/null +++ b/charts/capsule/artifacthub-repo.yml @@ -0,0 +1,4 @@ +repositoryID: 783775bb-96c2-4915-8c7d-ba4a1118323c +owners: + - name: capsule-maintainers + email: cncf-capsule-maintainers@lists.cncf.io diff --git a/charts/capsule/crds/capsule.clastix.io_capsuleconfigurations.yaml b/charts/capsule/crds/capsule.clastix.io_capsuleconfigurations.yaml index 73ff15e4..c8b52cea 100644 --- a/charts/capsule/crds/capsule.clastix.io_capsuleconfigurations.yaml +++ b/charts/capsule/crds/capsule.clastix.io_capsuleconfigurations.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.1 + controller-gen.kubebuilder.io/version: v0.16.3 name: capsuleconfigurations.capsule.clastix.io spec: group: capsule.clastix.io diff --git a/charts/capsule/crds/capsule.clastix.io_globaltenantresources.yaml b/charts/capsule/crds/capsule.clastix.io_globaltenantresources.yaml index 0c6a7981..7ff5a10d 100644 --- a/charts/capsule/crds/capsule.clastix.io_globaltenantresources.yaml +++ b/charts/capsule/crds/capsule.clastix.io_globaltenantresources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.1 + controller-gen.kubebuilder.io/version: v0.16.3 name: globaltenantresources.capsule.clastix.io spec: group: capsule.clastix.io diff --git a/charts/capsule/crds/capsule.clastix.io_tenantresources.yaml b/charts/capsule/crds/capsule.clastix.io_tenantresources.yaml index e8804f8f..3359dccf 100644 --- a/charts/capsule/crds/capsule.clastix.io_tenantresources.yaml +++ b/charts/capsule/crds/capsule.clastix.io_tenantresources.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.1 + controller-gen.kubebuilder.io/version: v0.16.3 name: tenantresources.capsule.clastix.io spec: group: capsule.clastix.io diff --git a/charts/capsule/crds/capsule.clastix.io_tenants.yaml b/charts/capsule/crds/capsule.clastix.io_tenants.yaml index dcc820f9..98c142fa 100644 --- a/charts/capsule/crds/capsule.clastix.io_tenants.yaml +++ b/charts/capsule/crds/capsule.clastix.io_tenants.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.1 + controller-gen.kubebuilder.io/version: v0.16.3 name: tenants.capsule.clastix.io spec: group: capsule.clastix.io diff --git a/charts/capsule/values.schema.json b/charts/capsule/values.schema.json index c8dbddda..252236b3 100644 --- a/charts/capsule/values.schema.json +++ b/charts/capsule/values.schema.json @@ -171,6 +171,9 @@ "hostNetwork": { "type": "boolean" }, + "hostPID": { + "type": "boolean" + }, "image": { "properties": { "pullPolicy": { @@ -312,6 +315,16 @@ }, "type": "object" }, + "securityContext": { + "properties": {}, + "type": "object" + }, + "volumeMounts": { + "type": "array" + }, + "volumes": { + "type": "array" + }, "webhookPort": { "type": "integer" } @@ -348,6 +361,9 @@ }, "type": "object" }, + "ports": { + "type": "array" + }, "priorityClassName": { "type": "string" }, diff --git a/config/crd/bases/capsule.clastix.io_capsuleconfigurations.yaml b/config/crd/bases/capsule.clastix.io_capsuleconfigurations.yaml deleted file mode 100644 index c95f5c4d..00000000 --- a/config/crd/bases/capsule.clastix.io_capsuleconfigurations.yaml +++ /dev/null @@ -1,132 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.15.0 - name: capsuleconfigurations.capsule.clastix.io -spec: - group: capsule.clastix.io - names: - kind: CapsuleConfiguration - listKind: CapsuleConfigurationList - plural: capsuleconfigurations - singular: capsuleconfiguration - scope: Cluster - versions: - - name: v1beta2 - schema: - openAPIV3Schema: - description: CapsuleConfiguration is the Schema for the Capsule configuration - API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: CapsuleConfigurationSpec defines the Capsule configuration. - properties: - enableTLSReconciler: - default: true - description: |- - Toggles the TLS reconciler, the controller that is able to generate CA and certificates for the webhooks - when not using an already provided CA and certificate, or when these are managed externally with Vault, or cert-manager. - type: boolean - forceTenantPrefix: - default: false - description: |- - Enforces the Tenant owner, during Namespace creation, to name it using the selected Tenant name as prefix, - separated by a dash. This is useful to avoid Namespace name collision in a public CaaS environment. - type: boolean - nodeMetadata: - description: |- - Allows to set the forbidden metadata for the worker nodes that could be patched by a Tenant. - This applies only if the Tenant has an active NodeSelector, and the Owner have right to patch their nodes. - properties: - forbiddenAnnotations: - description: Define the annotations that a Tenant Owner cannot - set for their nodes. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - forbiddenLabels: - description: Define the labels that a Tenant Owner cannot set - for their nodes. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - required: - - forbiddenAnnotations - - forbiddenLabels - type: object - overrides: - default: - TLSSecretName: capsule-tls - mutatingWebhookConfigurationName: capsule-mutating-webhook-configuration - validatingWebhookConfigurationName: capsule-validating-webhook-configuration - description: |- - Allows to set different name rather than the canonical one for the Capsule configuration objects, - such as webhook secret or configurations. - properties: - TLSSecretName: - default: capsule-tls - description: |- - Defines the Secret name used for the webhook server. - Must be in the same Namespace where the Capsule Deployment is deployed. - type: string - mutatingWebhookConfigurationName: - default: capsule-mutating-webhook-configuration - description: Name of the MutatingWebhookConfiguration which contains - the dynamic admission controller paths and resources. - type: string - validatingWebhookConfigurationName: - default: capsule-validating-webhook-configuration - description: Name of the ValidatingWebhookConfiguration which - contains the dynamic admission controller paths and resources. - type: string - required: - - TLSSecretName - - mutatingWebhookConfigurationName - - validatingWebhookConfigurationName - type: object - protectedNamespaceRegex: - description: Disallow creation of namespaces, whose name matches this - regexp - type: string - userGroups: - default: - - capsule.clastix.io - description: Names of the groups for Capsule users. - items: - type: string - type: array - required: - - enableTLSReconciler - type: object - type: object - served: true - storage: true diff --git a/config/crd/bases/capsule.clastix.io_globaltenantresources.yaml b/config/crd/bases/capsule.clastix.io_globaltenantresources.yaml deleted file mode 100644 index 8ae724fa..00000000 --- a/config/crd/bases/capsule.clastix.io_globaltenantresources.yaml +++ /dev/null @@ -1,298 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.15.0 - name: globaltenantresources.capsule.clastix.io -spec: - group: capsule.clastix.io - names: - kind: GlobalTenantResource - listKind: GlobalTenantResourceList - plural: globaltenantresources - singular: globaltenantresource - scope: Cluster - versions: - - name: v1beta2 - schema: - openAPIV3Schema: - description: GlobalTenantResource allows to propagate resource replications - to a specific subset of Tenant resources. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: GlobalTenantResourceSpec defines the desired state of GlobalTenantResource. - properties: - pruningOnDelete: - default: true - description: |- - When the replicated resource manifest is deleted, all the objects replicated so far will be automatically deleted. - Disable this to keep replicated resources although the deletion of the replication manifest. - type: boolean - resources: - description: Defines the rules to select targeting Namespace, along - with the objects that must be replicated. - items: - properties: - additionalMetadata: - description: |- - Besides the Capsule metadata required by TenantResource controller, defines additional metadata that must be - added to the replicated resources. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - description: |- - Defines the Namespace selector to select the Tenant Namespaces on which the resources must be propagated. - In case of nil value, all the Tenant Namespaces are targeted. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespacedItems: - description: List of the resources already existing in other - Namespaces that must be replicated. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - selector: - description: Label selector used to select the given resources - in the given Namespace. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - kind - - namespace - - selector - type: object - type: array - rawItems: - description: List of raw resources that must be replicated. - items: - type: object - x-kubernetes-embedded-resource: true - x-kubernetes-preserve-unknown-fields: true - type: array - type: object - type: array - resyncPeriod: - default: 60s - description: |- - Define the period of time upon a second reconciliation must be invoked. - Keep in mind that any change to the manifests will trigger a new reconciliation. - type: string - tenantSelector: - description: Defines the Tenant selector used target the tenants on - which resources must be propagated. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - resources - - resyncPeriod - type: object - status: - description: GlobalTenantResourceStatus defines the observed state of - GlobalTenantResource. - properties: - processedItems: - description: List of the replicated resources for the given TenantResource. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - required: - - kind - - name - - namespace - type: object - type: array - selectedTenants: - description: List of Tenants addressed by the GlobalTenantResource. - items: - type: string - type: array - required: - - processedItems - - selectedTenants - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/bases/capsule.clastix.io_tenantresources.yaml b/config/crd/bases/capsule.clastix.io_tenantresources.yaml deleted file mode 100644 index 4e48c0ef..00000000 --- a/config/crd/bases/capsule.clastix.io_tenantresources.yaml +++ /dev/null @@ -1,246 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.15.0 - name: tenantresources.capsule.clastix.io -spec: - group: capsule.clastix.io - names: - kind: TenantResource - listKind: TenantResourceList - plural: tenantresources - singular: tenantresource - scope: Namespaced - versions: - - name: v1beta2 - schema: - openAPIV3Schema: - description: |- - TenantResource allows a Tenant Owner, if enabled with proper RBAC, to propagate resources in its Namespace. - The object must be deployed in a Tenant Namespace, and cannot reference object living in non-Tenant namespaces. - For such cases, the GlobalTenantResource must be used. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: TenantResourceSpec defines the desired state of TenantResource. - properties: - pruningOnDelete: - default: true - description: |- - When the replicated resource manifest is deleted, all the objects replicated so far will be automatically deleted. - Disable this to keep replicated resources although the deletion of the replication manifest. - type: boolean - resources: - description: Defines the rules to select targeting Namespace, along - with the objects that must be replicated. - items: - properties: - additionalMetadata: - description: |- - Besides the Capsule metadata required by TenantResource controller, defines additional metadata that must be - added to the replicated resources. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - description: |- - Defines the Namespace selector to select the Tenant Namespaces on which the resources must be propagated. - In case of nil value, all the Tenant Namespaces are targeted. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespacedItems: - description: List of the resources already existing in other - Namespaces that must be replicated. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - selector: - description: Label selector used to select the given resources - in the given Namespace. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - kind - - namespace - - selector - type: object - type: array - rawItems: - description: List of raw resources that must be replicated. - items: - type: object - x-kubernetes-embedded-resource: true - x-kubernetes-preserve-unknown-fields: true - type: array - type: object - type: array - resyncPeriod: - default: 60s - description: |- - Define the period of time upon a second reconciliation must be invoked. - Keep in mind that any change to the manifests will trigger a new reconciliation. - type: string - required: - - resources - - resyncPeriod - type: object - status: - description: TenantResourceStatus defines the observed state of TenantResource. - properties: - processedItems: - description: List of the replicated resources for the given TenantResource. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - kind: - description: |- - Kind of the referent. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - namespace: - description: |- - Namespace of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - type: string - required: - - kind - - name - - namespace - type: object - type: array - required: - - processedItems - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/bases/capsule.clastix.io_tenants.yaml b/config/crd/bases/capsule.clastix.io_tenants.yaml deleted file mode 100644 index c073502f..00000000 --- a/config/crd/bases/capsule.clastix.io_tenants.yaml +++ /dev/null @@ -1,2345 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.15.0 - name: tenants.capsule.clastix.io -spec: - group: capsule.clastix.io - names: - kind: Tenant - listKind: TenantList - plural: tenants - shortNames: - - tnt - singular: tenant - scope: Cluster - versions: - - additionalPrinterColumns: - - description: The actual state of the Tenant - jsonPath: .status.state - name: State - type: string - - description: The max amount of Namespaces can be created - jsonPath: .spec.namespaceOptions.quota - name: Namespace quota - type: integer - - description: The total amount of Namespaces in use - jsonPath: .status.size - name: Namespace count - type: integer - - description: Node Selector applied to Pods - jsonPath: .spec.nodeSelector - name: Node selector - type: string - - description: Age - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: Tenant is the Schema for the tenants API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: TenantSpec defines the desired state of Tenant. - properties: - additionalRoleBindings: - description: Specifies additional RoleBindings assigned to the Tenant. - Capsule will ensure that all namespaces in the Tenant always contain - the RoleBinding for the given ClusterRole. Optional. - items: - properties: - clusterRoleName: - type: string - subjects: - description: kubebuilder:validation:Minimum=1 - items: - description: |- - 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. - properties: - apiGroup: - description: |- - 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. - type: string - kind: - description: |- - 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. - type: string - name: - description: Name of the object being referenced. - type: string - namespace: - description: |- - 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. - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - type: array - required: - - clusterRoleName - - subjects - type: object - type: array - containerRegistries: - description: Specifies the trusted Image Registries assigned to the - Tenant. Capsule assures that all Pods resources created in the Tenant - can use only one of the allowed trusted registries. Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - imagePullPolicies: - description: Specify the allowed values for the imagePullPolicies - option in Pod resources. Capsule assures that all Pod resources - created in the Tenant can use only one of the allowed policy. Optional. - items: - enum: - - Always - - Never - - IfNotPresent - type: string - type: array - ingressOptions: - description: Specifies options for the Ingress resources, such as - allowed hostnames and IngressClass. Optional. - properties: - allowedClasses: - description: Specifies the allowed IngressClasses assigned to - the Tenant. Capsule assures that all Ingress resources created - in the Tenant can use only one of the allowed IngressClasses. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - allowedHostnames: - description: Specifies the allowed hostnames in Ingresses for - the given Tenant. Capsule assures that all Ingress resources - created in the Tenant can use only one of the allowed hostnames. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - hostnameCollisionScope: - default: Disabled - description: |- - Defines the scope of hostname collision check performed when Tenant Owners create Ingress with allowed hostnames. - - - - Cluster: disallow the creation of an Ingress if the pair hostname and path is already used across the Namespaces managed by Capsule. - - - - Tenant: disallow the creation of an Ingress if the pair hostname and path is already used across the Namespaces of the Tenant. - - - - Namespace: disallow the creation of an Ingress if the pair hostname and path is already used in the Ingress Namespace. - - - Optional. - enum: - - Cluster - - Tenant - - Namespace - - Disabled - type: string - type: object - limitRanges: - description: Specifies the resource min/max usage restrictions to - the Tenant. The assigned values are inherited by any namespace created - in the Tenant. Optional. - properties: - items: - items: - description: LimitRangeSpec defines a min/max usage limit for - resources that match on kind. - properties: - limits: - description: Limits is the list of LimitRangeItem objects - that are enforced. - items: - description: LimitRangeItem defines a min/max usage limit - for any resource that matches on kind. - properties: - default: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Default resource requirement limit value - by resource name if resource limit is omitted. - type: object - defaultRequest: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: DefaultRequest is the default resource - requirement request value by resource name if resource - request is omitted. - type: object - max: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Max usage constraints on this kind by - resource name. - type: object - maxLimitRequestRatio: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: MaxLimitRequestRatio if specified, the - named resource must have a request and limit that - are both non-zero where limit divided by request - is less than or equal to the enumerated value; this - represents the max burst for the named resource. - type: object - min: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Min usage constraints on this kind by - resource name. - type: object - type: - description: Type of resource that this limit applies - to. - type: string - required: - - type - type: object - type: array - x-kubernetes-list-type: atomic - required: - - limits - type: object - type: array - type: object - namespaceOptions: - description: Specifies options for the Namespaces, such as additional - metadata or maximum number of namespaces allowed for that Tenant. - Once the namespace quota assigned to the Tenant has been reached, - the Tenant owner cannot create further namespaces. Optional. - properties: - additionalMetadata: - description: Specifies additional labels and annotations the Capsule - operator places on any Namespace resource in the Tenant. Optional. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - quota: - description: Specifies the maximum number of namespaces allowed - for that Tenant. Once the namespace quota assigned to the Tenant - has been reached, the Tenant owner cannot create further namespaces. - Optional. - format: int32 - minimum: 1 - type: integer - type: object - networkPolicies: - description: Specifies the NetworkPolicies assigned to the Tenant. - The assigned NetworkPolicies are inherited by any namespace created - in the Tenant. Optional. - properties: - items: - items: - description: NetworkPolicySpec provides the specification of - a NetworkPolicy - properties: - egress: - description: |- - egress is a list of egress rules to be applied to the selected pods. Outgoing traffic - is allowed if there are no NetworkPolicies selecting the pod (and cluster policy - otherwise allows the traffic), OR if the traffic matches at least one egress rule - across all of the NetworkPolicy objects whose podSelector matches the pod. If - this field is empty then this NetworkPolicy limits all outgoing traffic (and serves - solely to ensure that the pods it selects are isolated by default). - This field is beta-level in 1.8 - items: - description: |- - NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods - matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. - This type is beta-level in 1.8 - properties: - ports: - description: |- - ports is a list of destination ports for outgoing traffic. - Each item in this list is combined using a logical OR. If this field is - empty or missing, this rule matches all ports (traffic not restricted by port). - If this field is present and contains at least one item, then this rule allows - traffic only if the traffic matches at least one port in the list. - items: - description: NetworkPolicyPort describes a port - to allow traffic on - properties: - endPort: - description: |- - endPort indicates that the range of ports from port to endPort if set, inclusive, - should be allowed by the policy. This field cannot be defined if the port field - is not defined or if the port field is defined as a named (string) port. - The endPort must be equal or greater than port. - format: int32 - type: integer - port: - anyOf: - - type: integer - - type: string - description: |- - port represents the port on the given protocol. This can either be a numerical or named - port on a pod. If this field is not provided, this matches all port names and - numbers. - If present, only traffic on the specified protocol AND port will be matched. - x-kubernetes-int-or-string: true - protocol: - default: TCP - description: |- - protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. - If not specified, this field defaults to TCP. - type: string - type: object - type: array - x-kubernetes-list-type: atomic - to: - description: |- - to is a list of destinations for outgoing traffic of pods selected for this rule. - Items in this list are combined using a logical OR operation. If this field is - empty or missing, this rule matches all destinations (traffic not restricted by - destination). If this field is present and contains at least one item, this rule - allows traffic only if the traffic matches at least one item in the to list. - items: - description: |- - NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of - fields are allowed - properties: - ipBlock: - description: |- - ipBlock defines policy on a particular IPBlock. If this field is set then - neither of the other fields can be. - properties: - cidr: - description: |- - cidr is a string representing the IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - type: string - except: - description: |- - except is a slice of CIDRs that should not be included within an IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - Except values will be rejected if they are outside the cidr range - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - cidr - type: object - namespaceSelector: - description: |- - namespaceSelector selects namespaces using cluster-scoped labels. This field follows - standard label selector semantics; if present but empty, it selects all namespaces. - - - If podSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the namespaces selected by namespaceSelector. - Otherwise it selects all pods in the namespaces selected by namespaceSelector. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - podSelector: - description: |- - podSelector is a label selector which selects pods. This field follows standard label - selector semantics; if present but empty, it selects all pods. - - - If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the Namespaces selected by NamespaceSelector. - Otherwise it selects the pods matching podSelector in the policy's own namespace. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - ingress: - description: |- - ingress is a list of ingress rules to be applied to the selected pods. - Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod - (and cluster policy otherwise allows the traffic), OR if the traffic source is - the pod's local node, OR if the traffic matches at least one ingress rule - across all of the NetworkPolicy objects whose podSelector matches the pod. If - this field is empty then this NetworkPolicy does not allow any traffic (and serves - solely to ensure that the pods it selects are isolated by default) - items: - description: |- - NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods - matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from. - properties: - from: - description: |- - from is a list of sources which should be able to access the pods selected for this rule. - Items in this list are combined using a logical OR operation. If this field is - empty or missing, this rule matches all sources (traffic not restricted by - source). If this field is present and contains at least one item, this rule - allows traffic only if the traffic matches at least one item in the from list. - items: - description: |- - NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of - fields are allowed - properties: - ipBlock: - description: |- - ipBlock defines policy on a particular IPBlock. If this field is set then - neither of the other fields can be. - properties: - cidr: - description: |- - cidr is a string representing the IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - type: string - except: - description: |- - except is a slice of CIDRs that should not be included within an IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - Except values will be rejected if they are outside the cidr range - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - cidr - type: object - namespaceSelector: - description: |- - namespaceSelector selects namespaces using cluster-scoped labels. This field follows - standard label selector semantics; if present but empty, it selects all namespaces. - - - If podSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the namespaces selected by namespaceSelector. - Otherwise it selects all pods in the namespaces selected by namespaceSelector. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - podSelector: - description: |- - podSelector is a label selector which selects pods. This field follows standard label - selector semantics; if present but empty, it selects all pods. - - - If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the Namespaces selected by NamespaceSelector. - Otherwise it selects the pods matching podSelector in the policy's own namespace. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - ports: - description: |- - ports is a list of ports which should be made accessible on the pods selected for - this rule. Each item in this list is combined using a logical OR. If this field is - empty or missing, this rule matches all ports (traffic not restricted by port). - If this field is present and contains at least one item, then this rule allows - traffic only if the traffic matches at least one port in the list. - items: - description: NetworkPolicyPort describes a port - to allow traffic on - properties: - endPort: - description: |- - endPort indicates that the range of ports from port to endPort if set, inclusive, - should be allowed by the policy. This field cannot be defined if the port field - is not defined or if the port field is defined as a named (string) port. - The endPort must be equal or greater than port. - format: int32 - type: integer - port: - anyOf: - - type: integer - - type: string - description: |- - port represents the port on the given protocol. This can either be a numerical or named - port on a pod. If this field is not provided, this matches all port names and - numbers. - If present, only traffic on the specified protocol AND port will be matched. - x-kubernetes-int-or-string: true - protocol: - default: TCP - description: |- - protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. - If not specified, this field defaults to TCP. - type: string - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - podSelector: - description: |- - podSelector selects the pods to which this NetworkPolicy object applies. - The array of ingress rules is applied to any pods selected by this field. - Multiple network policies can select the same set of pods. In this case, - the ingress rules for each are combined additively. - This field is NOT optional and follows standard label selector semantics. - An empty podSelector matches all pods in this namespace. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - policyTypes: - description: |- - policyTypes is a list of rule types that the NetworkPolicy relates to. - Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. - If this field is not specified, it will default based on the existence of ingress or egress rules; - policies that contain an egress section are assumed to affect egress, and all policies - (whether or not they contain an ingress section) are assumed to affect ingress. - If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. - Likewise, if you want to write a policy that specifies that no egress is allowed, - you must specify a policyTypes value that include "Egress" (since such a policy would not include - an egress section and would otherwise default to just [ "Ingress" ]). - This field is beta-level in 1.8 - items: - description: |- - PolicyType string describes the NetworkPolicy type - This type is beta-level in 1.8 - type: string - type: array - x-kubernetes-list-type: atomic - required: - - podSelector - type: object - type: array - type: object - nodeSelector: - additionalProperties: - type: string - description: Specifies the label to control the placement of pods - on a given pool of worker nodes. All namespaces created within the - Tenant will have the node selector annotation. This annotation tells - the Kubernetes scheduler to place pods on the nodes having the selector - label. Optional. - type: object - owners: - description: Specifies the owners of the Tenant. Mandatory. - items: - properties: - kind: - description: Kind of tenant owner. Possible values are "User", - "Group", and "ServiceAccount" - enum: - - User - - Group - - ServiceAccount - type: string - name: - description: Name of tenant owner. - type: string - proxySettings: - description: Proxy settings for tenant owner. - items: - properties: - kind: - enum: - - Nodes - - StorageClasses - - IngressClasses - - PriorityClasses - type: string - operations: - items: - enum: - - List - - Update - - Delete - type: string - type: array - required: - - kind - - operations - type: object - type: array - required: - - kind - - name - type: object - type: array - priorityClasses: - description: Specifies the allowed priorityClasses assigned to the - Tenant. Capsule assures that all Pods resources created in the Tenant - can use only one of the allowed PriorityClasses. Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - resourceQuotas: - description: Specifies a list of ResourceQuota resources assigned - to the Tenant. The assigned values are inherited by any namespace - created in the Tenant. The Capsule operator aggregates ResourceQuota - at Tenant level, so that the hard quota is never crossed for the - given Tenant. This permits the Tenant owner to consume resources - in the Tenant regardless of the namespace. Optional. - properties: - items: - items: - description: ResourceQuotaSpec defines the desired hard limits - to enforce for Quota. - properties: - hard: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - hard is the set of desired hard limits for each named resource. - More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ - type: object - scopeSelector: - description: |- - scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota - but expressed using ScopeSelectorOperator in combination with possible values. - For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. - properties: - matchExpressions: - description: A list of scope selector requirements by - scope of the resources. - items: - description: |- - A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator - that relates the scope name and values. - properties: - operator: - description: |- - Represents a scope's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. - type: string - scopeName: - description: The name of the scope that the selector - applies to. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - operator - - scopeName - type: object - type: array - x-kubernetes-list-type: atomic - type: object - x-kubernetes-map-type: atomic - scopes: - description: |- - A collection of filters that must match each object tracked by a quota. - If not specified, the quota matches all objects. - items: - description: A ResourceQuotaScope defines a filter that - must match each object tracked by a quota - type: string - type: array - x-kubernetes-list-type: atomic - type: object - type: array - scope: - default: Tenant - description: Define if the Resource Budget should compute resource - across all Namespaces in the Tenant or individually per cluster. - Default is Tenant - enum: - - Tenant - - Namespace - type: string - type: object - serviceOptions: - description: Specifies options for the Service, such as additional - metadata or block of certain type of Services. Optional. - properties: - additionalMetadata: - description: Specifies additional labels and annotations the Capsule - operator places on any Service resource in the Tenant. Optional. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - allowedServices: - description: Block or deny certain type of Services. Optional. - properties: - externalName: - default: true - description: Specifies if ExternalName service type resources - are allowed for the Tenant. Default is true. Optional. - type: boolean - loadBalancer: - default: true - description: Specifies if LoadBalancer service type resources - are allowed for the Tenant. Default is true. Optional. - type: boolean - nodePort: - default: true - description: Specifies if NodePort service type resources - are allowed for the Tenant. Default is true. Optional. - type: boolean - type: object - externalIPs: - description: Specifies the external IPs that can be used in Services - with type ClusterIP. An empty list means no IPs are allowed. - Optional. - properties: - allowed: - items: - pattern: ^([0-9]{1,3}.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$ - type: string - type: array - required: - - allowed - type: object - forbiddenAnnotations: - description: Define the annotations that a Tenant Owner cannot - set for their Service resources. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - forbiddenLabels: - description: Define the labels that a Tenant Owner cannot set - for their Service resources. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - type: object - storageClasses: - description: Specifies the allowed StorageClasses assigned to the - Tenant. Capsule assures that all PersistentVolumeClaim resources - created in the Tenant can use only one of the allowed StorageClasses. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - required: - - owners - type: object - status: - description: Returns the observed state of the Tenant. - properties: - namespaces: - description: List of namespaces assigned to the Tenant. - items: - type: string - type: array - size: - description: How many namespaces are assigned to the Tenant. - type: integer - state: - default: Active - description: The operational state of the Tenant. Possible values - are "Active", "Cordoned". - enum: - - Cordoned - - Active - type: string - required: - - size - - state - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - description: The actual state of the Tenant - jsonPath: .status.state - name: State - type: string - - description: The max amount of Namespaces can be created - jsonPath: .spec.namespaceOptions.quota - name: Namespace quota - type: integer - - description: The total amount of Namespaces in use - jsonPath: .status.size - name: Namespace count - type: integer - - description: Node Selector applied to Pods - jsonPath: .spec.nodeSelector - name: Node selector - type: string - - description: Age - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta2 - schema: - openAPIV3Schema: - description: Tenant is the Schema for the tenants API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: TenantSpec defines the desired state of Tenant. - properties: - additionalRoleBindings: - description: Specifies additional RoleBindings assigned to the Tenant. - Capsule will ensure that all namespaces in the Tenant always contain - the RoleBinding for the given ClusterRole. Optional. - items: - properties: - clusterRoleName: - type: string - subjects: - description: kubebuilder:validation:Minimum=1 - items: - description: |- - 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. - properties: - apiGroup: - description: |- - 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. - type: string - kind: - description: |- - 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. - type: string - name: - description: Name of the object being referenced. - type: string - namespace: - description: |- - 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. - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - type: array - required: - - clusterRoleName - - subjects - type: object - type: array - containerRegistries: - description: Specifies the trusted Image Registries assigned to the - Tenant. Capsule assures that all Pods resources created in the Tenant - can use only one of the allowed trusted registries. Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - cordoned: - default: false - description: Toggling the Tenant resources cordoning, when enable - resources cannot be deleted. - type: boolean - imagePullPolicies: - description: Specify the allowed values for the imagePullPolicies - option in Pod resources. Capsule assures that all Pod resources - created in the Tenant can use only one of the allowed policy. Optional. - items: - enum: - - Always - - Never - - IfNotPresent - type: string - type: array - ingressOptions: - description: Specifies options for the Ingress resources, such as - allowed hostnames and IngressClass. Optional. - properties: - allowWildcardHostnames: - description: Toggles the ability for Ingress resources created - in a Tenant to have a hostname wildcard. - type: boolean - allowedClasses: - description: |- - Specifies the allowed IngressClasses assigned to the Tenant. - Capsule assures that all Ingress resources created in the Tenant can use only one of the allowed IngressClasses. - A default value can be specified, and all the Ingress resources created will inherit the declared class. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - default: - type: string - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - allowedHostnames: - description: Specifies the allowed hostnames in Ingresses for - the given Tenant. Capsule assures that all Ingress resources - created in the Tenant can use only one of the allowed hostnames. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - type: object - hostnameCollisionScope: - default: Disabled - description: |- - Defines the scope of hostname collision check performed when Tenant Owners create Ingress with allowed hostnames. - - - - Cluster: disallow the creation of an Ingress if the pair hostname and path is already used across the Namespaces managed by Capsule. - - - - Tenant: disallow the creation of an Ingress if the pair hostname and path is already used across the Namespaces of the Tenant. - - - - Namespace: disallow the creation of an Ingress if the pair hostname and path is already used in the Ingress Namespace. - - - Optional. - enum: - - Cluster - - Tenant - - Namespace - - Disabled - type: string - type: object - limitRanges: - description: Specifies the resource min/max usage restrictions to - the Tenant. The assigned values are inherited by any namespace created - in the Tenant. Optional. - properties: - items: - items: - description: LimitRangeSpec defines a min/max usage limit for - resources that match on kind. - properties: - limits: - description: Limits is the list of LimitRangeItem objects - that are enforced. - items: - description: LimitRangeItem defines a min/max usage limit - for any resource that matches on kind. - properties: - default: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Default resource requirement limit value - by resource name if resource limit is omitted. - type: object - defaultRequest: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: DefaultRequest is the default resource - requirement request value by resource name if resource - request is omitted. - type: object - max: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Max usage constraints on this kind by - resource name. - type: object - maxLimitRequestRatio: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: MaxLimitRequestRatio if specified, the - named resource must have a request and limit that - are both non-zero where limit divided by request - is less than or equal to the enumerated value; this - represents the max burst for the named resource. - type: object - min: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: Min usage constraints on this kind by - resource name. - type: object - type: - description: Type of resource that this limit applies - to. - type: string - required: - - type - type: object - type: array - x-kubernetes-list-type: atomic - required: - - limits - type: object - type: array - type: object - namespaceOptions: - description: Specifies options for the Namespaces, such as additional - metadata or maximum number of namespaces allowed for that Tenant. - Once the namespace quota assigned to the Tenant has been reached, - the Tenant owner cannot create further namespaces. Optional. - properties: - additionalMetadata: - description: Specifies additional labels and annotations the Capsule - operator places on any Namespace resource in the Tenant. Optional. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - forbiddenAnnotations: - description: Define the annotations that a Tenant Owner cannot - set for their Namespace resources. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - forbiddenLabels: - description: Define the labels that a Tenant Owner cannot set - for their Namespace resources. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - quota: - description: Specifies the maximum number of namespaces allowed - for that Tenant. Once the namespace quota assigned to the Tenant - has been reached, the Tenant owner cannot create further namespaces. - Optional. - format: int32 - minimum: 1 - type: integer - type: object - networkPolicies: - description: Specifies the NetworkPolicies assigned to the Tenant. - The assigned NetworkPolicies are inherited by any namespace created - in the Tenant. Optional. - properties: - items: - items: - description: NetworkPolicySpec provides the specification of - a NetworkPolicy - properties: - egress: - description: |- - egress is a list of egress rules to be applied to the selected pods. Outgoing traffic - is allowed if there are no NetworkPolicies selecting the pod (and cluster policy - otherwise allows the traffic), OR if the traffic matches at least one egress rule - across all of the NetworkPolicy objects whose podSelector matches the pod. If - this field is empty then this NetworkPolicy limits all outgoing traffic (and serves - solely to ensure that the pods it selects are isolated by default). - This field is beta-level in 1.8 - items: - description: |- - NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods - matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. - This type is beta-level in 1.8 - properties: - ports: - description: |- - ports is a list of destination ports for outgoing traffic. - Each item in this list is combined using a logical OR. If this field is - empty or missing, this rule matches all ports (traffic not restricted by port). - If this field is present and contains at least one item, then this rule allows - traffic only if the traffic matches at least one port in the list. - items: - description: NetworkPolicyPort describes a port - to allow traffic on - properties: - endPort: - description: |- - endPort indicates that the range of ports from port to endPort if set, inclusive, - should be allowed by the policy. This field cannot be defined if the port field - is not defined or if the port field is defined as a named (string) port. - The endPort must be equal or greater than port. - format: int32 - type: integer - port: - anyOf: - - type: integer - - type: string - description: |- - port represents the port on the given protocol. This can either be a numerical or named - port on a pod. If this field is not provided, this matches all port names and - numbers. - If present, only traffic on the specified protocol AND port will be matched. - x-kubernetes-int-or-string: true - protocol: - default: TCP - description: |- - protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. - If not specified, this field defaults to TCP. - type: string - type: object - type: array - x-kubernetes-list-type: atomic - to: - description: |- - to is a list of destinations for outgoing traffic of pods selected for this rule. - Items in this list are combined using a logical OR operation. If this field is - empty or missing, this rule matches all destinations (traffic not restricted by - destination). If this field is present and contains at least one item, this rule - allows traffic only if the traffic matches at least one item in the to list. - items: - description: |- - NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of - fields are allowed - properties: - ipBlock: - description: |- - ipBlock defines policy on a particular IPBlock. If this field is set then - neither of the other fields can be. - properties: - cidr: - description: |- - cidr is a string representing the IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - type: string - except: - description: |- - except is a slice of CIDRs that should not be included within an IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - Except values will be rejected if they are outside the cidr range - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - cidr - type: object - namespaceSelector: - description: |- - namespaceSelector selects namespaces using cluster-scoped labels. This field follows - standard label selector semantics; if present but empty, it selects all namespaces. - - - If podSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the namespaces selected by namespaceSelector. - Otherwise it selects all pods in the namespaces selected by namespaceSelector. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - podSelector: - description: |- - podSelector is a label selector which selects pods. This field follows standard label - selector semantics; if present but empty, it selects all pods. - - - If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the Namespaces selected by NamespaceSelector. - Otherwise it selects the pods matching podSelector in the policy's own namespace. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - ingress: - description: |- - ingress is a list of ingress rules to be applied to the selected pods. - Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod - (and cluster policy otherwise allows the traffic), OR if the traffic source is - the pod's local node, OR if the traffic matches at least one ingress rule - across all of the NetworkPolicy objects whose podSelector matches the pod. If - this field is empty then this NetworkPolicy does not allow any traffic (and serves - solely to ensure that the pods it selects are isolated by default) - items: - description: |- - NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods - matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from. - properties: - from: - description: |- - from is a list of sources which should be able to access the pods selected for this rule. - Items in this list are combined using a logical OR operation. If this field is - empty or missing, this rule matches all sources (traffic not restricted by - source). If this field is present and contains at least one item, this rule - allows traffic only if the traffic matches at least one item in the from list. - items: - description: |- - NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of - fields are allowed - properties: - ipBlock: - description: |- - ipBlock defines policy on a particular IPBlock. If this field is set then - neither of the other fields can be. - properties: - cidr: - description: |- - cidr is a string representing the IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - type: string - except: - description: |- - except is a slice of CIDRs that should not be included within an IPBlock - Valid examples are "192.168.1.0/24" or "2001:db8::/64" - Except values will be rejected if they are outside the cidr range - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - cidr - type: object - namespaceSelector: - description: |- - namespaceSelector selects namespaces using cluster-scoped labels. This field follows - standard label selector semantics; if present but empty, it selects all namespaces. - - - If podSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the namespaces selected by namespaceSelector. - Otherwise it selects all pods in the namespaces selected by namespaceSelector. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - podSelector: - description: |- - podSelector is a label selector which selects pods. This field follows standard label - selector semantics; if present but empty, it selects all pods. - - - If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects - the pods matching podSelector in the Namespaces selected by NamespaceSelector. - Otherwise it selects the pods matching podSelector in the policy's own namespace. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - ports: - description: |- - ports is a list of ports which should be made accessible on the pods selected for - this rule. Each item in this list is combined using a logical OR. If this field is - empty or missing, this rule matches all ports (traffic not restricted by port). - If this field is present and contains at least one item, then this rule allows - traffic only if the traffic matches at least one port in the list. - items: - description: NetworkPolicyPort describes a port - to allow traffic on - properties: - endPort: - description: |- - endPort indicates that the range of ports from port to endPort if set, inclusive, - should be allowed by the policy. This field cannot be defined if the port field - is not defined or if the port field is defined as a named (string) port. - The endPort must be equal or greater than port. - format: int32 - type: integer - port: - anyOf: - - type: integer - - type: string - description: |- - port represents the port on the given protocol. This can either be a numerical or named - port on a pod. If this field is not provided, this matches all port names and - numbers. - If present, only traffic on the specified protocol AND port will be matched. - x-kubernetes-int-or-string: true - protocol: - default: TCP - description: |- - protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. - If not specified, this field defaults to TCP. - type: string - type: object - type: array - x-kubernetes-list-type: atomic - type: object - type: array - x-kubernetes-list-type: atomic - podSelector: - description: |- - podSelector selects the pods to which this NetworkPolicy object applies. - The array of ingress rules is applied to any pods selected by this field. - Multiple network policies can select the same set of pods. In this case, - the ingress rules for each are combined additively. - This field is NOT optional and follows standard label selector semantics. - An empty podSelector matches all pods in this namespace. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - policyTypes: - description: |- - policyTypes is a list of rule types that the NetworkPolicy relates to. - Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. - If this field is not specified, it will default based on the existence of ingress or egress rules; - policies that contain an egress section are assumed to affect egress, and all policies - (whether or not they contain an ingress section) are assumed to affect ingress. - If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. - Likewise, if you want to write a policy that specifies that no egress is allowed, - you must specify a policyTypes value that include "Egress" (since such a policy would not include - an egress section and would otherwise default to just [ "Ingress" ]). - This field is beta-level in 1.8 - items: - description: |- - PolicyType string describes the NetworkPolicy type - This type is beta-level in 1.8 - type: string - type: array - x-kubernetes-list-type: atomic - required: - - podSelector - type: object - type: array - type: object - nodeSelector: - additionalProperties: - type: string - description: Specifies the label to control the placement of pods - on a given pool of worker nodes. All namespaces created within the - Tenant will have the node selector annotation. This annotation tells - the Kubernetes scheduler to place pods on the nodes having the selector - label. Optional. - type: object - owners: - description: Specifies the owners of the Tenant. Mandatory. - items: - properties: - clusterRoles: - default: - - admin - - capsule-namespace-deleter - description: Defines additional cluster-roles for the specific - Owner. - items: - type: string - type: array - kind: - description: Kind of tenant owner. Possible values are "User", - "Group", and "ServiceAccount" - enum: - - User - - Group - - ServiceAccount - type: string - name: - description: Name of tenant owner. - type: string - proxySettings: - description: Proxy settings for tenant owner. - items: - properties: - kind: - enum: - - Nodes - - StorageClasses - - IngressClasses - - PriorityClasses - - RuntimeClasses - - PersistentVolumes - type: string - operations: - items: - enum: - - List - - Update - - Delete - type: string - type: array - required: - - kind - - operations - type: object - type: array - required: - - kind - - name - type: object - type: array - podOptions: - description: Specifies options for the Pods deployed in the Tenant - namespaces, such as additional metadata. - properties: - additionalMetadata: - description: Specifies additional labels and annotations the Capsule - operator places on any Pod resource in the Tenant. Optional. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - type: object - preventDeletion: - default: false - description: |- - Prevent accidental deletion of the Tenant. - When enabled, the deletion request will be declined. - type: boolean - priorityClasses: - description: |- - Specifies the allowed priorityClasses assigned to the Tenant. - Capsule assures that all Pods resources created in the Tenant can use only one of the allowed PriorityClasses. - A default value can be specified, and all the Pod resources created will inherit the declared class. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - default: - type: string - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - resourceQuotas: - description: Specifies a list of ResourceQuota resources assigned - to the Tenant. The assigned values are inherited by any namespace - created in the Tenant. The Capsule operator aggregates ResourceQuota - at Tenant level, so that the hard quota is never crossed for the - given Tenant. This permits the Tenant owner to consume resources - in the Tenant regardless of the namespace. Optional. - properties: - items: - items: - description: ResourceQuotaSpec defines the desired hard limits - to enforce for Quota. - properties: - hard: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - hard is the set of desired hard limits for each named resource. - More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ - type: object - scopeSelector: - description: |- - scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota - but expressed using ScopeSelectorOperator in combination with possible values. - For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. - properties: - matchExpressions: - description: A list of scope selector requirements by - scope of the resources. - items: - description: |- - A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator - that relates the scope name and values. - properties: - operator: - description: |- - Represents a scope's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. - type: string - scopeName: - description: The name of the scope that the selector - applies to. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - operator - - scopeName - type: object - type: array - x-kubernetes-list-type: atomic - type: object - x-kubernetes-map-type: atomic - scopes: - description: |- - A collection of filters that must match each object tracked by a quota. - If not specified, the quota matches all objects. - items: - description: A ResourceQuotaScope defines a filter that - must match each object tracked by a quota - type: string - type: array - x-kubernetes-list-type: atomic - type: object - type: array - scope: - default: Tenant - description: Define if the Resource Budget should compute resource - across all Namespaces in the Tenant or individually per cluster. - Default is Tenant - enum: - - Tenant - - Namespace - type: string - type: object - runtimeClasses: - description: |- - Specifies the allowed RuntimeClasses assigned to the Tenant. - Capsule assures that all Pods resources created in the Tenant can use only one of the allowed RuntimeClasses. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - serviceOptions: - description: Specifies options for the Service, such as additional - metadata or block of certain type of Services. Optional. - properties: - additionalMetadata: - description: Specifies additional labels and annotations the Capsule - operator places on any Service resource in the Tenant. Optional. - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - type: object - allowedServices: - description: Block or deny certain type of Services. Optional. - properties: - externalName: - default: true - description: Specifies if ExternalName service type resources - are allowed for the Tenant. Default is true. Optional. - type: boolean - loadBalancer: - default: true - description: Specifies if LoadBalancer service type resources - are allowed for the Tenant. Default is true. Optional. - type: boolean - nodePort: - default: true - description: Specifies if NodePort service type resources - are allowed for the Tenant. Default is true. Optional. - type: boolean - type: object - externalIPs: - description: Specifies the external IPs that can be used in Services - with type ClusterIP. An empty list means no IPs are allowed. - Optional. - properties: - allowed: - items: - pattern: ^([0-9]{1,3}.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$ - type: string - type: array - required: - - allowed - type: object - forbiddenAnnotations: - description: Define the annotations that a Tenant Owner cannot - set for their Service resources. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - forbiddenLabels: - description: Define the labels that a Tenant Owner cannot set - for their Service resources. - properties: - denied: - items: - type: string - type: array - deniedRegex: - type: string - type: object - type: object - storageClasses: - description: |- - Specifies the allowed StorageClasses assigned to the Tenant. - Capsule assures that all PersistentVolumeClaim resources created in the Tenant can use only one of the allowed StorageClasses. - A default value can be specified, and all the PersistentVolumeClaim resources created will inherit the declared class. - Optional. - properties: - allowed: - items: - type: string - type: array - allowedRegex: - type: string - default: - type: string - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - owners - type: object - status: - description: Returns the observed state of the Tenant. - properties: - namespaces: - description: List of namespaces assigned to the Tenant. - items: - type: string - type: array - size: - description: How many namespaces are assigned to the Tenant. - type: integer - state: - default: Active - description: The operational state of the Tenant. Possible values - are "Active", "Cordoned". - enum: - - Cordoned - - Active - type: string - required: - - size - - state - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml deleted file mode 100644 index 07d5edd3..00000000 --- a/config/crd/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default -resources: -- bases/capsule.clastix.io_tenants.yaml -- bases/capsule.clastix.io_capsuleconfigurations.yaml -- bases/capsule.clastix.io_tenantresources.yaml -- bases/capsule.clastix.io_globaltenantresources.yaml -# +kubebuilder:scaffold:crdkustomizeresource - -# the following config is for teaching kustomize how to do kustomization for CRDs. -configurations: -- kustomizeconfig.yaml - -patchesStrategicMerge: -- patches/webhook_in_tenants.yaml -- patches/webhook_in_capsuleconfiguration.yaml diff --git a/config/crd/kustomizeconfig.yaml b/config/crd/kustomizeconfig.yaml deleted file mode 100644 index ec5c150a..00000000 --- a/config/crd/kustomizeconfig.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is for teaching kustomize how to substitute name and namespace reference in CRD -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: CustomResourceDefinition - version: v1 - group: apiextensions.k8s.io - path: spec/conversion/webhook/clientConfig/service/name - -namespace: -- kind: CustomResourceDefinition - version: v1 - group: apiextensions.k8s.io - path: spec/conversion/webhook/clientConfig/service/namespace - create: false - -varReference: -- path: metadata/annotations diff --git a/config/crd/patches/cainjection_in_globaltenantresources.yaml b/config/crd/patches/cainjection_in_globaltenantresources.yaml deleted file mode 100644 index fdf9c307..00000000 --- a/config/crd/patches/cainjection_in_globaltenantresources.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: globaltenantresources.capsule.clastix.io diff --git a/config/crd/patches/cainjection_in_tenantresources.yaml b/config/crd/patches/cainjection_in_tenantresources.yaml deleted file mode 100644 index e7158ad9..00000000 --- a/config/crd/patches/cainjection_in_tenantresources.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: tenantresources.capsule.clastix.io diff --git a/config/crd/patches/webhook_in_capsuleconfiguration.yaml b/config/crd/patches/webhook_in_capsuleconfiguration.yaml deleted file mode 100644 index b99dc23e..00000000 --- a/config/crd/patches/webhook_in_capsuleconfiguration.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: capsuleconfigurations.capsule.clastix.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1beta1 - - v1beta2 diff --git a/config/crd/patches/webhook_in_globaltenantresources.yaml b/config/crd/patches/webhook_in_globaltenantresources.yaml deleted file mode 100644 index 12cfc50a..00000000 --- a/config/crd/patches/webhook_in_globaltenantresources.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: globaltenantresources.capsule.clastix.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/config/crd/patches/webhook_in_tenantresources.yaml b/config/crd/patches/webhook_in_tenantresources.yaml deleted file mode 100644 index 827ccf34..00000000 --- a/config/crd/patches/webhook_in_tenantresources.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: tenantresources.capsule.clastix.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/config/crd/patches/webhook_in_tenants.yaml b/config/crd/patches/webhook_in_tenants.yaml deleted file mode 100644 index 18288fac..00000000 --- a/config/crd/patches/webhook_in_tenants.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: tenants.capsule.clastix.io -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1beta1 - - v1beta2 diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml deleted file mode 100644 index 7a5a1568..00000000 --- a/config/default/kustomization.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Adds namespace to all resources. -namespace: capsule-system - -# Value of this field is prepended to the -# names of all resources, e.g. a deployment named -# "wordpress" becomes "alices-wordpress". -# Note that it should also match with the prefix (text before '-') of the namespace -# field above. -namePrefix: capsule- - -# Labels to add to all resources and selectors. -#commonLabels: -# someName: someValue - -bases: -- ../crd -- ../rbac -- ../manager -- ../secret -- ../webhook -# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. -#- ../prometheus - -patchesStrategicMerge: -- manager_webhook_patch.yaml diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml deleted file mode 100644 index fcd1daa0..00000000 --- a/config/default/manager_webhook_patch.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager - ports: - - containerPort: 9443 - name: webhook-server - protocol: TCP - - containerPort: 8080 - name: metrics - protocol: TCP - volumeMounts: - - mountPath: /tmp/k8s-webhook-server/serving-certs - name: cert - readOnly: true - volumes: - - name: cert - secret: - defaultMode: 420 - secretName: capsule-tls diff --git a/config/grafana/dashboard.json b/config/grafana/dashboard.json deleted file mode 100644 index 50c43d11..00000000 --- a/config/grafana/dashboard.json +++ /dev/null @@ -1,2138 +0,0 @@ -{ - "__inputs": [ - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "7.5.4" - }, - { - "type": "panel", - "id": "heatmap", - "name": "Heatmap", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": null, - "iteration": 1629463154511, - "links": [], - "panels": [ - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 28, - "panels": [], - "title": "Manager controllers", - "type": "row" - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 21, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeat": "controller_name", - "repeatDirection": "h", - "reverseYBuckets": false, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(workqueue_work_duration_seconds_bucket{job=\"capsule\", name=\"$controller_name\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$controller_name reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 33 - }, - "id": 58, - "panels": [], - "title": "Webhook error rate", - "type": "row" - }, - { - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 0, - "y": 34 - }, - "id": 59, - "options": { - "graph": {}, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - }, - "tooltipOptions": { - "mode": "single" - } - }, - "pluginVersion": "7.5.5", - "repeat": "webhook", - "targets": [ - { - "exemplar": false, - "expr": "sum(irate(controller_runtime_webhook_requests_total{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval])) by (webhook, code)", - "format": "time_series", - "hide": false, - "interval": "", - "legendFormat": "{{ code }}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "$webhook status code", - "type": "timeseries" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 67 - }, - "id": 35, - "panels": [ - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 44 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 37, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeat": "webhook", - "repeatDirection": "h", - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/cordoning", - "value": "/cordoning" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 44 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 79, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/ingresses", - "value": "/ingresses" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 52 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 80, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/namespace-owner-reference", - "value": "/namespace-owner-reference" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 52 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 81, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/namespaces", - "value": "/namespaces" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 60 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 82, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/networkpolicies", - "value": "/networkpolicies" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 60 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 83, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/persistentvolumeclaims", - "value": "/persistentvolumeclaims" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 68 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 84, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/pods", - "value": "/pods" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 68 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 85, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/services", - "value": "/services" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 76 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 86, - "legend": { - "show": false - }, - "maxPerRow": 2, - "pluginVersion": "8.0.1", - "repeatDirection": "h", - "repeatIteration": 1627832445863, - "repeatPanelId": 37, - "reverseYBuckets": false, - "scopedVars": { - "webhook": { - "selected": false, - "text": "/tenants", - "value": "/tenants" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(controller_runtime_webhook_latency_seconds_bucket{job=\"capsule\", webhook=\"$webhook\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "$webhook reconcile latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - } - ], - "title": "Webhooks latency", - "type": "row" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 68 - }, - "id": 26, - "panels": [ - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 0, - "y": 12 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 20, - "legend": { - "show": false - }, - "pluginVersion": "8.0.1", - "repeat": "rest_client_url", - "reverseYBuckets": false, - "scopedVars": { - "rest_client_url": { - "selected": true, - "text": "https://10.96.0.1:443/api/v1/namespaces/%7Bnamespace%7D/configmaps/%7Bname%7D", - "value": "https://10.96.0.1:443/api/v1/namespaces/%7Bnamespace%7D/configmaps/%7Bname%7D" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(rest_client_request_latency_seconds_bucket{job=\"capsule\", url=\"${rest_client_url:raw}\", verb=\"$rest_client_verb\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "{{le}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Latency for ${rest_client_url:raw}", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 6, - "y": 12 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 76, - "legend": { - "show": false - }, - "pluginVersion": "8.0.1", - "repeatIteration": 1627832445863, - "repeatPanelId": 20, - "reverseYBuckets": false, - "scopedVars": { - "rest_client_url": { - "selected": true, - "text": "https://10.96.0.1:443/api/v1/namespaces/%7Bnamespace%7D/events", - "value": "https://10.96.0.1:443/api/v1/namespaces/%7Bnamespace%7D/events" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(rest_client_request_latency_seconds_bucket{job=\"capsule\", url=\"${rest_client_url:raw}\", verb=\"$rest_client_verb\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "{{le}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Latency for ${rest_client_url:raw}", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 12 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 77, - "legend": { - "show": false - }, - "pluginVersion": "8.0.1", - "repeatIteration": 1627832445863, - "repeatPanelId": 20, - "reverseYBuckets": false, - "scopedVars": { - "rest_client_url": { - "selected": true, - "text": "https://10.96.0.1:443/api/v1/namespaces?limit=%7Bvalue%7D&resourceVersion=%7Bvalue%7D", - "value": "https://10.96.0.1:443/api/v1/namespaces?limit=%7Bvalue%7D&resourceVersion=%7Bvalue%7D" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(rest_client_request_latency_seconds_bucket{job=\"capsule\", url=\"${rest_client_url:raw}\", verb=\"$rest_client_verb\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "{{le}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Latency for ${rest_client_url:raw}", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 18, - "y": 12 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 78, - "legend": { - "show": false - }, - "pluginVersion": "8.0.1", - "repeatIteration": 1627832445863, - "repeatPanelId": 20, - "reverseYBuckets": false, - "scopedVars": { - "rest_client_url": { - "selected": true, - "text": "https://10.96.0.1:443/apis/coordination.k8s.io/v1/namespaces/%7Bnamespace%7D/leases/%7Bname%7D", - "value": "https://10.96.0.1:443/apis/coordination.k8s.io/v1/namespaces/%7Bnamespace%7D/leases/%7Bname%7D" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "sum by (le) (increase(rest_client_request_latency_seconds_bucket{job=\"capsule\", url=\"${rest_client_url:raw}\", verb=\"$rest_client_verb\"}[$__rate_interval]))", - "format": "heatmap", - "hide": false, - "interval": "", - "legendFormat": "{{le}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Latency for ${rest_client_url:raw}", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "ms", - "logBase": 1, - "max": null, - "min": "0", - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - } - ], - "title": "REST client latency", - "type": "row" - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 69 - }, - "id": 17, - "panels": [], - "title": "REST client error rate", - "type": "row" - }, - { - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 0, - "y": 70 - }, - "id": 22, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - }, - "tooltipOptions": { - "mode": "single" - } - }, - "pluginVersion": "8.0.1", - "targets": [ - { - "exemplar": false, - "expr": "sum(irate(rest_client_requests_total{job=\"capsule\"}[$__rate_interval])) by (code)", - "format": "time_series", - "hide": false, - "interval": "", - "legendFormat": "{{ code }}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "REST Client status code", - "type": "timeseries" - }, - { - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 12, - "y": 70 - }, - "id": 19, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.4", - "targets": [ - { - "exemplar": false, - "expr": "sum(irate(rest_client_requests_total{job=\"capsule\"}[$__rate_interval])) by (code)", - "format": "time_series", - "hide": false, - "instant": false, - "interval": "", - "legendFormat": " {{ code }}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Rate & Errors", - "type": "stat" - }, - { - "collapsed": false, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 81 - }, - "id": 12, - "panels": [], - "title": "Saturation", - "type": "row" - }, - { - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 7, - "x": 0, - "y": 82 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - }, - "tooltipOptions": { - "mode": "single" - } - }, - "targets": [ - { - "exemplar": true, - "expr": "irate(process_cpu_seconds_total{job=\"capsule\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{ pod }}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "CPU Usage", - "type": "timeseries" - }, - { - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 7, - "x": 7, - "y": 82 - }, - "id": 24, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - }, - "tooltipOptions": { - "mode": "single" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "process_resident_memory_bytes{job=\"capsule\"}", - "interval": "", - "legendFormat": "{{pod}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Memory Usage", - "type": "timeseries" - }, - { - "datasource": "$DS_PROMETHEUS", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "graph": false, - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 7, - "x": 14, - "y": 82 - }, - "id": 33, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - }, - "tooltipOptions": { - "mode": "single" - } - }, - "targets": [ - { - "exemplar": false, - "expr": "go_goroutines{job=\"capsule\"}", - "interval": "", - "legendFormat": "{{pod}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "goroutines", - "type": "timeseries" - }, - { - "datasource": "$DS_PROMETHEUS", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 3, - "x": 21, - "y": 82 - }, - "id": 5, - "options": { - "colorMode": "background", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": { - "valueSize": 80 - }, - "textMode": "value_and_name" - }, - "pluginVersion": "7.5.4", - "targets": [ - { - "exemplar": true, - "expr": "sum(up{job=\"capsule\"})", - "interval": "", - "legendFormat": "Active Controllers", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Stats", - "transparent": true, - "type": "stat" - }, - { - "collapsed": true, - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 90 - }, - "id": 10, - "panels": [ - { - "datasource": "$DS_PROMETHEUS", - "description": "service time to complete needed actions", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 31 - }, - "id": 7, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.5", - "targets": [ - { - "exemplar": true, - "expr": "histogram_quantile(0.99, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"capsule\"}[$__rate_interval])) by (instance, name, le))", - "format": "time_series", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Workqueue latency", - "type": "stat" - }, - { - "datasource": "$DS_PROMETHEUS", - "description": "number of actions per unit time", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 31 - }, - "id": 8, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.5", - "targets": [ - { - "exemplar": true, - "expr": "sum(rate(workqueue_adds_total{job=\"capsule\"}[$__rate_interval])) by (instance, name)", - "format": "time_series", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Workqueue rate", - "type": "stat" - }, - { - "datasource": "$DS_PROMETHEUS", - "description": "number of actions waiting in the queue to be performed", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 31 - }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.5", - "targets": [ - { - "exemplar": false, - "expr": "sum(rate(workqueue_depth{job=\"capsule\"}[$__rate_interval])) by (instance, name)", - "format": "time_series", - "hide": false, - "interval": "", - "legendFormat": "{{name}}", - "queryType": "randomWalk", - "refId": "A" - } - ], - "title": "Workqueue depth", - "type": "stat" - } - ], - "title": "Workqueue", - "type": "row" - } - ], - "refresh": "30s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 0, - "includeAll": false, - "multi": false, - "name": "DS_PROMETHEUS", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "allValue": null, - "current": {}, - "datasource": "$DS_PROMETHEUS", - "definition": "label_values(controller_runtime_active_workers{job=\"capsule\"},controller)", - "description": "Select the underlying Controller to get metrics", - "error": null, - "hide": 0, - "includeAll": false, - "label": "Controller name", - "multi": true, - "name": "controller_name", - "options": [], - "query": { - "query": "label_values(controller_runtime_active_workers{job=\"capsule\"},controller)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$DS_PROMETHEUS", - "definition": "label_values(rest_client_request_latency_seconds_sum{job=\"capsule\"},url)", - "description": "Kubernetes API endpoint the REST client is interacting with", - "error": null, - "hide": 0, - "includeAll": true, - "label": "REST client URL", - "multi": true, - "name": "rest_client_url", - "options": [], - "query": { - "query": "label_values(rest_client_request_latency_seconds_sum{job=\"capsule\"},url)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$DS_PROMETHEUS", - "definition": "label_values(rest_client_request_latency_seconds_sum{job=\"capsule\"},verb)", - "description": "Kubernetes API HTTP verb the REST client is interacting with", - "error": null, - "hide": 0, - "includeAll": false, - "label": "REST client verb", - "multi": false, - "name": "rest_client_verb", - "options": [], - "query": { - "query": "label_values(rest_client_request_latency_seconds_sum{job=\"capsule\"},verb)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "$DS_PROMETHEUS", - "definition": "label_values(controller_runtime_webhook_requests_in_flight{job=\"capsule\"}, webhook)", - "description": "Capsule webhook", - "error": null, - "hide": 0, - "includeAll": true, - "label": "Webhook", - "multi": true, - "name": "webhook", - "options": [], - "query": { - "query": "label_values(controller_runtime_webhook_requests_in_flight{job=\"capsule\"}, webhook)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "capsule", - "uid": "nEFvaoR7z", - "version": 2 -} diff --git a/config/grafana/dashboard.yaml b/config/grafana/dashboard.yaml deleted file mode 100644 index ce96c8b4..00000000 --- a/config/grafana/dashboard.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - # label selector used by Grafana to load the dashboards from Config Maps - grafana_dashboard: "1" - name: capsule-grafana-dashboard diff --git a/config/grafana/kustomization.yaml b/config/grafana/kustomization.yaml deleted file mode 100644 index a6fc8061..00000000 --- a/config/grafana/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -configMapGenerator: -- name: capsule-grafana-dashboard - files: - - dashboard.json -generatorOptions: - disableNameSuffixHash: true -patchesStrategicMerge: -- dashboard.yaml diff --git a/config/manager/configuration.yaml b/config/manager/configuration.yaml deleted file mode 100644 index c5adef5c..00000000 --- a/config/manager/configuration.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: capsule.clastix.io/v1beta2 -kind: CapsuleConfiguration -metadata: - name: default -spec: - userGroups: ["capsule.clastix.io"] - forceTenantPrefix: false - protectedNamespaceRegex: "" - enableTLSReconciler: true diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml deleted file mode 100644 index 150cf7a0..00000000 --- a/config/manager/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -resources: -- configuration.yaml -- manager.yaml -- metrics_service.yaml -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -images: -- name: controller - newName: ghcr.io/projectcapsule/capsule diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml deleted file mode 100644 index 139dda6a..00000000 --- a/config/manager/manager.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - labels: - control-plane: controller-manager - name: system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system - labels: - control-plane: controller-manager -spec: - selector: - matchLabels: - control-plane: controller-manager - replicas: 1 - template: - metadata: - labels: - control-plane: controller-manager - spec: - containers: - - args: - - --enable-leader-election - - --zap-encoder=console - - --zap-log-level=debug - - --configuration-name=capsule-default - env: - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - image: controller - imagePullPolicy: IfNotPresent - name: manager - resources: - limits: - cpu: 200m - memory: 128Mi - requests: - cpu: 200m - memory: 128Mi - terminationGracePeriodSeconds: 10 diff --git a/config/manager/metrics_service.yaml b/config/manager/metrics_service.yaml deleted file mode 100644 index db269f31..00000000 --- a/config/manager/metrics_service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: controller-manager - name: controller-manager-metrics-service - namespace: system -spec: - ports: - - name: metrics - port: 8080 - targetPort: metrics - selector: - control-plane: controller-manager diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml deleted file mode 100644 index ed137168..00000000 --- a/config/prometheus/kustomization.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resources: -- monitor.yaml diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml deleted file mode 100644 index 4cc3984b..00000000 --- a/config/prometheus/monitor.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Prometheus Monitor Service (Metrics) -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: controller-manager - name: capsule-monitor - namespace: system -spec: - endpoints: - - interval: 15s - path: /metrics - port: metrics - jobLabel: controller-manager - namespaceSelector: - selector: - matchLabels: - control-plane: controller-manager diff --git a/config/rbac/globaltenantresource_editor_role.yaml b/config/rbac/globaltenantresource_editor_role.yaml deleted file mode 100644 index 60d87ab1..00000000 --- a/config/rbac/globaltenantresource_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit globaltenantresources. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: globaltenantresource-editor-role -rules: -- apiGroups: - - capsule.clastix.io - resources: - - globaltenantresources - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - capsule.clastix.io - resources: - - globaltenantresources/status - verbs: - - get diff --git a/config/rbac/globaltenantresource_viewer_role.yaml b/config/rbac/globaltenantresource_viewer_role.yaml deleted file mode 100644 index d535a89b..00000000 --- a/config/rbac/globaltenantresource_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view globaltenantresources. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: globaltenantresource-viewer-role -rules: -- apiGroups: - - capsule.clastix.io - resources: - - globaltenantresources - verbs: - - get - - list - - watch -- apiGroups: - - capsule.clastix.io - resources: - - globaltenantresources/status - verbs: - - get diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml deleted file mode 100644 index 2b5343ba..00000000 --- a/config/rbac/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -resources: -- role_binding.yaml -# Uncomment the following 3 lines if you are running Capsule -# in a cluster where [Pod Security Policies](https://kubernetes.io/docs/concepts/policy/pod-security-policy/) -# are enabled. -# - psp_policy.yaml -# - psp_role.yaml -# - psp_role_binding.yaml diff --git a/config/rbac/psp_policy.yaml b/config/rbac/psp_policy.yaml deleted file mode 100644 index 16cbc9c0..00000000 --- a/config/rbac/psp_policy.yaml +++ /dev/null @@ -1,18 +0,0 @@ -kind: PodSecurityPolicy -apiVersion: policy/v1beta1 -metadata: - name: capsule -spec: - fsGroup: - rule: RunAsAny - hostPorts: - - max: 0 - min: 0 - runAsUser: - rule: RunAsAny - seLinux: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - volumes: - - secret diff --git a/config/rbac/psp_role.yaml b/config/rbac/psp_role.yaml deleted file mode 100644 index e56aa21c..00000000 --- a/config/rbac/psp_role.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: capsule-psp -rules: - - apiGroups: ['extensions'] - resources: ['podsecuritypolicies'] - resourceNames: ['capsule-psp'] - verbs: ['use'] diff --git a/config/rbac/psp_role_binding.yaml b/config/rbac/psp_role_binding.yaml deleted file mode 100644 index 6041a6e9..00000000 --- a/config/rbac/psp_role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: capsule-use-psp - namespace: system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: capsule-psp -subjects: - - kind: ServiceAccount - name: default diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml deleted file mode 100644 index 1e2b98f9..00000000 --- a/config/rbac/role_binding.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: manager-rolebinding -roleRef: - kind: ClusterRole - name: cluster-admin - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: default - namespace: system diff --git a/config/rbac/tenantresource_editor_role.yaml b/config/rbac/tenantresource_editor_role.yaml deleted file mode 100644 index 2812649e..00000000 --- a/config/rbac/tenantresource_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit tenantresources. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: tenantresource-editor-role -rules: -- apiGroups: - - capsule.clastix.io - resources: - - tenantresources - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - capsule.clastix.io - resources: - - tenantresources/status - verbs: - - get diff --git a/config/rbac/tenantresource_viewer_role.yaml b/config/rbac/tenantresource_viewer_role.yaml deleted file mode 100644 index b37ea627..00000000 --- a/config/rbac/tenantresource_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view tenantresources. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: tenantresource-viewer-role -rules: -- apiGroups: - - capsule.clastix.io - resources: - - tenantresources - verbs: - - get - - list - - watch -- apiGroups: - - capsule.clastix.io - resources: - - tenantresources/status - verbs: - - get diff --git a/config/samples/capsule_v1beta1_tenant.yaml b/config/samples/capsule_v1beta1_tenant.yaml deleted file mode 100644 index 5093c99b..00000000 --- a/config/samples/capsule_v1beta1_tenant.yaml +++ /dev/null @@ -1,139 +0,0 @@ ---- -apiVersion: capsule.clastix.io/v1beta1 -kind: Tenant -metadata: - name: gas -spec: - additionalRoleBindings: - - - clusterRoleName: tenant-sample-viewer - subjects: - - - kind: User - name: bob - containerRegistries: - allowed: - - docker.io - - quay.io - allowedRegex: ^\w+.gcr.io$ - serviceOptions: - additionalMetadata: - annotations: - capsule.clastix.io/bgp: "true" - labels: - capsule.clastix.io/pool: gas - allowedServices: - nodePort: false - externalName: false - externalIPs: - allowed: - - 10.20.0.0/16 - - "10.96.42.42" - imagePullPolicies: - - Always - ingressOptions: - hostnameCollisionScope: Cluster - allowedClasses: - allowed: - - default - allowedRegex: ^\w+-lb$ - allowedHostnames: - allowed: - - gas.acmecorp.com - allowedRegex: ^.*acmecorp.com$ - limitRanges: - items: - - - limits: - - - max: - cpu: "1" - memory: 1Gi - min: - cpu: 50m - memory: 5Mi - type: Pod - - - default: - cpu: 200m - memory: 100Mi - defaultRequest: - cpu: 100m - memory: 10Mi - max: - cpu: "1" - memory: 1Gi - min: - cpu: 50m - memory: 5Mi - type: Container - - - max: - storage: 10Gi - min: - storage: 1Gi - type: PersistentVolumeClaim - namespaceOptions: - quota: 3 - additionalMetadata: - annotations: - capsule.clastix.io/backup: "false" - labels: - capsule.clastix.io/tenant: gas - networkPolicies: - items: - - - egress: - - - to: - - - ipBlock: - cidr: 0.0.0.0/0 - except: - - 192.168.0.0/12 - ingress: - - - from: - - - namespaceSelector: - matchLabels: - capsule.clastix.io/tenant: gas - - - podSelector: {} - - - ipBlock: - cidr: 192.168.0.0/12 - podSelector: {} - policyTypes: - - Ingress - - Egress - nodeSelector: - kubernetes.io/os: linux - owners: - - - kind: User - name: bob - priorityClasses: - allowed: - - shared-nodes - allowedRegex: ^\w-gas$ - resourceQuotas: - items: - - - hard: - limits.cpu: "8" - limits.memory: 16Gi - requests.cpu: "8" - requests.memory: 16Gi - scopes: - - NotTerminating - - - hard: - pods: "10" - - - hard: - requests.storage: 100Gi - storageClasses: - allowed: - - default - allowedRegex: ^\w+fs$ diff --git a/config/samples/capsule_v1beta2_capsuleconfiguration.yaml b/config/samples/capsule_v1beta2_capsuleconfiguration.yaml deleted file mode 100644 index 71b2fce1..00000000 --- a/config/samples/capsule_v1beta2_capsuleconfiguration.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: capsule.clastix.io/v1beta2 -kind: CapsuleConfiguration -metadata: - name: default -spec: - userGroups: ["capsule.clastix.io"] - forceTenantPrefix: false - protectedNamespaceRegex: "" - enableTLSReconciler: true - diff --git a/config/samples/capsule_v1beta2_globaltenantresource.yaml b/config/samples/capsule_v1beta2_globaltenantresource.yaml deleted file mode 100644 index 3d2853ce..00000000 --- a/config/samples/capsule_v1beta2_globaltenantresource.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: capsule.clastix.io/v1beta2 -kind: GlobalTenantResource -metadata: - name: green-production -spec: - tenantSelector: - matchLabels: - energy: green - resyncPeriod: 60s - pruningOnDelete: true - resources: - - namespaceSelector: - matchLabels: - environment: production - additionalMetadata: - labels: - labels.energy.io: green - annotations: - annotations.energy.io: green - namespacedItems: - - apiVersion: v1 - kind: Secret - namespace: default - selector: - matchLabels: - replicate: green - rawItems: - - apiVersion: v1 - kind: Secret - metadata: - name: raw-secret-1 - - apiVersion: v1 - kind: Secret - metadata: - name: raw-secret-2 - - apiVersion: v1 - kind: Secret - metadata: - name: raw-secret-3 \ No newline at end of file diff --git a/config/samples/capsule_v1beta2_tenantresource.yaml b/config/samples/capsule_v1beta2_tenantresource.yaml deleted file mode 100644 index db255f5d..00000000 --- a/config/samples/capsule_v1beta2_tenantresource.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: capsule.clastix.io/v1beta2 -kind: TenantResource -metadata: - name: wind-objects -spec: - resyncPeriod: 60s - pruningOnDelete: true - resources: - - namespaceSelector: - matchLabels: - environment: production - additionalMetadata: - labels: - labels.energy.io: wind - annotations: - annotations.energy.io: wind - namespacedItems: - - apiVersion: v1 - kind: Secret - namespace: wind-production - selector: - matchLabels: - replicate: solar - rawItems: - - apiVersion: v1 - kind: Secret - metadata: - name: wind-secret-1 - - apiVersion: v1 - kind: Secret - metadata: - name: wind-secret-2 - - apiVersion: v1 - kind: Secret - metadata: - name: wind-secret-3 \ No newline at end of file diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml deleted file mode 100644 index 1955cec5..00000000 --- a/config/samples/kustomization.yaml +++ /dev/null @@ -1,3 +0,0 @@ -## This file is auto-generated, do not modify ## -resources: -- capsule_v1beta1_tenant.yaml diff --git a/config/secret/kustomization.yaml b/config/secret/kustomization.yaml deleted file mode 100644 index a93504fd..00000000 --- a/config/secret/kustomization.yaml +++ /dev/null @@ -1,3 +0,0 @@ -resources: -- secret-ca.yaml -- secret-tls.yaml diff --git a/config/secret/secret-ca.yaml b/config/secret/secret-ca.yaml deleted file mode 100644 index b093850a..00000000 --- a/config/secret/secret-ca.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: ca diff --git a/config/secret/secret-tls.yaml b/config/secret/secret-tls.yaml deleted file mode 100644 index 3e5e0fbb..00000000 --- a/config/secret/secret-tls.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: tls diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml deleted file mode 100644 index 8ff7dd79..00000000 --- a/config/webhook/kustomization.yaml +++ /dev/null @@ -1,21 +0,0 @@ -resources: -- manifests.yaml -- service.yaml - -patchesJson6902: -- target: - group: admissionregistration.k8s.io - kind: ValidatingWebhookConfiguration - name: validating-webhook-configuration - version: v1 - path: patch_validating_ns_selector.yaml -- target: - group: admissionregistration.k8s.io - kind: MutatingWebhookConfiguration - name: mutating-webhook-configuration - version: v1 - path: patch_mutating_ns_selector.yaml - - -configurations: -- kustomizeconfig.yaml diff --git a/config/webhook/kustomizeconfig.yaml b/config/webhook/kustomizeconfig.yaml deleted file mode 100644 index 25e21e3c..00000000 --- a/config/webhook/kustomizeconfig.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# the following config is for teaching kustomize where to look at when substituting vars. -# It requires kustomize v2.1.0 or newer to work properly. -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - - kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/name - -namespace: -- kind: MutatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true -- kind: ValidatingWebhookConfiguration - group: admissionregistration.k8s.io - path: webhooks/clientConfig/service/namespace - create: true - -varReference: -- path: metadata/annotations diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml deleted file mode 100644 index f5944c8b..00000000 --- a/config/webhook/manifests.yaml +++ /dev/null @@ -1,294 +0,0 @@ ---- -apiVersion: admissionregistration.k8s.io/v1 -kind: MutatingWebhookConfiguration -metadata: - name: mutating-webhook-configuration -webhooks: -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /defaults - failurePolicy: Fail - name: ingress.defaults.projectcapsule.dev - rules: - - apiGroups: - - networking.k8s.io - apiVersions: - - v1beta1 - - v1 - operations: - - CREATE - - UPDATE - resources: - - ingresses - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /namespace-owner-reference - failurePolicy: Fail - name: owner.namespace.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - namespaces - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /defaults - failurePolicy: Fail - name: pod.defaults.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - resources: - - pods - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /defaults - failurePolicy: Fail - name: storage.defaults.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - resources: - - persistentvolumeclaims - sideEffects: None ---- -apiVersion: admissionregistration.k8s.io/v1 -kind: ValidatingWebhookConfiguration -metadata: - name: validating-webhook-configuration -webhooks: -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /cordoning - failurePolicy: Fail - name: cordoning.tenant.projectcapsule.dev - rules: - - apiGroups: - - '*' - apiVersions: - - '*' - operations: - - CREATE - - UPDATE - - DELETE - resources: - - '*' - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /ingresses - failurePolicy: Fail - name: ingress.projectcapsule.dev - rules: - - apiGroups: - - networking.k8s.io - - extensions - apiVersions: - - v1beta1 - - v1 - operations: - - CREATE - - UPDATE - resources: - - ingresses - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /namespaces - failurePolicy: Fail - name: namespaces.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - namespaces - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /networkpolicies - failurePolicy: Fail - name: networkpolicies.projectcapsule.dev - rules: - - apiGroups: - - networking.k8s.io - apiVersions: - - v1 - operations: - - UPDATE - - DELETE - resources: - - networkpolicies - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /nodes - failurePolicy: Fail - name: nodes.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - UPDATE - resources: - - nodes - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /pods - failurePolicy: Fail - name: pods.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - pods - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /persistentvolumeclaims - failurePolicy: Fail - name: pvc.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - resources: - - persistentvolumeclaims - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /tenantresource-objects - failurePolicy: Fail - name: resource-objects.tenant.projectcapsule.dev - rules: - - apiGroups: - - '*' - apiVersions: - - '*' - operations: - - UPDATE - - DELETE - resources: - - '*' - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /services - failurePolicy: Fail - name: services.projectcapsule.dev - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - services - sideEffects: None -- admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /tenants - failurePolicy: Fail - name: tenants.projectcapsule.dev - rules: - - apiGroups: - - capsule.clastix.io - apiVersions: - - v1beta2 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - tenants - sideEffects: None diff --git a/config/webhook/patch_mutating_ns_selector.yaml b/config/webhook/patch_mutating_ns_selector.yaml deleted file mode 100644 index 790b06e1..00000000 --- a/config/webhook/patch_mutating_ns_selector.yaml +++ /dev/null @@ -1,27 +0,0 @@ -- op: add - path: /webhooks/0/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/1/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/2/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/0/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/1/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/2/rules/0/scope - value: Namespaced diff --git a/config/webhook/patch_validating_ns_selector.yaml b/config/webhook/patch_validating_ns_selector.yaml deleted file mode 100644 index 2e39ab83..00000000 --- a/config/webhook/patch_validating_ns_selector.yaml +++ /dev/null @@ -1,75 +0,0 @@ -- op: add - path: /webhooks/0/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/1/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/3/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/4/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/5/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/6/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/7/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/8/namespaceSelector - value: - matchExpressions: - - key: capsule.clastix.io/tenant - operator: Exists -- op: add - path: /webhooks/8/objectSelector - value: - matchExpressions: - - key: capsule.clastix.io/resources - operator: Exists -- op: add - path: /webhooks/0/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/1/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/3/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/5/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/6/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/7/rules/0/scope - value: Namespaced -- op: add - path: /webhooks/8/rules/0/scope - value: Namespaced diff --git a/config/webhook/service.yaml b/config/webhook/service.yaml deleted file mode 100644 index 240b2016..00000000 --- a/config/webhook/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ - -apiVersion: v1 -kind: Service -metadata: - name: webhook-service -spec: - ports: - - port: 443 - targetPort: 9443 - selector: - control-plane: controller-manager diff --git a/pkg/webhook/route/cordoning.go b/pkg/webhook/route/cordoning.go index 172e9e32..b7377739 100644 --- a/pkg/webhook/route/cordoning.go +++ b/pkg/webhook/route/cordoning.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/cordoning,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="*",resources="*",verbs=create;update;delete,versions="*",name=cordoning.tenant.projectcapsule.dev - type cordoning struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/defaults.go b/pkg/webhook/route/defaults.go index 8b30891f..9fecc49e 100644 --- a/pkg/webhook/route/defaults.go +++ b/pkg/webhook/route/defaults.go @@ -7,10 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/defaults,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=pods,verbs=create,versions=v1,name=pod.defaults.projectcapsule.dev -// +kubebuilder:webhook:path=/defaults,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=persistentvolumeclaims,verbs=create,versions=v1,name=storage.defaults.projectcapsule.dev -// +kubebuilder:webhook:path=/defaults,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups=networking.k8s.io,resources=ingresses,verbs=create;update,versions=v1beta1;v1,name=ingress.defaults.projectcapsule.dev - type defaults struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/ingresses.go b/pkg/webhook/route/ingresses.go index 3cc2d12e..e7f33006 100644 --- a/pkg/webhook/route/ingresses.go +++ b/pkg/webhook/route/ingresses.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/ingresses,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups=networking.k8s.io;extensions,resources=ingresses,verbs=create;update,versions=v1beta1;v1,name=ingress.projectcapsule.dev - type ingress struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/namespaces.go b/pkg/webhook/route/namespaces.go index 072ea1e6..0b7b0be4 100644 --- a/pkg/webhook/route/namespaces.go +++ b/pkg/webhook/route/namespaces.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/namespaces,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=namespaces,verbs=create;update;delete,versions=v1,name=namespaces.projectcapsule.dev - type namespace struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/networkpolicies.go b/pkg/webhook/route/networkpolicies.go index 09746d69..8fb9976c 100644 --- a/pkg/webhook/route/networkpolicies.go +++ b/pkg/webhook/route/networkpolicies.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/networkpolicies,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="networking.k8s.io",resources=networkpolicies,verbs=update;delete,versions=v1,name=networkpolicies.projectcapsule.dev - type networkPolicy struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/node.go b/pkg/webhook/route/node.go index 673edf3f..f7472167 100644 --- a/pkg/webhook/route/node.go +++ b/pkg/webhook/route/node.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/nodes,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=nodes,verbs=update,versions=v1,name=nodes.projectcapsule.dev - type node struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/ownerreference.go b/pkg/webhook/route/ownerreference.go index 09511e0b..0c1be5c1 100644 --- a/pkg/webhook/route/ownerreference.go +++ b/pkg/webhook/route/ownerreference.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/namespace-owner-reference,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=namespaces,verbs=create;update,versions=v1,name=owner.namespace.projectcapsule.dev - type webhook struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/pods.go b/pkg/webhook/route/pods.go index 1c23a797..ac53e138 100644 --- a/pkg/webhook/route/pods.go +++ b/pkg/webhook/route/pods.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/pods,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=pods,verbs=create;update,versions=v1,name=pods.projectcapsule.dev - type pod struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/pvc.go b/pkg/webhook/route/pvc.go index 924d6b4c..faa5da52 100644 --- a/pkg/webhook/route/pvc.go +++ b/pkg/webhook/route/pvc.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/persistentvolumeclaims,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=persistentvolumeclaims,verbs=create,versions=v1,name=pvc.projectcapsule.dev - type pvc struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/services.go b/pkg/webhook/route/services.go index 89ef42e4..d697faab 100644 --- a/pkg/webhook/route/services.go +++ b/pkg/webhook/route/services.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/services,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=services,verbs=create;update,versions=v1,name=services.projectcapsule.dev - type service struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/tenantresource_objs.go b/pkg/webhook/route/tenantresource_objs.go index 3f353eb1..647d9bfd 100644 --- a/pkg/webhook/route/tenantresource_objs.go +++ b/pkg/webhook/route/tenantresource_objs.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/tenantresource-objects,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="*",resources="*",verbs=update;delete,versions="*",name=resource-objects.tenant.projectcapsule.dev - type tntResourceObjs struct { handlers []capsulewebhook.Handler } diff --git a/pkg/webhook/route/tenants.go b/pkg/webhook/route/tenants.go index 71784d0e..92d428e4 100644 --- a/pkg/webhook/route/tenants.go +++ b/pkg/webhook/route/tenants.go @@ -7,8 +7,6 @@ import ( capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook" ) -// +kubebuilder:webhook:path=/tenants,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="capsule.clastix.io",resources=tenants,verbs=create;update;delete,versions=v1beta2,name=tenants.projectcapsule.dev - type tenant struct { handlers []capsulewebhook.Handler } diff --git a/renovate.json b/renovate.json index 9b0244eb..61b1fd1c 100644 --- a/renovate.json +++ b/renovate.json @@ -21,5 +21,29 @@ "groupName": "all-ci-updates", "updateTypes": ["major", "minor", "patch"] } + ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": ["^Makefile$"], + "matchStrings": [ + "(?[A-Z0-9_]+)_VERSION\\s*[:=?]+\\s*\"?(?[^\"\\r\\n]+)\"?[\\s\\S]*?(?[A-Z0-9_]+)_LOOKUP\\s*[:=?]+\\s*\"?(?[^\"\\r\\n]+)\"?(?:[\\s\\S]*?(?[A-Z0-9_]+)_SOURCE\\s*[:=?]+\\s*\"?(?[^\"\\r\\n]+)\"?)?" + ], + "depNameTemplate": "{{lookupValue}}", + "datasourceTemplate": "{{#sourceValue}}{{sourceValue}}{{/sourceValue}}{{^sourceValue}}github-tags{{/sourceValue}}", + "lookupNameTemplate": "{{lookupValue}}", + "versioningTemplate": "semver" + }, + { + "customType": "regex", + "fileMatch": [".*\\.pre-commit-config\\.ya?ml$"], + "matchStrings": [ + "repo:\\s*https://github\\.com/(?[^/]+/[^\\s]+)[\\s\\S]*?rev:\\s*(?v?\\d+\\.\\d+\\.\\d+)" + ], + "depNameTemplate": "{{lookupValue}}", + "datasourceTemplate": "github-tags", + "lookupNameTemplate": "{{lookupValue}}", + "versioningTemplate": "semver" + } ] }