Add support for namespaced install
This commit is contained in:
parent
664829aa24
commit
565f984149
8 changed files with 55 additions and 11 deletions
|
@ -1,6 +1,10 @@
|
||||||
{{- if .Values.server.enabled }}
|
{{- if .Values.server.enabled }}
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role
|
name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role
|
||||||
rules:
|
rules:
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
{{- if .Values.server.enabled -}}
|
{{- if .Values.server.enabled -}}
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: RoleBinding
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Values.server.name}}-crb
|
name: {{ .Release.Name }}-{{ .Values.server.name}}-crb
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role
|
name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
{{- if .Values.server.enabled -}}
|
||||||
{{- if .Values.server.enabled -}}apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Values.server.name}}
|
name: {{ .Release.Name }}-{{ .Values.server.name}}
|
||||||
|
@ -13,7 +13,6 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: {{ .Release.Name }}-{{ .Values.server.name}}
|
app: {{ .Release.Name }}-{{ .Values.server.name}}
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
app: {{ .Release.Name }}-{{ .Values.server.name}}
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
@ -31,13 +30,16 @@ spec:
|
||||||
- name: argo-server
|
- name: argo-server
|
||||||
args:
|
args:
|
||||||
- server
|
- server
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
- "--namespaced"
|
||||||
|
{{- end }}
|
||||||
image: "{{ .Values.images.namespace }}/{{ .Values.images.server }}:{{ default .Values.images.tag .Values.server.image.tag }}"
|
image: "{{ .Values.images.namespace }}/{{ .Values.images.server }}:{{ default .Values.images.tag .Values.server.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.images.pullPolicy }}
|
imagePullPolicy: {{ .Values.images.pullPolicy }}
|
||||||
{{- if .Values.server.podPortName }}
|
{{- if .Values.server.podPortName }}
|
||||||
ports:
|
ports:
|
||||||
- name: {{ .Values.server.podPortName }}
|
- name: {{ .Values.server.podPortName }}
|
||||||
ports:
|
|
||||||
containerPort: 2746
|
containerPort: 2746
|
||||||
|
{{- end }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /
|
||||||
|
@ -45,7 +47,6 @@ spec:
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 20
|
periodSeconds: 20
|
||||||
{{- end }}
|
|
||||||
env:
|
env:
|
||||||
{{- if .Values.server.forceNamespaceIsolation }}
|
{{- if .Values.server.forceNamespaceIsolation }}
|
||||||
- name: FORCE_NAMESPACE_ISOLATION
|
- name: FORCE_NAMESPACE_ISOLATION
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
{{- if .Values.createAggregateRoles }}
|
{{- if .Values.createAggregateRoles }}
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
helm.sh/hook: pre-install
|
helm.sh/hook: pre-install
|
||||||
|
@ -24,7 +28,11 @@ rules:
|
||||||
- watch
|
- watch
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
helm.sh/hook: pre-install
|
helm.sh/hook: pre-install
|
||||||
|
@ -53,7 +61,11 @@ rules:
|
||||||
- watch
|
- watch
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
helm.sh/hook: pre-install
|
helm.sh/hook: pre-install
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Values.controller.name}}-cluster-role
|
name: {{ .Release.Name }}-{{ .Values.controller.name}}-cluster-role
|
||||||
rules:
|
rules:
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: RoleBinding
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
{{- end }}
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Values.controller.name}}-binding
|
name: {{ .Release.Name }}-{{ .Values.controller.name}}-binding
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
kind: Role
|
||||||
|
{{ else }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
{{- end }}
|
||||||
name: {{ .Release.Name }}-{{ .Values.controller.name}}-cluster-role
|
name: {{ .Release.Name }}-{{ .Values.controller.name}}-cluster-role
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
|
|
|
@ -40,6 +40,9 @@ spec:
|
||||||
- "{{ .Values.controller.logging.level }}"
|
- "{{ .Values.controller.logging.level }}"
|
||||||
- "--gloglevel"
|
- "--gloglevel"
|
||||||
- "{{ .Values.controller.logging.globallevel }}"
|
- "{{ .Values.controller.logging.globallevel }}"
|
||||||
|
{{- if .Values.namespaced }}
|
||||||
|
- "--namespaced"
|
||||||
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
- name: ARGO_NAMESPACE
|
- name: ARGO_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
@ -16,6 +16,10 @@ init:
|
||||||
|
|
||||||
createAggregateRoles: true
|
createAggregateRoles: true
|
||||||
|
|
||||||
|
# Install argo components into a single namespace. Apply Roles and RoleBindings instead of the Cluster equivalents,
|
||||||
|
# and start argo-cli with the --namespaced flag.
|
||||||
|
namespaced: false
|
||||||
|
|
||||||
controller:
|
controller:
|
||||||
image:
|
image:
|
||||||
# Overrides .images.tag if defined.
|
# Overrides .images.tag if defined.
|
||||||
|
|
Loading…
Reference in a new issue