feat(argo-rollouts): add dashboard deployment and service

credit: the implemention is inspired by the work from
    Andrii Perenesenko <andrii.perenesenko@gmail.com>.

Signed-off-by: Hui Kang <hui.kang@salesforce.com>
This commit is contained in:
Hui Kang 2021-06-07 23:26:13 -04:00
parent 8125f928ea
commit 6a72cc9ea1
10 changed files with 13311 additions and 1 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "v1.0.2"
description: A Helm chart for Argo Rollouts
name: argo-rollouts
version: 1.0.4
version: 1.1.0
icon: https://argoproj.github.io/argo-rollouts/assets/logo.png
home: https://github.com/argoproj/argo-helm
maintainers:

View file

@ -25,6 +25,9 @@ $ helm repo add argo https://argoproj.github.io/argo-helm
$ helm install my-release argo/argo-rollouts
```
If dashboard is installed by `--set dashboard.enabled=true`, checkout the argo-rollouts dashboard by
`kubectl port-forward service/argo-rollouts-dashboard 31000:3100` and pointing the browser to `localhost:31000`
## Chart Values
| Key | Type | Default | Description |
@ -53,6 +56,7 @@ $ helm install my-release argo/argo-rollouts
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| podSecurityContext | object | `{"runAsNonRoot": true}` | Security Context to set on pod level |
| containerSecurityContext | object | `{}` | Security Context to set on container level |
| dashboard.enabled | bool | `false` | Deploy dashboard server |
## Upgrading

View file

@ -52,6 +52,14 @@ app.kubernetes.io/name: {{ include "argo-rollouts.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Selector labels: dashboard
*/}}
{{- define "argo-rollouts.selectorLabels-dashboard" -}}
app.kubernetes.io/name: {{ include "argo-rollouts.name" . }}-dashboard
app.kubernetes.io/instance: {{ .Release.Name }}-dashboard
{{- end }}
{{/*
Create the name of the service account to use
*/}}

View file

@ -0,0 +1,58 @@
{{- if and ( eq .Values.dashboard.enabled true) ( eq .Values.clusterInstall true) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "argo-rollouts.fullname" . }}-dashboard
labels:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
rules:
- apiGroups:
- argoproj.io
resources:
- rollouts
- rollouts/status
- rollouts/finalizers
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- argoproj.io
resources:
- analysisruns
- analysisruns/finalizers
- experiments
- experiments/finalizers
verbs:
- create
- get
- list
- watch
- apiGroups:
- argoproj.io
resources:
- analysistemplates
- clusteranalysistemplates
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- watch
{{- end }}

View file

@ -0,0 +1,17 @@
{{- if and ( eq .Values.dashboard.enabled true) ( eq .Values.clusterInstall true) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "argo-rollouts.fullname" . }}-dashboard
labels:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "argo-rollouts.fullname" . }}-dashboard
subjects:
- kind: ServiceAccount
name: {{ include "argo-rollouts.serviceAccountName" . }}-dashboard
namespace: {{ .Release.Namespace }}
{{- end }}

View file

@ -0,0 +1,57 @@
{{- if .Values.dashboard.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "argo-rollouts.fullname" . }}-dashboard
labels:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "argo-rollouts.selectorLabels-dashboard" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "argo-rollouts.selectorLabels-dashboard" . | nindent 8 }}
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "argo-rollouts.serviceAccountName" . }}-dashboard
containers:
- image: "{{ .Values.dashboard.image.registry }}/{{ .Values.dashboard.image.repository }}:{{ default .Chart.AppVersion .Values.dashboard.image.tag }}"
imagePullPolicy: {{ .Values.dashboard.image.pullPolicy }}
name: argo-rollouts-dashboard
ports:
- containerPort: 3100
name: dashboard
securityContext:
{{- toYaml .Values.dashboard.containerSecurityContext | nindent 10 }}
resources:
{{- toYaml .Values.dashboard.resources | nindent 10 }}
{{- if .Values.dashboard.nodeSelector }}
nodeSelector:
{{- toYaml .Values.dashboard.nodeSelector | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.dashboard.podSecurityContext | nindent 8 }}
{{- if .Values.dashboard.tolerations }}
tolerations:
{{- toYaml .Values.dashboard.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.dashboard.affinity }}
affinity:
{{- toYaml .Values.dashboard.affinity | nindent 8 }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,13 @@
{{- if and ( eq .Values.dashboard.enabled true) ( eq .Values.dashboard.serviceAccount.create true) }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "argo-rollouts.serviceAccountName" . }}-dashboard
labels:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
{{- with .Values.dashboard.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,22 @@
{{- if .Values.dashboard.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "argo-rollouts.fullname" . }}-dashboard
labels:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
{{- with .Values.serviceAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- name: dashboard
protocol: TCP
port: 3100
targetPort: 3100
selector:
# app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.selectorLabels-dashboard" . | nindent 6 }}
{{- end }}

File diff suppressed because it is too large Load diff

View file

@ -94,3 +94,29 @@ podLabels: {}
# Secrets with credentials to pull images from a private registry
imagePullSecrets: []
# - name: argo-pull-secret
dashboard:
enabled: false
component: rollouts-dashboard
## Node selectors and tolerations for server scheduling to nodes with taints
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
nodeSelector: {}
tolerations: []
affinity: {}
image:
registry: quay.io
repository: argoproj/kubectl-argo-rollouts
tag: ""
pullPolicy: IfNotPresent
resources: {}
podSecurityContext: {}
# Enable runAsNonRoot after image version v1.0.1
# runAsNonRoot: true
containerSecurityContext: {}
serviceAccount:
create: true
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""