forked from kubernetes-sigs/kwok
-
Notifications
You must be signed in to change notification settings - Fork 2
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
62 changed files
with
2,765 additions
and
3 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
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,17 @@ | ||
apiVersion: v2 | ||
description: KWOK Operator | ||
type: application | ||
home: https://kwok.sigs.k8s.io | ||
icon: https://github.com/kubernetes-sigs/kwok/raw/main/logo/kwok.png | ||
keywords: | ||
- kubernetes | ||
- kwok | ||
- operator | ||
sources: | ||
- https://github.com/kubernetes-sigs/kwok | ||
name: operator | ||
maintainers: | ||
- name: wzshiming | ||
email: [email protected] | ||
appVersion: v0.6.0 | ||
version: 0.0.1 |
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,49 @@ | ||
# KWOK (Kubernetes WithOut Kubelet) | ||
|
||
[KWOK](https://kwok.sigs.k8s.io/) - 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 | ||
``` | ||
|
||
Set up default metrics usage policy (optional) | ||
|
||
```shell | ||
helm upgrade --install kwok kwok/metrics-usage | ||
``` | ||
|
||
## Configuration | ||
|
||
The following table lists the configurable parameters of the kwok chart and their default values. | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | | | ||
| fullnameOverride | string | `"kwok-controller"` | Override the `fullname` of the chart. | | ||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. | | ||
| image.repository | string | `"registry.k8s.io/kwok/kwok"` | Image repository. | | ||
| image.tag | string | `""` | Overrides the image tag whose default is {{ .Chart.AppVersion }}. | | ||
| imagePullSecrets | list | `[]` | Image pull secrets. | | ||
| nameOverride | string | `""` | Override the `name` of the chart. | | ||
| nodeSelector | object | `{}` | | | ||
| podSecurityContext | object | `{}` | | | ||
| replicas | int | `1` | The replica count for Deployment. | | ||
| resources | object | `{}` | | | ||
| securityContext | object | `{}` | | |
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,9 @@ | ||
# {{ template "chart.description" . }} | ||
|
||
{{ template "extra.usage" . }} | ||
|
||
## Configuration | ||
|
||
The following table lists the configurable parameters of the kwok chart and their default values. | ||
|
||
{{ template "chart.valuesTable" . }} |
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 @@ | ||
../../kustomize/operator/crd/bases |
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kwok.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "kwok.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "kwok.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "kwok.labels" -}} | ||
helm.sh/chart: {{ include "kwok.chart" . }} | ||
{{ include "kwok.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "kwok.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "kwok.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "kwok.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "kwok.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
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,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "kwok.fullname" . }} | ||
labels: | ||
{{- include "kwok.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "kwok.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "kwok.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "kwok.fullname" . }} | ||
{{- with .Values.podSecurityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
restartPolicy: Always | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 10 }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 10 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
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,47 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kwok-operator | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments/scale | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- kwok.x-k8s.io | ||
resources: | ||
- controllers | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- kwok.x-k8s.io | ||
resources: | ||
- controllers/status | ||
verbs: | ||
- patch | ||
- update |
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 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kwok-operator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kwok-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kwok-operator | ||
namespace: {{ .Release.Namespace }} |
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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kwok-operator | ||
namespace: {{ .Release.Namespace }} |
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,26 @@ | ||
image: | ||
# -- Image pull policy. | ||
pullPolicy: IfNotPresent | ||
# -- Image repository. | ||
repository: registry.k8s.io/kwok/operator | ||
# -- Overrides the image tag whose default is {{ .Chart.AppVersion }}. | ||
tag: "" | ||
|
||
# -- Image pull secrets. | ||
imagePullSecrets: [] | ||
|
||
# -- Override the `name` of the chart. | ||
nameOverride: "" | ||
|
||
# -- Override the `fullname` of the chart. | ||
fullnameOverride: "kwok-operator" | ||
|
||
podSecurityContext: {} | ||
securityContext: {} | ||
|
||
nodeSelector: {} | ||
resources: {} | ||
affinity: {} | ||
|
||
# -- The replica count for Deployment. | ||
replicas: 1 |
Oops, something went wrong.