Files
fission-src/charts/fission-all/templates/controller/deployment.yaml
T
Shubham BansalandGitHub 6d117ad43a Allow empty namespace for fission function and builder (#2621)
Currently, we create Fission resources in the default namespace, function-related resources are created in the fission-function namespace, whereas builder resources are created in the fission-builder namespace. This causes confusion for a lot of users.
In this fix, we allow the user to set the function and builder namespace empty so that function and builder resources are created in the same namespace as the function resource always.

If the user desires older behaviour they can functionNamespace and builderNamespace the same previous before the upgrade.

* use default namespace for fission  function and builder
* support for existing fission namespaces
* Replace builder and function namespace with template
* Fix namespace creation template

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-16 22:16:05 +05:30

102 lines
3.2 KiB
YAML

{{- if or (.Values.controller.enabled) (.Values.influxdb.enabled) }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
svc: controller
application: fission-api
spec:
replicas: 1
selector:
matchLabels:
svc: controller
application: fission-api
template:
metadata:
labels:
svc: controller
application: fission-api
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/port: "8080"
spec:
{{- if .Values.controller.securityContext.enabled }}
securityContext: {{- omit .Values.controller.securityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
containers:
- name: controller
image: {{ include "fission-bundleImage" . | quote }}
imagePullPolicy: {{ .Values.pullPolicy }}
command: ["/fission-bundle"]
args: ["--controllerPort", "8888"]
env:
- name: FISSION_DEFAULT_NAMESPACE
value: "{{ .Values.defaultNamespace }}"
- name: FISSION_BUILDER_NAMESPACE
value: "{{ .Values.builderNamespace }}"
- name: FISSION_FUNCTION_NAMESPACE
value: "{{ .Values.functionNamespace }}"
- name: DEBUG_ENV
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "fission-resource-namespace.envs" . | indent 8 }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.controller.resources | nindent 10 }}
{{- if .Values.terminationMessagePath }}
terminationMessagePath: {{ .Values.terminationMessagePath }}
{{- end }}
{{- if .Values.terminationMessagePolicy }}
terminationMessagePolicy: {{ .Values.terminationMessagePolicy }}
{{- end }}
readinessProbe:
httpGet:
path: "/healthz"
port: 8888
initialDelaySeconds: 1
periodSeconds: 1
failureThreshold: 30
livenessProbe:
httpGet:
path: "/healthz"
port: 8888
initialDelaySeconds: 35
periodSeconds: 5
volumeMounts:
- name: config-volume
mountPath: /etc/config/config.yaml
subPath: config.yaml
ports:
- containerPort: 8080
name: metrics
- containerPort: 8888
name: http
{{- if .Values.pprof.enabled }}
- containerPort: 6060
name: pprof
{{- end }}
serviceAccountName: fission-controller
volumes:
- name: config-volume
configMap:
name: feature-config
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.extraCoreComponentPodConfig }}
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
{{- end }}
{{- end -}}