From 8fa5119428463c413964b34ce263b7fbb7063740 Mon Sep 17 00:00:00 2001 From: Andrew Suderman Date: Wed, 26 Feb 2020 16:33:14 -0700 Subject: [PATCH] Passing strict lint. Adding service in and fixing ingress --- charts/argo/templates/NOTES.txt | 2 +- charts/argo/templates/server-pdb.yaml | 25 +++++++++ charts/argo/templates/server-service.yaml | 36 ++++++++++++ charts/argo/values.yaml | 68 ++++++++++++++--------- 4 files changed, 104 insertions(+), 27 deletions(-) create mode 100644 charts/argo/templates/server-pdb.yaml create mode 100644 charts/argo/templates/server-service.yaml diff --git a/charts/argo/templates/NOTES.txt b/charts/argo/templates/NOTES.txt index 6a15d44b..7bdb4a76 100644 --- a/charts/argo/templates/NOTES.txt +++ b/charts/argo/templates/NOTES.txt @@ -1,6 +1,6 @@ 1. Get Argo UI external IP/domain by running: -kubectl --namespace {{ .Release.Namespace }} get services -o wide | grep {{ .Release.Name }}-{{ .Values.uiName }} +kubectl --namespace {{ .Release.Namespace }} get services -o wide | grep {{ .Release.Name }}-{{ .Values.ui.name }} 2. Submit the hello-world workflow by running: diff --git a/charts/argo/templates/server-pdb.yaml b/charts/argo/templates/server-pdb.yaml new file mode 100644 index 00000000..450ac159 --- /dev/null +++ b/charts/argo/templates/server-pdb.yaml @@ -0,0 +1,25 @@ +{{- if .Values.server.enabled }} +{{- if .Values.server.pdb.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name}} + labels: + app: {{ .Release.Name }}-{{ .Values.server.name}} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + {{- if .Values.server.pdb.minAvailable }} + minAvailable: {{ .Values.server.pdb.minAvailable }} + {{- else if .Values.server.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.server.pdb.maxUnavailable }} + {{- else }} + minAvailable: 0 + {{- end }} + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Values.server.name}} + release: {{ .Release.Name }} +{{- end }} +{{- end }} diff --git a/charts/argo/templates/server-service.yaml b/charts/argo/templates/server-service.yaml new file mode 100644 index 00000000..3cce60df --- /dev/null +++ b/charts/argo/templates/server-service.yaml @@ -0,0 +1,36 @@ +{{- if .Values.server.enabled }} +{{- if .Values.server.service.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name }} + labels: + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- if .Values.server.service.labels }} + {{- toYaml .Values.server.service.labels | nindent 4 }} + {{- end }} + {{- if .Values.server.service.annotations }} + annotations: +{{ toYaml .Values.server.service.annotations | indent 4}}{{- end }} +spec: + ports: + - port: {{ .Values.server.service.port.number }} + {{- if .Values.server.service.port.name }} + name: {{ .Values.server.service.port.name }} + {{- end }} + protocol: TCP + targetPort: 2754 + selector: + app: {{ .Release.Name }}-{{ .Values.server.name }} + sessionAffinity: None + type: {{ .Values.server.service.type }} + {{- if and (eq .Values.server.service.type "LoadBalancer") .Values.server.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.server.loadBalancerIP | quote }} + {{- end }} + {{- if and (eq .Values.server.service.type "LoadBalancer") .Values.server.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: +{{ toYaml .Values.server.service.loadBalancerSourceRanges | indent 4 }}{{- end }} +{{- end }} +{{- end }} diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index eeabe104..e2d24bff 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -26,29 +26,29 @@ controller: podAnnotations: {} # Optional labels to add to the controller pods podLabels: {} - # podPortName: http + podPortName: "" metricsConfig: enabled: false path: /metrics port: 8080 - persistence: {} - # connectionPool: - # maxIdleConns: 100 - # maxOpenConns: 0 - # # save the entire workflow into etcd and DB - # nodeStatusOffLoad: false - # postgresql: - # host: localhost - # port: 5432 - # database: postgres - # tableName: argo_workflows - # # the database secrets must be in the same namespace of the controller - # userNameSecret: - # name: argo-postgres-config - # key: username - # passwordSecret: - # name: argo-postgres-config - # key: password + persistence: {} + # connectionPool: + # maxIdleConns: 100 + # maxOpenConns: 0 + # # save the entire workflow into etcd and DB + # nodeStatusOffLoad: false + # postgresql: + # host: localhost + # port: 5432 + # database: postgres + # tableName: argo_workflows + # # the database secrets must be in the same namespace of the controller + # userNameSecret: + # name: argo-postgres-config + # key: username + # passwordSecret: + # name: argo-postgres-config + # key: password telemetryConfig: enabled: false path: /telemetry @@ -107,19 +107,34 @@ server: name: server image: tag: "" + replicas: 1 + resources: {} args: {} # Use this to pass additional server args. # Examples: # auth-mode: hybrid # basehref: ui - # podAnnotations is an optional map of annotations to be applied to the server Pods podAnnotations: {} - - # Optional labels to add to the server pods podLabels: {} - # podPortName: http - + nodeSelector: {} + tolerations: {} + affinity: {} + podPortName: "" + pdb: + enabled: false + minAvailable: 1 + maxUnavailable: 1 + service: + enabled: true + type: ClusterIP + port: + number: 80 + name: http + annotations: {} + labels: {} + loadBalancerIP: "" + loadBalancerSourceRanges: [] metricsConfig: enabled: false path: /metrics @@ -132,7 +147,7 @@ server: serviceMonitor: enabled: false additionalLabels: {} - serviceAccount: argo + serviceAccount: argo-server workflowNamespaces: - default containerRuntimeExecutor: docker @@ -184,7 +199,8 @@ ui: name: ui serviceType: ClusterIP servicePort: 80 - # servicePortName: http + servicePortName: "" + podPortName: "" serviceAccount: argo-ui # Annotations to be applied to the UI Service serviceAnnotations: {}