-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release chart Signed-off-by: Michael Kalantar <[email protected]> * update chart version Signed-off-by: Michael Kalantar <[email protected]> * update release chart Signed-off-by: Michael Kalantar <[email protected]> * helper for metadata Signed-off-by: Michael Kalantar <[email protected]> * kserve canary routemap template Signed-off-by: Michael Kalantar <[email protected]> * update release templates Signed-off-by: Michael Kalantar <[email protected]> * canary for deployment-istio Signed-off-by: Michael Kalantar <[email protected]> * add comment Signed-off-by: Michael Kalantar <[email protected]> * remove commented out code Signed-off-by: Michael Kalantar <[email protected]> --------- Signed-off-by: Michael Kalantar <[email protected]>
- Loading branch information
Showing
41 changed files
with
1,571 additions
and
807 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,26 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
|
||
# generated files need to be ignored | ||
experiment.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,21 @@ | ||
apiVersion: v2 | ||
name: release | ||
version: 0.18.1 | ||
description: Iter8 supported application release | ||
type: application | ||
keywords: | ||
- Iter8 | ||
- traffic | ||
- blue-green | ||
- canary | ||
- mirroring | ||
home: https://iter8.tools | ||
sources: | ||
- https://github.com/iter8-tools/iter8 | ||
maintainers: | ||
- name: Michael Kalantar | ||
email: [email protected] | ||
- name: Iter8 | ||
email: [email protected] | ||
icon: https://github.com/iter8-tools/iter8/raw/master/mkdocs/docs/images/favicon.png | ||
appVersion: v0.18 |
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 @@ | ||
{{- define "configmap.weight-config" }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .VERSION_NAME }}-weight-config | ||
labels: | ||
iter8.tools/watch: "true" | ||
{{- if .weight }} | ||
annotations: | ||
iter8.tools/weight: "{{ .weight }}" | ||
{{- end }} {{- /* if .weight */}} | ||
{{- end }} {{- /* define "configmap.weight-config" */}} |
77 changes: 77 additions & 0 deletions
77
charts/release/templates/_deployment-istio.blue-green.routemap.tpl
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,77 @@ | ||
{{- define "env.deployment-istio.blue-green.routemap" }} | ||
|
||
{{- $APP_NAME := (include "application.name" .) }} | ||
{{- $APP_NAMESPACE := (include "application.namespace" .) }} | ||
{{- $versions := include "normalize.versions.deployment" . | mustFromJson }} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
{{- template "routemap.metadata" . }} | ||
data: | ||
strSpec: | | ||
versions: | ||
{{- range $i, $v := $versions }} | ||
- resources: | ||
- gvrShort: svc | ||
name: {{ template "svc.name" $v }} | ||
namespace: {{ template "svc.namespace" $v }} | ||
- gvrShort: deploy | ||
name: {{ template "deploy.name" $v }} | ||
namespace: {{ template "deploy.namespace" $v }} | ||
- gvrShort: cm | ||
name: {{ $v.VERSION_NAME }}-weight-config | ||
namespace: {{ $v.VERSION_NAMESPACE }} | ||
weight: {{ $v.weight }} | ||
{{- end }} {{- /* range $i, $v := $versions */}} | ||
routingTemplates: | ||
{{ .Values.application.strategy }}: | ||
gvrShort: vs | ||
template: | | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: VirtualService | ||
metadata: | ||
name: {{ $APP_NAME }} | ||
namespace: {{ $APP_NAMESPACE }} | ||
spec: | ||
gateways: | ||
{{- if .Values.gateway }} | ||
- {{ .Values.gateway }} | ||
{{- end }} | ||
- mesh | ||
hosts: | ||
- {{ $APP_NAME }}.{{ $APP_NAMESPACE }} | ||
- {{ $APP_NAME }}.{{ $APP_NAMESPACE }}.svc | ||
- {{ $APP_NAME }}.{{ $APP_NAMESPACE }}.svc.cluster.local | ||
http: | ||
- name: {{ $APP_NAME }} | ||
route: | ||
# primary version | ||
{{- $v := (index $versions 0) }} | ||
- destination: | ||
host: {{ template "svc.name" $v }}.{{ $APP_NAMESPACE }}.svc.cluster.local | ||
port: | ||
number: {{ $v.port }} | ||
{{- if gt (len $versions) 1 }} | ||
{{ `{{- if gt (index .Weights 1) 0 }}` }} | ||
weight: {{ `{{ index .Weights 0 }}` }} | ||
{{ `{{- end }}` }} | ||
{{- end }} | ||
headers: | ||
response: | ||
add: | ||
app-version: {{ template "svc.name" $v }} | ||
# other versions | ||
{{- range $i, $v := (rest $versions) }} | ||
{{ `{{- if gt (index .Weights ` }}{{ print (add1 $i) }}{{ `) 0 }}` }} | ||
- destination: | ||
host: {{ template "svc.name" $v }}.{{ $APP_NAMESPACE }}.svc.cluster.local | ||
port: | ||
number: {{ $v.port }} | ||
weight: {{ `{{ index .Weights ` }}{{ print (add1 $i) }}{{ ` }}` }} | ||
headers: | ||
response: | ||
add: | ||
app-version: {{ template "svc.name" $v }} | ||
{{ `{{- end }}` }} | ||
{{- end }} | ||
{{- end }} {{- /* define "env.deployment-istio.blue-green.routemap" */}} |
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 @@ | ||
{{- define "env.deployment-istio.blue-green" }} | ||
|
||
{{- /* prepare versions for simpler processing */}} | ||
{{- $versions := include "normalize.versions.deployment" . | mustFromJson }} | ||
|
||
{{- /* weight-config ConfigMaps */}} | ||
{{- range $i, $v := $versions }} | ||
{{ include "configmap.weight-config" $v }} | ||
--- | ||
{{- end }} {{- /* range $i, $v := $versions */}} | ||
|
||
{{- /* routemap */}} | ||
{{ include "env.deployment-istio.blue-green.routemap" . }} | ||
|
||
{{- end }} {{- /* define "env.deployment-istio.blue-green" */}} |
84 changes: 84 additions & 0 deletions
84
charts/release/templates/_deployment-istio.canary.routemap.tpl
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,84 @@ | ||
{{- define "env.deployment-istio.canary.routemap" }} | ||
|
||
{{- $APP_NAME := (include "application.name" .) }} | ||
{{- $APP_NAMESPACE := (include "application.namespace" .) }} | ||
{{- $versions := include "normalize.versions.deployment" . | mustFromJson }} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
{{- template "routemap.metadata" . }} | ||
data: | ||
strSpec: | | ||
versions: | ||
{{- range $i, $v := $versions }} | ||
- resources: | ||
- gvrShort: svc | ||
name: {{ template "svc.name" $v }} | ||
namespace: {{ template "svc.namespace" $v }} | ||
- gvrShort: deploy | ||
name: {{ template "deploy.name" $v }} | ||
namespace: {{ template "deploy.namespace" $v }} | ||
{{- end }} | ||
routingTemplates: | ||
{{ .Values.application.strategy }}: | ||
gvrShort: vs | ||
template: | | ||
apiVersion: networking.istio.io/v1beta1 | ||
kind: VirtualService | ||
metadata: | ||
name: {{ $APP_NAME }} | ||
namespace: {{ $APP_NAMESPACE }} | ||
spec: | ||
gateways: | ||
{{- if .Values.gateway }} | ||
- {{ .Values.gateway }} | ||
{{- end }} | ||
- mesh | ||
hosts: | ||
- {{ $APP_NAME }}.{{ $APP_NAMESPACE }} | ||
- {{ $APP_NAME }}.{{ $APP_NAMESPACE }}.svc | ||
- {{ $APP_NAME }}.{{ $APP_NAMESPACE }}.svc.cluster.local | ||
http: | ||
# non-primary versions | ||
{{- range $i, $v := (rest $versions) }} | ||
{{- /* continue only if candidate is ready (weight > 0) */}} | ||
{{ `{{- if gt (index .Weights ` }}{{ print (add1 $i) }}{{ `) 0 }}` }} | ||
- name: {{ template "svc.name" $v }} | ||
match: | ||
{{- /* A match may have several ORed clauses */}} | ||
{{- range $j, $m := $v.match }} | ||
{{- /* include any other header requirements */}} | ||
{{- if (hasKey $m "headers") }} | ||
- headers: | ||
{{ toYaml (pick $m "headers").headers | indent 18 }} | ||
{{- end }} {{- /* if (hasKey $m "headers") */}} | ||
{{- /* include any other (non-header) requirements */}} | ||
{{- if gt (omit $m "headers" | keys | len) 0 }} | ||
{{ toYaml (omit $m "headers") | indent 16 }} | ||
{{- end }} {{- /* if gt (omit $m "headers" | keys | len) 0 */}} | ||
{{- end }} {{- /* range $j, $m := $v.match */}} | ||
route: | ||
- destination: | ||
host: {{ template "svc.name" $v }}.{{ $APP_NAMESPACE }}.svc.cluster.local | ||
port: | ||
number: {{ $v.port }} | ||
headers: | ||
response: | ||
add: | ||
app-version: {{ template "svc.name" $v }} | ||
{{ `{{- end }}` }} | ||
{{- end }} {{- /* range $i, $v := (rest $versions) */}} | ||
# primary version (default) | ||
{{- $v := (index $versions 0) }} | ||
- name: {{ template "svc.name" $v }} | ||
route: | ||
- destination: | ||
host: {{ template "svc.name" $v }}.{{ $APP_NAMESPACE }}.svc.cluster.local | ||
port: | ||
number: {{ $v.port }} | ||
headers: | ||
response: | ||
add: | ||
app-version: {{ template "svc.name" $v }} | ||
|
||
{{- end }} {{- /* define "env.deployment-istio.canary.routemap" */}} |
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 @@ | ||
{{- define "env.deployment-istio.canary" }} | ||
|
||
{{- /* routemap */}} | ||
{{ include "env.deployment-istio.canary.routemap" . }} | ||
|
||
{{- end }} {{- /* define "env.deployment-istio.canary" */}} |
21 changes: 21 additions & 0 deletions
21
charts/release/templates/_deployment-istio.none.routemap.tpl
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,21 @@ | ||
{{- define "env.deployment-istio.none.routemap" }} | ||
|
||
{{- $versions := include "normalize.versions.deployment" . | mustFromJson }} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
{{- template "routemap.metadata" . }} | ||
data: | ||
strSpec: | | ||
versions: | ||
{{- range $i, $v := $versions }} | ||
- resources: | ||
- gvrShort: svc | ||
name: {{ template "svc.name" $v }} | ||
namespace: {{ template "svc.namespace" $v }} | ||
- gvrShort: deploy | ||
name: {{ template "deploy.name" $v }} | ||
namespace: {{ template "deploy.namespace" $v }} | ||
{{- end }} | ||
|
||
{{- end }} {{- /* define "env.deployment-istio.none.routemap" */}} |
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 @@ | ||
{{- define "env.deployment-istio.none" }} | ||
|
||
{{- /* routemap */}} | ||
{{ include "env.deployment-istio.none.routemap" . }} | ||
|
||
{{- end }} {{- /* define "env.deployment-istio.none" */}} |
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 @@ | ||
{{- define "env.deployment-istio.service" }} | ||
|
||
{{- $APP_NAME := (include "application.name" .) }} | ||
{{- $APP_NAMESPACE := (include "application.namespace" .) }} | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ $APP_NAME }} | ||
namespace: {{ $APP_NAMESPACE }} | ||
spec: | ||
externalName: istio-ingressgateway.istio-system.svc.cluster.local | ||
sessionAffinity: None | ||
type: ExternalName | ||
{{- end }} {{- /* define "env.deployment-istio.service" */}} |
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 @@ | ||
{{- define "env.deployment-istio" }} | ||
|
||
{{- /* Prepare versions for simpler processing */}} | ||
{{- $versions := include "normalize.versions.deployment" . | mustFromJson }} | ||
|
||
{{- range $i, $v := $versions }} | ||
{{- /* Deployment */}} | ||
{{ include "env.deployment.version.deployment" $v }} | ||
--- | ||
{{- /* Service */}} | ||
{{ include "env.deployment.version.service" $v }} | ||
--- | ||
{{- end }} {{- /* range $i, $v := $versions */}} | ||
|
||
{{- /* Service */}} | ||
{{ include "env.deployment-istio.service" . }} | ||
--- | ||
|
||
{{- /* routemap (and other strategy specific objects) */}} | ||
{{- if not .Values.application.strategy }} | ||
{{ include "env.deployment-istio.none" . }} | ||
{{- else if eq "none" .Values.application.strategy }} | ||
{{ include "env.deployment-istio.none" . }} | ||
{{- else if eq "blue-green" .Values.application.strategy }} | ||
{{ include "env.deployment-istio.blue-green" . }} | ||
{{- else if eq "canary" .Values.application.strategy }} | ||
{{ include "env.deployment-istio.canary" . }} | ||
{{- end }} {{- /* if eq ... .Values.application.strategy */}} | ||
|
||
{{- end }} {{- /* define "env.deployment-istio" */}} |
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,25 @@ | ||
{{- define "env.deployment" }} | ||
|
||
{{- /* Prepare versions for simpler processing */}} | ||
{{- $versions := include "normalize.versions.deployment" . | mustFromJson }} | ||
|
||
{{- range $i, $v := $versions }} | ||
|
||
{{- /* Deployment */}} | ||
{{ include "env.deployment.version.deployment" $v }} | ||
--- | ||
{{- /* Service */}} | ||
{{ include "env.deployment.version.service" $v }} | ||
--- | ||
{{- end }} {{- /* range $i, $v := $versions */}} | ||
|
||
{{- /* routemap (and other strategy specific objects) */}} | ||
{{- if not .Values.application.strategy }} | ||
{{ include "env.deployment-istio.none" . }} | ||
{{- else if eq "none" .Values.application.strategy }} | ||
{{ include "env.deployment-istio.none" . }} | ||
{{- else }} | ||
{{- printf "unknown or invalid application strategy (%s) for environment (%s)" .Values.application.strategy .Values.environment | fail }} | ||
{{- end }} {{- /* if eq ... .Values.application.strategy */}} | ||
|
||
{{- end }} {{- /* define "env.deployment" */}} |
Oops, something went wrong.