forked from kube-burner/kube-burner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a CNI focussed variants of kubelet-density (kube-burner#152)
This commit adds two new kinds of kubelet-density like workloads that are focussed on CNI performance. 1. kubelet-density-cni: This creates deployments of node.js webservers fronted by services and another deployment of pods that run curl against the webserver service for readiness probe. This ensures that the curl pods only go into ready when they are able to reach the webserver srvice. kube-burner accordingly accounts for this delay in the podready metrics. 2. kubelet-density-cni-networkpolicy: This is similar to above workload except a deny-all policy is created in the namespace to begin with and later a newotk policy to allow http on 8080 is introduced when the pods/services are created. This also ensures that the curl pods' readiness probe only succeeds when the flows dictated by the network policy are applied. kube-burner podready metrics now account for propagation of this network policy. Closes: kube-burner#151 Signed-off-by: Sai Sindhur Malleni <[email protected]>
- Loading branch information
Showing
10 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
examples/workloads/kubelet-density-cni-networkpolicy/kubelet-density-cni-networkpolicy.yml
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,50 @@ | ||
--- | ||
global: | ||
writeToFile: true | ||
metricsDirectory: collected-metrics | ||
indexerConfig: | ||
enabled: true | ||
esServers: [http://elastic-elk.apps.rsevilla.kube-burner.com] | ||
insecureSkipVerify: true | ||
defaultIndex: kube-burner | ||
type: elastic | ||
measurements: | ||
- name: podLatency | ||
esIndex: kube-burner | ||
|
||
jobs: | ||
- name: deny-all-policy | ||
jobIterations: 1 | ||
qps: 1 | ||
burst: 1 | ||
namespacedIterations: false | ||
namespace: kubelet-density-cni-networkpolicy | ||
jobPause: 1m | ||
objects: | ||
|
||
- objectTemplate: templates/deny-all.yml | ||
replicas: 1 | ||
|
||
- name: kubelet-density-cni-networkpolicy | ||
jobIterations: 100 | ||
qps: 25 | ||
burst: 25 | ||
namespacedIterations: false | ||
namespace: kubelet-density-cni-networkpolicy | ||
waitWhenFinished: true | ||
podWait: false | ||
preloadImages: true | ||
preLoadPeriod: 2m | ||
objects: | ||
|
||
- objectTemplate: templates/webserver-deployment.yml | ||
replicas: 1 | ||
|
||
- objectTemplate: templates/webserver-service.yml | ||
replicas: 1 | ||
|
||
- objectTemplate: templates/allow-http.yml | ||
replicas: 1 | ||
|
||
- objectTemplate: templates/curl-deployment.yml | ||
replicas: 1 |
12 changes: 12 additions & 0 deletions
12
examples/workloads/kubelet-density-cni-networkpolicy/templates/allow-http.yml
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 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: allow-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 8080 |
40 changes: 40 additions & 0 deletions
40
examples/workloads/kubelet-density-cni-networkpolicy/templates/curl-deployment.yml
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 @@ | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: curl-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
name: curl-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/worker: "" | ||
containers: | ||
- name: curlapp | ||
image: quay.io/cloud-bulldozer/curl:latest | ||
command: ["sleep", "inf"] | ||
env: | ||
- name: WEBSERVER_HOSTNAME | ||
value: webserver-{{.Replica}}-{{.Iteration}} | ||
- name: WEBSERVER_PORT | ||
value: "8080" | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
privileged: false | ||
readinessProbe: | ||
exec: | ||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- "curl ${WEBSERVER_HOSTNAME}:${WEBSERVER_PORT}" | ||
periodSeconds: 1 | ||
restartPolicy: Always | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: curl-{{.Replica}}-{{.Iteration}} | ||
triggers: | ||
- type: ConfigChange | ||
strategy: | ||
type: RollingUpdate |
7 changes: 7 additions & 0 deletions
7
examples/workloads/kubelet-density-cni-networkpolicy/templates/deny-all.yml
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 @@ | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: deny-by-default | ||
spec: | ||
podSelector: {} | ||
ingress: [] |
30 changes: 30 additions & 0 deletions
30
examples/workloads/kubelet-density-cni-networkpolicy/templates/webserver-deployment.yml
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,30 @@ | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/worker: "" | ||
containers: | ||
- name: webserver | ||
image: quay.io/cloud-bulldozer/sampleapp:latest | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
privileged: false | ||
restartPolicy: Always | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
triggers: | ||
- type: ConfigChange | ||
strategy: | ||
type: RollingUpdate |
12 changes: 12 additions & 0 deletions
12
examples/workloads/kubelet-density-cni-networkpolicy/templates/webserver-service.yml
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 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
selector: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
type: ClusterIP |
35 changes: 35 additions & 0 deletions
35
examples/workloads/kubelet-density-cni/kubelet-density-cni.yml
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 @@ | ||
--- | ||
global: | ||
writeToFile: true | ||
metricsDirectory: collected-metrics | ||
indexerConfig: | ||
enabled: true | ||
esServers: [http://elastic-elk.apps.rsevilla.kube-burner.com] | ||
insecureSkipVerify: true | ||
defaultIndex: kube-burner | ||
type: elastic | ||
measurements: | ||
- name: podLatency | ||
esIndex: kube-burner | ||
|
||
jobs: | ||
- name: kubelet-density-cni | ||
jobIterations: 100 | ||
qps: 25 | ||
burst: 25 | ||
namespacedIterations: false | ||
namespace: kubelet-density-cni | ||
waitWhenFinished: true | ||
podWait: false | ||
preloadImages: true | ||
preLoadPeriod: 2m | ||
objects: | ||
|
||
- objectTemplate: templates/webserver-deployment.yml | ||
replicas: 1 | ||
|
||
- objectTemplate: templates/webserver-service.yml | ||
replicas: 1 | ||
|
||
- objectTemplate: templates/curl-deployment.yml | ||
replicas: 1 |
40 changes: 40 additions & 0 deletions
40
examples/workloads/kubelet-density-cni/templates/curl-deployment.yml
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 @@ | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: curl-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
name: curl-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/worker: "" | ||
containers: | ||
- name: curlapp | ||
image: quay.io/cloud-bulldozer/curl:latest | ||
command: ["sleep", "inf"] | ||
env: | ||
- name: WEBSERVER_HOSTNAME | ||
value: webserver-{{.Replica}}-{{.Iteration}} | ||
- name: WEBSERVER_PORT | ||
value: "8080" | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
privileged: false | ||
readinessProbe: | ||
exec: | ||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- "curl ${WEBSERVER_HOSTNAME}:${WEBSERVER_PORT}" | ||
periodSeconds: 1 | ||
restartPolicy: Always | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: curl-{{.Replica}}-{{.Iteration}} | ||
triggers: | ||
- type: ConfigChange | ||
strategy: | ||
type: RollingUpdate |
30 changes: 30 additions & 0 deletions
30
examples/workloads/kubelet-density-cni/templates/webserver-deployment.yml
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,30 @@ | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/worker: "" | ||
containers: | ||
- name: webserver | ||
image: quay.io/cloud-bulldozer/sampleapp:latest | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
privileged: false | ||
restartPolicy: Always | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
triggers: | ||
- type: ConfigChange | ||
strategy: | ||
type: RollingUpdate |
12 changes: 12 additions & 0 deletions
12
examples/workloads/kubelet-density-cni/templates/webserver-service.yml
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 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
spec: | ||
selector: | ||
name: webserver-{{.Replica}}-{{.Iteration}} | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
type: ClusterIP |