hunhoffe commented on code in PR #729: URL: https://github.com/apache/openwhisk-deploy-kube/pull/729#discussion_r973326256
########## helm/openwhisk/templates/scheduler-pod.yaml: ########## @@ -0,0 +1,273 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +{{- if .Values.scheduler.enable }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ .Release.Name }}-scheduler + labels: + name: {{ .Release.Name }}-scheduler +{{ include "openwhisk.label_boilerplate" . | indent 4 }} +spec: + serviceName: {{ .Release.Name }}-scheduler + podManagementPolicy: "Parallel" + replicas: {{ .Values.scheduler.replicaCount }} + selector: + matchLabels: + name: {{ .Release.Name }}-scheduler + template: + metadata: + labels: + name: {{ .Release.Name }}-scheduler +{{ include "openwhisk.label_boilerplate" . | indent 8 }} + + {{- if .Values.metrics.prometheusEnabled }} + annotations: + prometheus.io/scrape: 'true' + prometheus.io/port: '{{ .Values.scheduler.port }}' + {{- end }} + + spec: + serviceAccountName: {{ .Release.Name }}-core + restartPolicy: {{ .Values.scheduler.restartPolicy }} + + {{- if .Values.affinity.enabled }} + affinity: +{{ include "openwhisk.affinity.core" . | indent 8 }} +{{ include "openwhisk.affinity.selfAntiAffinity" ( printf "%s-scheduler" .Release.Name ) | indent 8 }} + {{- end }} + + {{- if .Values.toleration.enabled }} + tolerations: +{{ include "openwhisk.toleration.core" . | indent 8 }} + {{- end }} + + initContainers: + # The scheduler must wait for kafka and/or couchdb to be ready before it starts +{{ include "openwhisk.readiness.waitForController" . | indent 6 }} +{{ include "openwhisk.docker.imagePullSecrets" . | indent 6 }} + + containers: + - name: scheduler + imagePullPolicy: {{ .Values.scheduler.imagePullPolicy | quote }} + image: "{{- .Values.docker.registry.name -}}{{- .Values.scheduler.imageName -}}:{{- .Values.scheduler.imageTag -}}" + command: ["/bin/bash", "-c", "/init.sh `hostname | awk -F '-' '{print $NF}'`"] + ports: + - name: scheduler + containerPort: {{ .Values.scheduler.port }} + - name: rpc + containerPort: {{ .Values.scheduler.rpcPort }} + - name: akka-remoting + containerPort: 25520 + - name: akka-mgmt-http + containerPort: 19999 + livenessProbe: + httpGet: + path: "/ping" + port: {{ .Values.scheduler.port }} + scheme: "HTTP" + initialDelaySeconds: {{ .Values.probes.scheduler.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.scheduler.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.probes.scheduler.livenessProbe.timeoutSeconds }} + readinessProbe: + httpGet: + path: "/ping" + port: {{ .Values.scheduler.port }} + scheme: "HTTP" + initialDelaySeconds: {{ .Values.probes.scheduler.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.scheduler.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.probes.scheduler.readinessProbe.timeoutSeconds }} + env: Review Comment: I have some confusion with how ```whisk cluster name``` is implemented in the main OpenWhisk repo, and I'd appreciate your help in understanding why it is the way it is. In the link you pasted it is ```CONFIG_whisk_cluster_name```, but in config hierarchy it is ```whisk.cluster_name```. My understanding is that it should be ```CONFIG_whisk_clusterName``` to follow convention. To my understanding it is etcd specific, so shouldn't it be under ```etcd.clusterName``` and not in ```whisk.clusterName```? I believe elasticsearch config takes this approach here: https://github.com/apache/openwhisk/blob/a1639f0e4d7270c9a230190ac26acb61413b6bbb/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2#L1 I am asking these questions because I don't want to modify the main whisk config for scheduler-specific things if I don't have to. If there is a reason for it to be the way it is currently in OpenWhisk, I can still add it to this PR. But I wanted some clarification first. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
