Skip to content

Commit

Permalink
Update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Aug 16, 2023
1 parent 34c9c90 commit d88b8da
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 33 deletions.
10 changes: 5 additions & 5 deletions demo/attach.demo
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Let's getting started with kwokctl!
kwokctl -c ./test/kwokctl/attach.yaml create cluster
kwokctl -c ./demo/attach.yaml create cluster

# Create a node.
kubectl apply -f ./test/kwokctl/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Apply a deployment.
kubectl apply -f ./test/kwokctl/fake-deployment.yaml
kubectl create deployment nginx --image=nginx --replicas=10

# Write some logs.
echo "$(date --iso-8601=ns) stdout F Hello" >./logs/kwok.log

# Attach to the pod.
kubectl attach deployment/fake-pod &
kubectl attach deployment/nginx &

# Again.
echo "$(date --iso-8601=ns) stdout F Foo" >>./logs/kwok.log
Expand Down
2 changes: 1 addition & 1 deletion demo/attach.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions demo/attach.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: ClusterAttach
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
name: cluster-attach-rules
spec:
attaches:
- logsFile: ./logs/kwok.log
2 changes: 1 addition & 1 deletion demo/audit-log.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions demo/audit-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: audit.k8s.io/v1
kind: Policy
rules:
- level: Metadata
8 changes: 4 additions & 4 deletions demo/exec.demo
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Let's getting started with kwokctl!
kwokctl -c ./test/kwokctl/exec.yaml create cluster

# Create a node.
kubectl apply -f ./test/kwok/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Apply a deployment.
kubectl apply -f ./test/kwok/fake-deployment.yaml
kubectl create deployment nginx --image=nginx --replicas=10

# Exec into the pod.
kubectl exec deployment/fake-pod -- ls -lh
kubectl exec deployment/nginx -- ls -lh

# Delete the cluster.
kwokctl delete cluster
Expand Down
2 changes: 1 addition & 1 deletion demo/exec.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions demo/exec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: ClusterExec
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
name: cluster-exec-rules
spec:
execs:
- local: {}
8 changes: 4 additions & 4 deletions demo/logs.demo
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Let's getting started with kwokctl!
kwokctl -c ./test/kwokctl/logs.yaml create cluster

# Create a node.
kubectl apply -f ./test/kwokctl/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Apply a deployment.
kubectl apply -f ./test/kwokctl/fake-deployment.yaml
kubectl create deployment nginx --image=nginx --replicas=10

# Write some logs.
echo "$(date --iso-8601=ns) stdout F Hello" >./logs/kwok.log

# Look at the logs.
kubectl logs -f deployment/fake-pod &
kubectl logs -f deployment/nginx &

# Again.
echo "$(date --iso-8601=ns) stdout F Foo" >>./logs/kwok.log
Expand Down
2 changes: 1 addition & 1 deletion demo/logs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions demo/logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: ClusterLogs
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
name: cluster-port-forward-rules
spec:
logs:
- logsFile: ./logs/kwok.log
follow: true
8 changes: 4 additions & 4 deletions demo/manage-clusters.demo
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ kwokctl create cluster
# Get all clusters.
kwokctl get clusters

# Create a node.
kubectl apply -f ./test/kwok/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Get all nodes.
kubectl get node

# Apply a deployment.
kubectl apply -f ./test/kwok/fake-deployment.yaml
kubectl create deployment nginx --image=nginx --replicas=10

# Get all pods.
kubectl get pod
kubectl get pod -o wide

# Delete the cluster.
kwokctl delete cluster
Expand Down
2 changes: 1 addition & 1 deletion demo/manage-clusters.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions demo/port-forward.demo
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Let's getting started with kwokctl!
kwokctl -c ./test/kwokctl/port-forward.yaml create cluster

# Create a node.
kubectl apply -f ./test/kwok/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Apply a deployment.
kubectl apply -f ./test/kwok/fake-deployment.yaml
kubectl create deployment nginx --image=nginx --replicas=10

# Forward port to the deployment.
kubectl port-forward deployment/fake-pod 8080:10247 &
kubectl port-forward deployment/nginx 8080:10247 &

# Check the port forward.
curl http://localhost:8080/healthz
Expand Down
2 changes: 1 addition & 1 deletion demo/port-forward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions demo/port-forward.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kind: ClusterPortForward
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
name: cluster-port-forward-rules
spec:
forwards:
- target:
port: 10247
address: localhost
4 changes: 2 additions & 2 deletions demo/stages-pod-fast.demo
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Let's getting started with kwokctl!
kwokctl create cluster

# Create a node.
kubectl apply -f ./test/lifecycle/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Apply a deployment and watch.
kubectl apply -f ./test/lifecycle/fake-pod-stages.yaml && timeout 20 kubectl get pod -w
Expand Down
2 changes: 1 addition & 1 deletion demo/stages-pod-fast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions demo/stages-pod-general.demo
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Let's getting started with kwokctl!
kwokctl -c ./stages/pod-general.yaml create cluster

# Create a node.
kubectl apply -f ./test/lifecycle/fake-node.yaml
# Create an nodes.
kwokctl scale node --replicas 5

# Apply a deployment and watch.
kubectl apply -f ./test/lifecycle/fake-pod-stages.yaml && timeout 20 kubectl get pod -w
Expand Down
2 changes: 1 addition & 1 deletion demo/stages-pod-general.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d88b8da

Please sign in to comment.