generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
remote: origin | ||
target-branch: main | ||
|
||
validate-maintainers: false | ||
check-version-increment: false | ||
|
||
chart-repos: | ||
- kwok=https://kwok.sigs.k8s.io/charts/ | ||
helm-extra-args: --timeout 800s | ||
|
||
chart-dirs: | ||
- charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ on: | |
pull_request: | ||
paths: | ||
- charts/**/* | ||
- .ct.yaml | ||
push: | ||
paths: | ||
- charts/**/* | ||
- .ct.yaml | ||
|
||
jobs: | ||
lint-test: | ||
|
@@ -40,15 +42,15 @@ jobs: | |
- name: Run chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --target-branch ${{ github.event.repository.default_branch }} | ||
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config ./.ct.yaml | ||
|
||
- name: Create kind cluster | ||
if: steps.list-changed.outputs.changed == 'true' | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (install) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --target-branch ${{ github.event.repository.default_branch }} | ||
run: ct install --target-branch ${{ github.event.repository.default_branch }} --config ./.ct.yaml | ||
|
||
linter-artifacthub: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.helmignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: v2 | ||
description: Default metrics usage policy of KWOK (Kubernetes WithOut Kubelet) | ||
type: application | ||
home: https://kwok.sigs.k8s.io | ||
icon: https://github.com/kubernetes-sigs/kwok/raw/main/logo/kwok.png | ||
keywords: | ||
- kubernetes | ||
- kwok | ||
- kwok metrics usage policy | ||
sources: | ||
- https://github.com/kubernetes-sigs/kwok | ||
name: metrics-usage | ||
maintainers: | ||
- name: wzshiming | ||
email: [email protected] | ||
appVersion: v0.5.2 | ||
version: 0.0.1 | ||
dependencies: | ||
- name: kwok | ||
version: 0.0.1 | ||
repository: https://kwok.sigs.k8s.io/charts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Default metrics usage of KWOK (Kubernetes WithOut Kubelet) | ||
|
||
[KWOK](https://github.com/kubernetes-sigs/kwok/) - Simulates thousands of Nodes and Clusters. | ||
|
||
## Installing the Chart | ||
|
||
Before you can install the chart you will need to add the `kwok` repo to [Helm](https://helm.sh/). | ||
|
||
```shell | ||
helm repo add kwok https://kwok.sigs.k8s.io/charts/ | ||
``` | ||
|
||
After you've installed the repo you can install the chart. | ||
|
||
```shell | ||
helm upgrade --namespace kube-system --install kwok kwok/kwok | ||
``` | ||
|
||
Set up default stage policy (required) | ||
> NOTE: This configures the pod/node emulation behavior, if not it will do nothing. | ||
```shell | ||
helm upgrade --install kwok kwok/stage-fast | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
kind: Metric | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: metrics-resource | ||
spec: | ||
path: "/metrics/nodes/{nodeName}/metrics/resource" | ||
metrics: | ||
- name: scrape_error | ||
dimension: node | ||
help: | | ||
[ALPHA] 1 if there was an error while getting metrics from the node, 0 otherwise | ||
kind: gauge | ||
value: '0' | ||
- name: container_start_time_seconds | ||
dimension: container | ||
help: | | ||
[ALPHA] Start time of the container since unix epoch in seconds | ||
kind: gauge | ||
labels: | ||
- name: container | ||
value: 'container.name' | ||
- name: namespace | ||
value: 'pod.metadata.namespace' | ||
- name: pod | ||
value: 'pod.metadata.name' | ||
value: 'pod.SinceSecond()' | ||
# CPU of the container | ||
- name: container_cpu_usage_seconds_total | ||
dimension: container | ||
help: | | ||
[ALPHA] Cumulative cpu time consumed by the container in core-seconds | ||
kind: counter | ||
labels: | ||
- name: container | ||
value: 'container.name' | ||
- name: namespace | ||
value: 'pod.metadata.namespace' | ||
- name: pod | ||
value: 'pod.metadata.name' | ||
value: 'pod.CumulativeUsage("cpu", container.name)' | ||
# Memory of the container | ||
- name: container_memory_working_set_bytes | ||
dimension: container | ||
help: | | ||
[ALPHA] Current working set of the container in bytes | ||
kind: gauge | ||
labels: | ||
- name: container | ||
value: 'container.name' | ||
- name: namespace | ||
value: 'pod.metadata.namespace' | ||
- name: pod | ||
value: 'pod.metadata.name' | ||
value: 'pod.Usage("memory", container.name)' | ||
# CPU of the pod | ||
- name: pod_cpu_usage_seconds_total | ||
dimension: pod | ||
help: | | ||
[ALPHA] Cumulative cpu time consumed by the pod in core-seconds | ||
kind: counter | ||
labels: | ||
- name: namespace | ||
value: 'pod.metadata.namespace' | ||
- name: pod | ||
value: 'pod.metadata.name' | ||
value: 'pod.CumulativeUsage("cpu")' | ||
# Memory of the pod | ||
- name: pod_memory_working_set_bytes | ||
dimension: pod | ||
help: | | ||
[ALPHA] Current working set of the pod in bytes | ||
kind: gauge | ||
labels: | ||
- name: namespace | ||
value: 'pod.metadata.namespace' | ||
- name: pod | ||
value: 'pod.metadata.name' | ||
value: 'pod.Usage("memory")' | ||
# CPU of the node | ||
- name: node_cpu_usage_seconds_total | ||
dimension: node | ||
help: | | ||
[ALPHA] Cumulative cpu time consumed by the node in core-seconds | ||
kind: counter | ||
value: 'node.CumulativeUsage("cpu")' | ||
# Memory of the node | ||
- name: node_memory_working_set_bytes | ||
dimension: node | ||
help: | | ||
[ALPHA] Current working set of the node in bytes | ||
kind: gauge | ||
value: 'node.Usage("memory")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
kind: ClusterResourceUsage | ||
metadata: | ||
name: usage-from-annotation | ||
spec: | ||
usages: | ||
- usage: | ||
cpu: | ||
expression: | | ||
"kwok.x-k8s.io/usage-cpu" in pod.metadata.annotations | ||
? Quantity(pod.metadata.annotations["kwok.x-k8s.io/usage-cpu"]) | ||
: Quantity("1m") | ||
memory: | ||
expression: | | ||
"kwok.x-k8s.io/usage-memory" in pod.metadata.annotations | ||
? Quantity(pod.metadata.annotations["kwok.x-k8s.io/usage-memory"]) | ||
: Quantity("1Mi") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters