Skip to content

Commit

Permalink
pipelines per component resources etc
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <[email protected]>
  • Loading branch information
davidspek committed Sep 18, 2023
1 parent 4b0b9f2 commit a081c43
Show file tree
Hide file tree
Showing 25 changed files with 752 additions and 179 deletions.
18 changes: 9 additions & 9 deletions kubeflow/helm/pipelines/templates/api-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- if not .Values.apiServer.autoscaling.enabled }}
replicas: {{ .Values.apiServer.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "pipelines.apiServerSelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with .Values.apiServer.podAnnotations }}
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
{{- toYaml . | nindent 8 }}
Expand All @@ -27,11 +27,11 @@ spec:
{{- end }}
serviceAccountName: {{ include "pipelines.serviceAccountName" . }}-api-server
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.apiServer.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-api-server
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.apiServer.securityContext | nindent 12 }}
image: "{{ .Values.apiServer.image.repository }}:{{ .Values.apiServer.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.apiServer.image.pullPolicy }}
env:
Expand Down Expand Up @@ -156,16 +156,16 @@ spec:
periodSeconds: 5
timeoutSeconds: 2
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
{{- toYaml .Values.apiServer.resources | nindent 12 }}
{{- with .Values.apiServer.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.apiServer.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.apiServer.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
32 changes: 32 additions & 0 deletions kubeflow/helm/pipelines/templates/api-server/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.apiServer.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "pipelines.fullname" . }}-api-server
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "pipelines.fullname" . }}-api-server
minReplicas: {{ .Values.apiServer.autoscaling.minReplicas }}
maxReplicas: {{ .Values.apiServer.autoscaling.maxReplicas }}
metrics:
{{- if .Values.apiServer.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.apiServer.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.apiServer.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.apiServer.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- if not .Values.argoWorkflowController.autoscaling.enabled }}
replicas: {{ .Values.argoWorkflowController.replicaCount }}
{{- end }}
selector:
matchLabels:
Expand Down Expand Up @@ -65,16 +65,16 @@ spec:
resources:
{{- toYaml .Values.argoWorkflowController.resources | nindent 12 }}
priorityClassName: {{ include "pipelines.fullname" . }}-argo-workflow-controller
{{- with .Values.nodeSelector }}
{{- with .Values.argoWorkflowController.nodeSelector }}
nodeSelector:
kubernetes.io/os: linux
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.argoWorkflowController.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.argoWorkflowController.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.argoWorkflowController.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "pipelines.fullname" . }}-argo-workflow-controller
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "pipelines.fullname" . }}-argo-workflow-controller
minReplicas: {{ .Values.argoWorkflowController.autoscaling.minReplicas }}
maxReplicas: {{ .Values.argoWorkflowController.autoscaling.maxReplicas }}
metrics:
{{- if .Values.argoWorkflowController.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.argoWorkflowController.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.argoWorkflowController.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.argoWorkflowController.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
19 changes: 9 additions & 10 deletions kubeflow/helm/pipelines/templates/cache/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ metadata:
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- if not .Values.cache.server.autoscaling.enabled }}
replicas: {{ .Values.cache.server.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "pipelines.cacheServerSelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with .Values.cache.server.podAnnotations }}
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand All @@ -27,11 +26,11 @@ spec:
{{- end }}
serviceAccountName: {{ include "pipelines.serviceAccountName" . }}-cache-server
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.cache.server.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-cache-server
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.cache.server.securityContext | nindent 12 }}
image: "{{ .Values.cache.server.image.repository }}:{{ .Values.cache.server.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.cache.server.image.pullPolicy }}
args:
Expand Down Expand Up @@ -105,7 +104,7 @@ spec:
containerPort: 8443
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml .Values.cache.server.resources | nindent 12 }}
volumeMounts:
- mountPath: /etc/webhook/certs
name: webhook-tls-certs
Expand All @@ -114,15 +113,15 @@ spec:
- secret:
secretName: {{ include "pipelines.fullname" . }}-cache-server-tls
name: webhook-tls-certs
{{- with .Values.nodeSelector }}
{{- with .Values.cache.server.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.cache.server.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.cache.server.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
32 changes: 32 additions & 0 deletions kubeflow/helm/pipelines/templates/cache/server/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.cache.server.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "pipelines.fullname" . }}-cache-server
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "pipelines.fullname" . }}-cache-server
minReplicas: {{ .Values.cache.server.autoscaling.minReplicas }}
maxReplicas: {{ .Values.cache.server.autoscaling.maxReplicas }}
metrics:
{{- if .Values.cache.server.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.cache.server.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.cache.server.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.cache.server.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
21 changes: 11 additions & 10 deletions kubeflow/helm/pipelines/templates/metadata/envoy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ metadata:
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- if not .Values.metadata.envoy.autoscaling.enabled }}
replicas: {{ .Values.metadata.envoy.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "pipelines.metadataEnvoySelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.metadata.envoy.podAnnotations }}
annotations:
sidecar.istio.io/inject: "false"
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pipelines.metadataEnvoySelectorLabels" . | nindent 8 }}
spec:
Expand All @@ -25,11 +26,11 @@ spec:
{{- end }}
serviceAccountName: {{ include "pipelines.serviceAccountName" . }}-metadata-envoy
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.metadata.envoy.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-metadata-envoy
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- toYaml .Values.metadata.envoy.securityContext | nindent 12 }}
image: "{{ .Values.metadata.envoy.image.repository }}:{{ .Values.metadata.envoy.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.metadata.envoy.image.pullPolicy }}
args:
Expand All @@ -42,23 +43,23 @@ spec:
containerPort: 9901
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml .Values.metadata.envoy.resources | nindent 12 }}
volumeMounts:
- mountPath: /config
name: config-volume
volumes:
- configMap:
name: {{ include "pipelines.fullname" . }}-metadata-envoy-config
name: config-volume
{{- with .Values.nodeSelector }}
{{- with .Values.metadata.envoy.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.metadata.envoy.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.metadata.envoy.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
32 changes: 32 additions & 0 deletions kubeflow/helm/pipelines/templates/metadata/envoy/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if .Values.metadata.envoy.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "pipelines.fullname" . }}-metadata-envoy
labels:
{{- include "pipelines.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "pipelines.fullname" . }}-metadata-envoy
minReplicas: {{ .Values.metadata.envoy.autoscaling.minReplicas }}
maxReplicas: {{ .Values.metadata.envoy.autoscaling.maxReplicas }}
metrics:
{{- if .Values.metadata.envoy.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.metadata.envoy.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.metadata.envoy.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.metadata.envoy.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
Loading

0 comments on commit a081c43

Please sign in to comment.