Skip to content

Commit

Permalink
Updates to charts for readiness changes (#1640)
Browse files Browse the repository at this point in the history
* chart changes to align resourceType lists

Signed-off-by: Michael Kalantar <[email protected]>

* update workflow, kustomize

Signed-off-by: Michael Kalantar <[email protected]>

* update image versions

Signed-off-by: Michael Kalantar <[email protected]>

* remove duplicate argument

Signed-off-by: Michael Kalantar <[email protected]>

---------

Signed-off-by: Michael Kalantar <[email protected]>
  • Loading branch information
kalantar authored Sep 19, 2023
1 parent 467287a commit 210bf3c
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 132 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/verifyuserexperience.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Start performance test
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 httpbin-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 httpbin-test iter8 \
--set "tasks={http}" \
--set http.url="http://httpbin.default/get" \
--set logLevel=trace
Expand Down Expand Up @@ -77,13 +77,13 @@ jobs:
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Start performance test
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 httpbin-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 httpbin-test iter8 \
--set "tasks={http}" \
--set http.url="http://httpbin.default/post" \
--set http.payloadStr=hello \
Expand Down Expand Up @@ -126,13 +126,13 @@ jobs:
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Start performance test
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 httpbin-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 httpbin-test iter8 \
--set "tasks={http}" \
--set http.endpoints.get.url=http://httpbin.default/get \
--set http.endpoints.getAnything.url=http://httpbin.default/anything \
Expand Down Expand Up @@ -184,13 +184,13 @@ jobs:
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Start performance test
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 routeguide-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 routeguide-test iter8 \
--set "tasks={ready,grpc}" \
--set ready.deploy=routeguide \
--set ready.service=routeguide \
Expand Down Expand Up @@ -245,13 +245,13 @@ jobs:
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Start performance test
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 routeguide-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 routeguide-test iter8 \
--set "tasks={ready,grpc}" \
--set ready.deploy=routeguide \
--set ready.service=routeguide \
Expand Down Expand Up @@ -300,13 +300,13 @@ jobs:
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Start performance test
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 hello-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 hello-test iter8 \
--set "tasks={grpc}" \
--set grpc.host="hello.default:50051" \
--set grpc.call="helloworld.Greeter.SayHello" \
Expand Down Expand Up @@ -344,7 +344,7 @@ jobs:
# allowing ready task to be tested
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Create httpbin application
Expand All @@ -356,7 +356,7 @@ jobs:
- name: k launch with readiness checks
run: |
helm upgrade --install \
--repo https://iter8-tools.github.io/iter8 --version 0.17 httpbin-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 httpbin-test iter8 \
--set "tasks={ready,http}" \
--set ready.deploy="httpbin" \
--set ready.service="httpbin" \
Expand Down Expand Up @@ -396,7 +396,7 @@ jobs:
# allowing ready task to be tested
- name: Install controller
run: |
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --set logLevel=trace
helm install --repo https://iter8-tools.github.io/iter8 iter8 controller --version 0.18 --set logLevel=trace
kubectl rollout status --watch --timeout=60s statefulset/iter8
- name: Create httpbin application
Expand All @@ -412,7 +412,7 @@ jobs:
- name: k launch with readiness checks and namespace
run: |
helm upgrade --install -n experiments \
--repo https://iter8-tools.github.io/iter8 --version 0.17 httpbin-test iter8 \
--repo https://iter8-tools.github.io/iter8 --version 0.18 httpbin-test iter8 \
--set "tasks={ready,http}" \
--set ready.deploy="httpbin" \
--set ready.service="httpbin" \
Expand Down
2 changes: 1 addition & 1 deletion charts/controller/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: controller
version: 0.1.12
version: 0.18.0
description: Iter8 controller controller
type: application
keywords:
Expand Down
12 changes: 7 additions & 5 deletions charts/controller/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Controller image
image: iter8/iter8:0.17
image: iter8/iter8:0.18

### default resync time for controller
defaultResync: 15m
Expand All @@ -16,6 +16,10 @@ resourceTypes:
Group: ""
Version: v1
Resource: services
service:
Group: ""
Version: v1
Resource: services
cm:
Group: ""
Version: v1
Expand All @@ -25,15 +29,13 @@ resourceTypes:
Version: v1
Resource: deployments
conditions:
- name: Available
status: "True"
- Available
isvc:
Group: serving.kserve.io
Version: v1beta1
Resource: inferenceservices
conditions:
- name: Ready
status: "True"
- Ready
vs:
Group: networking.istio.io
Version: v1beta1
Expand Down
2 changes: 1 addition & 1 deletion charts/iter8/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: iter8
version: 0.17.0
version: 0.18.0
description: Iter8 experiment chart
type: application
home: https://iter8.tools
Expand Down
52 changes: 17 additions & 35 deletions charts/iter8/templates/_k-role.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,28 @@ rules:
verbs: ["get", "update"]
{{- if .Values.ready }}
---
{{- $namespace := coalesce .Values.ready.namespace .Release.Namespace }}
{{- if $namespace }}
{{- $namespace := coalesce $.Values.ready.namespace $.Release.Namespace }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Release.Name }}-ready
{{- if $namespace }}
namespace: {{ $namespace }}
{{- end }} {{- /* if $namespace */}}
annotations:
iter8.tools/test: {{ .Release.Name }}
rules:
{{- if .Values.ready.service }}
- apiGroups: [""]
resourceNames: [{{ .Values.ready.service | quote }}]
resources: ["services"]
verbs: ["get"]
{{- end }}
{{- if .Values.ready.deploy }}
- apiGroups: ["apps"]
resourceNames: [{{ .Values.ready.deploy | quote }}]
resources: ["deployments"]
verbs: ["get"]
{{- end }}
{{- if .Values.ready.ksvc }}
- apiGroups: ["serving.knative.dev"]
resourceNames: [{{ .Values.ready.ksvc | quote }}]
resources: ["services"]
verbs: ["get"]
{{- end }}
{{- if .Values.ready.isvc }}
- apiGroups: ["serving.kserve.io"]
resourceNames: [{{ .Values.ready.isvc | quote }}]
resources: ["inferenceservices"]
verbs: ["get"]
{{- end }}
{{- if .Values.ready.chaosengine }}
- apiGroups: ["litmuschaos.io"]
resourceNames: [{{ .Values.ready.chaosengine | quote }}]
resources: ["chaosengines"]
verbs: ["get"]
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- $typesToCheck := omit .Values.ready "timeout" "namespace" }}
{{- range $type, $name := $typesToCheck }}
{{- $definition := get $.Values.resourceTypes $type }}
{{- if not $definition }}
{{- cat "no type definition for: " $type | fail }}
{{- else }}
- apiGroups: [ {{ get $definition "Group" | quote }} ]
resourceNames: [ {{ $name | quote }} ]
resources: [ {{ get $definition "Resource" | quote }} ]
verbs: [ "get" ]
{{- end }} {{- /* if not $definition */}}
{{- end }} {{- /* range $type, $name */}}
{{- end }} {{- /* {{- if .Values.ready */}}
{{- end }} {{- /* {{- if .Values.ready */}}
90 changes: 26 additions & 64 deletions charts/iter8/templates/_task-ready.tpl
Original file line number Diff line number Diff line change
@@ -1,68 +1,30 @@
{{- define "task.ready.tn" }}
{{- if .Values.ready }}
{{- $namespace := coalesce .Values.ready.namespace .Release.Namespace }}
{{- if $namespace }}
namespace: {{ $namespace }}
{{- end }}
{{- if .Values.ready.timeout }}
timeout: {{ .Values.ready.timeout }}
{{- end }}
{{- end }}
{{- end }}
{{- define "task.ready" }}
{{- if .Values.ready }}
{{- $namespace := coalesce .Values.ready.namespace .Release.Namespace }}
{{- if .Values.ready.service }}
# task: determine if Kubernetes Service exists
- task: ready
with:
name: {{ .Values.ready.service | quote }}
version: v1
resource: services
{{- include "task.ready.tn" . }}
{{- end }}
{{- if .Values.ready.deploy }}
# task: determine if Kubernetes Deployment exists and is Available
- task: ready
with:
name: {{ .Values.ready.deploy | quote }}
group: apps
version: v1
resource: deployments
condition: Available
{{- include "task.ready.tn" . }}
{{- end }}
{{- if .Values.ready.ksvc }}
# task: determine if Knative Service exists and is ready
{{- $typesToCheck := omit .Values.ready "timeout" "namespace" }}
{{- range $type, $name := $typesToCheck }}
{{- $definition := get $.Values.resourceTypes $type }}
{{- if not $definition }}
{{- cat "no type definition for: " $type | fail }}
{{- else }}
# task: test for existence and readiness of a resource
- task: ready
with:
name: {{ .Values.ready.ksvc | quote }}
group: serving.knative.dev
version: v1
resource: services
condition: Ready
{{- include "task.ready.tn" . }}
{{- end }}
{{- if .Values.ready.isvc }}
# task: determine if KServe InferenceService exists and is ready
- task: ready
with:
name: {{ .Values.ready.isvc | quote }}
group: serving.kserve.io
version: v1beta1
resource: inferenceservices
condition: Ready
{{- include "task.ready.tn" . }}
{{- end }}
{{- if .Values.ready.chaosengine }}
# task: determine if chaos engine resource exists
- task: ready
with:
name: {{ .Values.ready.chaosengine | quote }}
group: litmuschaos.io
version: v1alpha1
resource: chaosengines
{{- include "task.ready.tn" . }}
{{- end }}
{{- end }}
{{- end }}
name: {{ $name | quote }}
group: {{ get $definition "Group" | quote }}
version: {{ get $definition "Version" | quote }}
resource: {{ get $definition "Resource" | quote }}
{{- if (hasKey $definition "conditions") }}
conditions:
{{ toYaml (get $definition "conditions") | indent 4 }}
{{- end }} {{- /* if (hasKey $definition "conditions") */}}
{{- $namespace := coalesce $.Values.ready.namespace $.Release.Namespace }}
{{- if $namespace }}
namespace: {{ $namespace }}
{{- end }} {{- /* if $namespace */}}
{{- if $.Values.ready.timeout }}
timeout: {{ $.Values.ready.timeout }}
{{- end }} {{- /* if $.Values.ready.timeout */}}
{{- end }} {{- /* if not $definition */}}
{{- end }} {{- /* range $type, $name */}}
{{- end }} {{- /* {{- if .Values.ready */}}
{{- end }} {{- /* define "task.ready" */}}
37 changes: 34 additions & 3 deletions charts/iter8/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### iter8Image default iter8 image used for running Kubernetes experiments
iter8Image: iter8/iter8:0.17
iter8Image: iter8/iter8:0.18

### majorMinor is the minor version of Iter8
majorMinor: v0.17
majorMinor: v0.18

logLevel: info

Expand All @@ -16,4 +16,35 @@ resources:
cpu: "500m"

### metricsServerURL is the URL to the Metrics server
metricsServerURL: http://iter8.default:8080
metricsServerURL: http://iter8.default:8080

### list of resource types and conditions used to evalutate object readiness.
resourceTypes:
svc:
Group: ""
Version: v1
Resource: services
service:
Group: ""
Version: v1
Resource: services
cm:
Group: ""
Version: v1
Resource: configmaps
deploy:
Group: apps
Version: v1
Resource: deployments
conditions:
- Available
isvc:
Group: serving.kserve.io
Version: v1beta1
Resource: inferenceservices
conditions:
- Ready
vs:
Group: networking.istio.io
Version: v1beta1
Resource: virtualservices
Loading

0 comments on commit 210bf3c

Please sign in to comment.