generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release manifests stage-fast.yaml and kwokctl.yaml
- Loading branch information
Showing
25 changed files
with
673 additions
and
57 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
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: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../node/fast | ||
- ../pod/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,7 @@ | ||
# Node Fast Stage | ||
|
||
This Stage only initializes the node. | ||
|
||
The `node-initialize` Stage is applied to nodes that do not have any conditions set in their `status.conditions` field. | ||
When applied, this Stage sets the `status.conditions` field for the node, as well as the `status.addresses`, `status.allocatable`, | ||
and `status.capacity` fields. |
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,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- node-initialize.yaml |
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,78 @@ | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
kind: Stage | ||
metadata: | ||
name: node-initialize | ||
spec: | ||
resourceRef: | ||
apiGroup: v1 | ||
kind: Node | ||
selector: | ||
matchExpressions: | ||
- key: '.status.conditions.[] | select( .type == "Ready" ) | .status' | ||
operator: 'NotIn' | ||
values: | ||
- 'True' | ||
next: | ||
statusTemplate: | | ||
{{ $now := Now }} | ||
{{ $lastTransitionTime := or .creationTimestamp $now }} | ||
conditions: | ||
{{ range NodeConditions }} | ||
- lastHeartbeatTime: {{ $now | Quote }} | ||
lastTransitionTime: {{ $lastTransitionTime | Quote }} | ||
message: {{ .message | Quote }} | ||
reason: {{ .reason | Quote }} | ||
status: {{ .status | Quote }} | ||
type: {{ .type | Quote}} | ||
{{ end }} | ||
addresses: | ||
{{ with .status.addresses }} | ||
{{ YAML . 1 }} | ||
{{ else }} | ||
{{ with NodeIP }} | ||
- address: {{ . | Quote }} | ||
type: InternalIP | ||
{{ end }} | ||
{{ with NodeName }} | ||
- address: {{ . | Quote }} | ||
type: Hostname | ||
{{ end }} | ||
{{ end }} | ||
{{ with NodePort }} | ||
daemonEndpoints: | ||
kubeletEndpoint: | ||
Port: {{ . }} | ||
{{ end }} | ||
allocatable: | ||
{{ with .status.allocatable }} | ||
{{ YAML . 1 }} | ||
{{ else }} | ||
cpu: 1k | ||
memory: 1Ti | ||
pods: 1M | ||
{{ end }} | ||
capacity: | ||
{{ with .status.capacity }} | ||
{{ YAML . 1 }} | ||
{{ else }} | ||
cpu: 1k | ||
memory: 1Ti | ||
pods: 1M | ||
{{ end }} | ||
{{ with .status.nodeInfo }} | ||
nodeInfo: | ||
architecture: {{ with .architecture }} {{ . }} {{ else }} "amd64" {{ end }} | ||
bootID: {{ with .bootID }} {{ . }} {{ else }} "" {{ end }} | ||
containerRuntimeVersion: {{ with .containerRuntimeVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }} | ||
kernelVersion: {{ with .kernelVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }} | ||
kubeProxyVersion: {{ with .kubeProxyVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }} | ||
kubeletVersion: {{ with .kubeletVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }} | ||
machineID: {{ with .machineID }} {{ . }} {{ else }} "" {{ end }} | ||
operatingSystem: {{ with .operatingSystem }} {{ . }} {{ else }} "linux" {{ end }} | ||
osImage: {{ with .osImage }} {{ . }} {{ else }} "" {{ end }} | ||
systemUUID: {{ with .systemUUID }} {{ . }} {{ else }} "" {{ end }} | ||
{{ end }} | ||
phase: Running |
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,6 @@ | ||
# Node Heartbeat Stage (DEPRECATED) | ||
|
||
This Stage configures the node heartbeat, only for prior to v0.3. | ||
|
||
The `node-heartbeat` Stage is applied to nodes that have the `Ready` condition set to `True` in their `status.conditions` field. | ||
When applied, this Stage maintains the `status.conditions` field for the node. |
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,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- node-heartbeat.yaml |
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,35 @@ | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
kind: Stage | ||
metadata: | ||
name: node-heartbeat | ||
spec: | ||
resourceRef: | ||
apiGroup: v1 | ||
kind: Node | ||
selector: | ||
matchExpressions: | ||
- key: '.status.phase' | ||
operator: 'In' | ||
values: | ||
- 'Running' | ||
- key: '.status.conditions.[] | select( .type == "Ready" ) | .status' | ||
operator: 'In' | ||
values: | ||
- 'True' | ||
delay: | ||
durationMilliseconds: 20000 | ||
jitterDurationMilliseconds: 25000 | ||
next: | ||
statusTemplate: | | ||
{{ $now := Now }} | ||
{{ $lastTransitionTime := or .creationTimestamp $now }} | ||
conditions: | ||
{{ range NodeConditions }} | ||
- lastHeartbeatTime: {{ $now | Quote }} | ||
lastTransitionTime: {{ $lastTransitionTime | Quote }} | ||
message: {{ .message | Quote }} | ||
reason: {{ .reason | Quote }} | ||
status: {{ .status | Quote }} | ||
type: {{ .type | Quote }} | ||
{{ end }} | ||
immediateNextStage: true |
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,15 @@ | ||
# Pod Fast Stage | ||
|
||
These Stages make the pod ready, completed or deleted. | ||
|
||
The `pod-ready` Stage is applied to pods that do not have a `status.podIP` set and do not have a `metadata.deletionTimestamp` set. | ||
When applied, this Stage sets the `status.conditions`, `status.containerStatuses`, and `status.initContainerStatuses` fields for the pod, | ||
as well as the `status.hostIP` and `status.podIP` fields. It will also set the phase and startTime fields, indicating that the pod is running and has been started. | ||
|
||
The `pod-complete` Stage is applied to pods that are running, do not have a `metadata.deletionTimestamp` set, | ||
and are owned by a Job. When applied, this Stage updates the `status.containerStatuses` field for the pod, | ||
setting the ready and started fields to true and the `state.terminated` field to indicate that the pod has completed. | ||
It also sets the phase field to Succeeded, indicating that the pod has completed successfully. | ||
|
||
The `pod-delete` Stage is applied to pods that have a `metadata.deletionTimestamp` set. | ||
When applied, this Stage empties the `metadata.finalizers` field for the pod, allowing it to be deleted, and then delete the pod. |
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,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- pod-ready.yaml | ||
- pod-complete.yaml | ||
- pod-delete.yaml |
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,40 @@ | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
kind: Stage | ||
metadata: | ||
name: pod-complete | ||
spec: | ||
resourceRef: | ||
apiGroup: v1 | ||
kind: Pod | ||
selector: | ||
matchExpressions: | ||
- key: '.metadata.deletionTimestamp' | ||
operator: 'DoesNotExist' | ||
- key: '.status.phase' | ||
operator: 'In' | ||
values: | ||
- 'Running' | ||
- key: '.metadata.ownerReferences.[].kind' | ||
operator: 'In' | ||
values: | ||
- 'Job' | ||
next: | ||
statusTemplate: | | ||
{{ $now := Now }} | ||
{{ $root := . }} | ||
containerStatuses: | ||
{{ range $index, $item := .spec.containers }} | ||
{{ $origin := index $root.status.containerStatuses $index }} | ||
- image: {{ $item.image | Quote }} | ||
name: {{ $item.name | Quote }} | ||
ready: false | ||
restartCount: 0 | ||
started: false | ||
state: | ||
terminated: | ||
exitCode: 0 | ||
finishedAt: {{ $now | Quote }} | ||
reason: Completed | ||
startedAt: {{ $now | Quote }} | ||
{{ end }} | ||
phase: Succeeded |
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,16 @@ | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
kind: Stage | ||
metadata: | ||
name: pod-delete | ||
spec: | ||
resourceRef: | ||
apiGroup: v1 | ||
kind: Pod | ||
selector: | ||
matchExpressions: | ||
- key: '.metadata.deletionTimestamp' | ||
operator: 'Exists' | ||
next: | ||
finalizers: | ||
empty: true | ||
delete: true |
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,63 @@ | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
kind: Stage | ||
metadata: | ||
name: pod-ready | ||
spec: | ||
resourceRef: | ||
apiGroup: v1 | ||
kind: Pod | ||
selector: | ||
matchExpressions: | ||
- key: '.metadata.deletionTimestamp' | ||
operator: 'DoesNotExist' | ||
- key: '.status.podIP' | ||
operator: 'DoesNotExist' | ||
next: | ||
statusTemplate: | | ||
{{ $now := Now }} | ||
conditions: | ||
- lastTransitionTime: {{ $now | Quote }} | ||
status: "True" | ||
type: Initialized | ||
- lastTransitionTime: {{ $now | Quote }} | ||
status: "True" | ||
type: Ready | ||
- lastTransitionTime: {{ $now | Quote }} | ||
status: "True" | ||
type: ContainersReady | ||
{{ range .spec.readinessGates }} | ||
- lastTransitionTime: {{ $now | Quote }} | ||
status: "True" | ||
type: {{ .conditionType | Quote }} | ||
{{ end }} | ||
containerStatuses: | ||
{{ range .spec.containers }} | ||
- image: {{ .image | Quote }} | ||
name: {{ .name | Quote }} | ||
ready: true | ||
restartCount: 0 | ||
state: | ||
running: | ||
startedAt: {{ $now | Quote }} | ||
{{ end }} | ||
initContainerStatuses: | ||
{{ range .spec.initContainers }} | ||
- image: {{ .image | Quote }} | ||
name: {{ .name | Quote }} | ||
ready: true | ||
restartCount: 0 | ||
state: | ||
terminated: | ||
exitCode: 0 | ||
finishedAt: {{ $now | Quote }} | ||
reason: Completed | ||
startedAt: {{ $now | Quote }} | ||
{{ end }} | ||
hostIP: {{ NodeIPWith .spec.nodeName | Quote }} | ||
podIP: {{ PodIPWith .spec.nodeName ( or .spec.hostNetwork false ) ( or .metadata.uid "" ) ( or .metadata.name "" ) ( or .metadata.namespace "" ) | Quote }} | ||
phase: Running | ||
startTime: {{ $now | Quote }} |
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,4 @@ | ||
# Pod General Stage (WIP) | ||
|
||
These Stages simulate real Pod behavior as closely as possible in the future, | ||
which is not perfect at the moment, so the refinement of this configuration is still a *Work In Progress*. |
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,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- pod-create.yaml | ||
- pod-init-container-running.yaml | ||
- pod-init-container-completed.yaml | ||
- pod-ready.yaml | ||
- pod-complete.yaml | ||
- pod-remove-finalizer.yaml | ||
- pod-delete.yaml |
Oops, something went wrong.