From 9f04fad5545f7fbb881b9ff3e6933e5aa78d7f6e Mon Sep 17 00:00:00 2001 From: Marcin Dobrochowski Date: Fri, 5 Apr 2024 16:34:14 +0200 Subject: [PATCH] remove unused serverless configs --- config/serverless/Chart.yaml | 4 +- config/serverless/charts/webhook/Chart.yaml | 5 - config/serverless/charts/webhook/README.md | 9 - .../charts/webhook/templates/_helpers.tpl | 38 -- .../templates/cluster-role-binding.yaml | 14 - .../webhook/templates/cluster-role.yaml | 47 -- .../templates/config-observability.yaml | 9 - .../charts/webhook/templates/configmap.yaml | 15 - .../charts/webhook/templates/deployment.yaml | 117 ---- .../charts/webhook/templates/secret.yaml | 8 - .../webhook/templates/service-account.yaml | 7 - .../charts/webhook/templates/service.yaml | 23 - .../charts/webhook/templates/webhooks.yaml | 76 --- config/serverless/charts/webhook/values.yaml | 115 ---- .../busola-serverless-extension.yaml | 587 ----------------- .../templates/cluster-role-binding.yaml | 14 - config/serverless/templates/cluster-role.yaml | 173 ----- config/serverless/templates/configmap.yaml | 9 - config/serverless/templates/crds.yaml | 610 ------------------ config/serverless/templates/deployment.yaml | 158 ----- .../leader-election-role-binding.yaml | 16 - .../templates/leader-election-role.yaml | 35 - config/serverless/templates/runtimes.yaml | 103 --- .../templates/service-accounts.yaml | 19 - config/serverless/templates/service.yaml | 29 - 25 files changed, 1 insertion(+), 2239 deletions(-) delete mode 100644 config/serverless/charts/webhook/Chart.yaml delete mode 100644 config/serverless/charts/webhook/README.md delete mode 100644 config/serverless/charts/webhook/templates/_helpers.tpl delete mode 100644 config/serverless/charts/webhook/templates/cluster-role-binding.yaml delete mode 100644 config/serverless/charts/webhook/templates/cluster-role.yaml delete mode 100644 config/serverless/charts/webhook/templates/config-observability.yaml delete mode 100644 config/serverless/charts/webhook/templates/configmap.yaml delete mode 100644 config/serverless/charts/webhook/templates/deployment.yaml delete mode 100644 config/serverless/charts/webhook/templates/secret.yaml delete mode 100644 config/serverless/charts/webhook/templates/service-account.yaml delete mode 100644 config/serverless/charts/webhook/templates/service.yaml delete mode 100644 config/serverless/charts/webhook/templates/webhooks.yaml delete mode 100644 config/serverless/charts/webhook/values.yaml delete mode 100644 config/serverless/templates/busola-serverless-extension.yaml delete mode 100644 config/serverless/templates/cluster-role-binding.yaml delete mode 100644 config/serverless/templates/cluster-role.yaml delete mode 100644 config/serverless/templates/configmap.yaml delete mode 100644 config/serverless/templates/crds.yaml delete mode 100644 config/serverless/templates/deployment.yaml delete mode 100644 config/serverless/templates/leader-election-role-binding.yaml delete mode 100644 config/serverless/templates/leader-election-role.yaml delete mode 100644 config/serverless/templates/runtimes.yaml delete mode 100644 config/serverless/templates/service-accounts.yaml delete mode 100644 config/serverless/templates/service.yaml diff --git a/config/serverless/Chart.yaml b/config/serverless/Chart.yaml index 2db2279a3..c36c1ad07 100644 --- a/config/serverless/Chart.yaml +++ b/config/serverless/Chart.yaml @@ -6,6 +6,4 @@ home: https://kyma-project.io icon: https://github.com/kyma-project/kyma/blob/main/logo.png?raw=true dependencies: - name: docker-registry - condition: dockerRegistry.enableInternal - - name: webhook - condition: webhook.enabled \ No newline at end of file + condition: dockerRegistry.enableInternal \ No newline at end of file diff --git a/config/serverless/charts/webhook/Chart.yaml b/config/serverless/charts/webhook/Chart.yaml deleted file mode 100644 index cf1fcf708..000000000 --- a/config/serverless/charts/webhook/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: 0.1.0 -description: Helm chart for installing the Webhook for the Function Controller -name: webhook -version: 0.1.0 diff --git a/config/serverless/charts/webhook/README.md b/config/serverless/charts/webhook/README.md deleted file mode 100644 index 3d30a3f4b..000000000 --- a/config/serverless/charts/webhook/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Webhook - -## Overview - -This project contains the chart for the Webhook. - -## Details - -For more information, read the Webhooks [README](../../../../components/serverless/README.md) file. diff --git a/config/serverless/charts/webhook/templates/_helpers.tpl b/config/serverless/charts/webhook/templates/_helpers.tpl deleted file mode 100644 index 3de4eb031..000000000 --- a/config/serverless/charts/webhook/templates/_helpers.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "webhook.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "webhook.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Renders a value that contains template. -Usage: -{{- include "tplValue" ( dict "value" .Values.path.to.the.Value "context" $ ) }} -*/}} -{{- define "tplValue" -}} - {{- if typeIs "string" .value }} - {{- tpl .value .context }} - {{- else }} - {{- tpl (.value | toYaml) .context }} - {{- end }} -{{- end -}} diff --git a/config/serverless/charts/webhook/templates/cluster-role-binding.yaml b/config/serverless/charts/webhook/templates/cluster-role-binding.yaml deleted file mode 100644 index c2bf63dfe..000000000 --- a/config/serverless/charts/webhook/templates/cluster-role-binding.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ template "webhook.fullname" . }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -subjects: - - kind: ServiceAccount - name: {{ template "webhook.fullname" . }} - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: {{ template "webhook.fullname" . }} - apiGroup: rbac.authorization.k8s.io \ No newline at end of file diff --git a/config/serverless/charts/webhook/templates/cluster-role.yaml b/config/serverless/charts/webhook/templates/cluster-role.yaml deleted file mode 100644 index b08850080..000000000 --- a/config/serverless/charts/webhook/templates/cluster-role.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ template "webhook.fullname" . }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -rules: - - apiGroups: - - "" - resources: - - configmaps - - secrets - - namespaces - verbs: - - get - - list - - watch - - update - - apiGroups: - - admissionregistration.k8s.io - resources: - - mutatingwebhookconfigurations - - validatingwebhookconfigurations - verbs: - - create - - delete - - get - - update - - list - - watch - - delete - - apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - create - - update - - apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - - get - - update diff --git a/config/serverless/charts/webhook/templates/config-observability.yaml b/config/serverless/charts/webhook/templates/config-observability.yaml deleted file mode 100644 index b6038b184..000000000 --- a/config/serverless/charts/webhook/templates/config-observability.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "webhook.fullname" . }}-config-observability - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -data: - content: "" diff --git a/config/serverless/charts/webhook/templates/configmap.yaml b/config/serverless/charts/webhook/templates/configmap.yaml deleted file mode 100644 index fb5cf4820..000000000 --- a/config/serverless/charts/webhook/templates/configmap.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "webhook.fullname" . }}-envs - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -data: - WEBHOOK_SYSTEM_NAMESPACE: {{ .Release.Namespace }} - WEBHOOK_LOG_CONFIG_PATH: {{ include "tplValue" ( dict "value" .Values.container.envs.logConfigPath.value "context" . ) | quote }} - WEBHOOK_CONFIG_PATH: {{ include "tplValue" ( dict "value" .Values.container.envs.configPath.value "context" . ) | quote }} - WEBHOOK_SERVICE_NAME: {{ include "tplValue" ( dict "value" .Values.container.envs.webhookServiceName.value "context" . ) | quote }} - WEBHOOK_SECRET_NAME: {{ include "tplValue" ( dict "value" .Values.container.envs.webhookSecretName.value "context" . ) | quote }} - WEBHOOK_PORT: {{ include "tplValue" ( dict "value" .Values.container.envs.webhookPort.value "context" . ) | quote }} - {{ .Values.global.configuration.filename }}: {{ include "tplValue" ( dict "value" .Values.values "context" . ) | quote }} diff --git a/config/serverless/charts/webhook/templates/deployment.yaml b/config/serverless/charts/webhook/templates/deployment.yaml deleted file mode 100644 index 3c66abd38..000000000 --- a/config/serverless/charts/webhook/templates/deployment.yaml +++ /dev/null @@ -1,117 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "webhook.fullname" . }}-svc - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} - {{- if .Values.deployment.labels }} - {{ include "tplValue" ( dict "value" .Values.deployment.labels "context" . ) | nindent 4 }} - {{- end }} - {{- if .Values.deployment.annotations }} - annotations: - {{ include "tplValue" ( dict "value" .Values.deployment.annotations "context" . ) | nindent 4 }} - {{- end }} -spec: - selector: - matchLabels: - app: {{ template "webhook.fullname" . }} - app.kubernetes.io/name: {{ template "webhook.fullname" . }} - app.kubernetes.io/instance: "{{ .Release.Name }}" - role: webhook - replicas: {{ .Values.deployment.replicas }} - {{- if .Values.deployment.extraProperties }} - {{ include "tplValue" ( dict "value" .Values.deployment.extraProperties "context" . ) | nindent 2 }} - {{- end }} - template: - metadata: - {{- if .Values.pod.annotations }} - annotations: - {{ include "tplValue" ( dict "value" .Values.pod.annotations "context" . ) | nindent 8 }} - {{- end }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 8 }} - spec: - serviceAccountName: {{ template "webhook.fullname" . }} - volumes: - - name: log-configuration - configMap: - name: "{{ .Values.global.configuration.configmapName }}" - items: - - key: {{ .Values.global.configuration.logFilename }} - path: {{ .Values.global.configuration.filename }} - - name: configuration - configMap: - name: {{ template "webhook.fullname" . }}-envs - items: - - key: {{ .Values.global.configuration.filename }} - path: {{ .Values.global.configuration.filename }} - - name: serverless-webhook - secret: - secretName: {{ .Values.container.envs.webhookSecretName.value }} - {{- if .Values.pod.extraProperties }} - {{ include "tplValue" ( dict "value" .Values.pod.extraProperties "context" . ) | nindent 6 }} - {{- end }} - initContainers: - - name: remove-old-mutating-secret - image: rancher/kubectl:v1.26.11 - command: - - "kubectl" - args: - - "delete" - - "mutatingwebhookconfigurations" - - "mutating.secrets" - - "--ignore-not-found=true" - {{- if .Values.initContainer.securityContext }} - securityContext: - {{- include "tplValue" ( dict "value" .Values.initContainer.securityContext "context" . ) | nindent 12 }} - {{- end }} - containers: - - name: webhook - volumeMounts: - - name: log-configuration - mountPath: {{ .Values.global.configuration.targetDir }}/{{ .Values.global.configuration.logFilename }} - subPath: config.yaml - - name: configuration - mountPath: {{ .Values.global.configuration.targetDir }}/{{ .Values.global.configuration.filename }} - subPath: config.yaml - - name: serverless-webhook - mountPath: /tmp/k8s-webhook-server/serving-certs - image: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_webhook) }}" - imagePullPolicy: "{{ .Values.image.pullPolicy }}" - livenessProbe: - httpGet: - port: {{ .Values.service.ports.httpMetrics.targetPort }} - path: "/metrics" - initialDelaySeconds: {{ .Values.deployment.livenessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.deployment.livenessProbe.timeoutSeconds }} - periodSeconds: {{.Values.deployment.livenessProbe.periodSeconds }} - readinessProbe: - httpGet: - port: {{ .Values.service.ports.httpMetrics.targetPort }} - path: "/metrics" - initialDelaySeconds: {{ .Values.deployment.readinessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.deployment.readinessProbe.timeoutSeconds }} - periodSeconds: {{.Values.deployment.readinessProbe.periodSeconds }} - resources: - requests: - cpu: {{ .Values.deployment.resources.requests.cpu }} - memory: {{ .Values.deployment.resources.requests.memory }} - limits: - cpu: {{ .Values.deployment.resources.limits.cpu }} - memory: {{ .Values.deployment.resources.limits.memory }} - {{- if .Values.container.securityContext }} - securityContext: - {{- include "tplValue" ( dict "value" .Values.container.securityContext "context" . ) | nindent 12 }} - {{- end }} - ports: - - name: {{ .Values.service.ports.httpMetrics.name }} - containerPort: {{ .Values.service.ports.httpMetrics.targetPort }} - - name: {{ .Values.service.ports.httpProfiling.name }} - containerPort: {{ .Values.service.ports.httpProfiling.targetPort }} - - name: {{ .Values.service.ports.httpsWebhook.name }} - containerPort: {{ .Values.service.ports.httpsWebhook.targetPort }} - envFrom: - - configMapRef: - name: {{ template "webhook.fullname" . }}-envs - priorityClassName: {{ .Values.global.serverlessPriorityClassName }} diff --git a/config/serverless/charts/webhook/templates/secret.yaml b/config/serverless/charts/webhook/templates/secret.yaml deleted file mode 100644 index 776a655ef..000000000 --- a/config/serverless/charts/webhook/templates/secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# this stub is created to allow the reconciler to track this/these resource(s). It should not be deleted. The actual content of this resource and managed and reconciled by the function-webhook. -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "webhook.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} \ No newline at end of file diff --git a/config/serverless/charts/webhook/templates/service-account.yaml b/config/serverless/charts/webhook/templates/service-account.yaml deleted file mode 100644 index 6973743e8..000000000 --- a/config/serverless/charts/webhook/templates/service-account.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "webhook.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} diff --git a/config/serverless/charts/webhook/templates/service.yaml b/config/serverless/charts/webhook/templates/service.yaml deleted file mode 100644 index 51aa1ed64..000000000 --- a/config/serverless/charts/webhook/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "webhook.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -spec: - ports: - - name: {{ .Values.service.ports.httpMetrics.name }} - port: {{ .Values.service.ports.httpMetrics.port }} - targetPort: {{ .Values.service.ports.httpMetrics.targetPort }} - - name: {{ .Values.service.ports.httpProfiling.name }} - port: {{ .Values.service.ports.httpProfiling.port }} - targetPort: {{ .Values.service.ports.httpProfiling.targetPort }} - - name: {{ .Values.service.ports.httpsWebhook.name }} - port: {{ .Values.service.ports.httpsWebhook.port }} - targetPort: {{ .Values.service.ports.httpsWebhook.targetPort }} - selector: - app: {{ template "webhook.fullname" . }} - app.kubernetes.io/name: {{ template "webhook.fullname" . }} - app.kubernetes.io/instance: "{{ .Release.Name }}" - role: webhook diff --git a/config/serverless/charts/webhook/templates/webhooks.yaml b/config/serverless/charts/webhook/templates/webhooks.yaml deleted file mode 100644 index 0f3e0dd53..000000000 --- a/config/serverless/charts/webhook/templates/webhooks.yaml +++ /dev/null @@ -1,76 +0,0 @@ -# this stub is created to allow the reconciler to track this/these resource(s). It should not be deleted. The actual content of this resource and managed and reconciled by the function-webhook. -apiVersion: admissionregistration.k8s.io/v1 -kind: ValidatingWebhookConfiguration -metadata: - name: validation.webhook.serverless.kyma-project.io - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -webhooks: - - name: validation.webhook.serverless.kyma-project.io - clientConfig: - service: - name: {{ template "webhook.fullname" . }} - namespace: {{ .Release.Namespace }} - path: "/validation/function" - port: {{ .Values.service.ports.httpsWebhook.port}} - failurePolicy: Fail - sideEffects: None - matchPolicy: Exact - timeoutSeconds: 10 - admissionReviewVersions: [ "v1beta1", "v1" ] - namespaceSelector: - matchExpressions: - - key: gardener.cloud/purpose - operator: NotIn - values: - - kube-system - rules: - - apiGroups: - - serverless.kyma-project.io - apiVersions: - - v1alpha2 - operations: - - CREATE - - UPDATE - resources: - - functions - - functions/status - scope: '*' ---- -apiVersion: admissionregistration.k8s.io/v1 -kind: MutatingWebhookConfiguration -metadata: - name: defaulting.webhook.serverless.kyma-project.io - labels: - {{- include "tplValue" ( dict "value" .Values.commonLabels "context" . ) | nindent 4 }} -webhooks: - - name: defaulting.webhook.serverless.kyma-project.io - clientConfig: - service: - name: {{ template "webhook.fullname" . }} - namespace: {{ .Release.Namespace }} - path: "/defaulting/functions" - port: {{ .Values.service.ports.httpsWebhook.port}} - failurePolicy: Fail - sideEffects: None - matchPolicy: Exact - timeoutSeconds: 10 - admissionReviewVersions: [ "v1beta1", "v1" ] - namespaceSelector: - matchExpressions: - - key: gardener.cloud/purpose - operator: NotIn - values: - - kube-system - rules: - - apiGroups: - - serverless.kyma-project.io - apiVersions: - - v1alpha2 - operations: - - CREATE - - UPDATE - resources: - - functions - - functions/status - scope: '*' diff --git a/config/serverless/charts/webhook/values.yaml b/config/serverless/charts/webhook/values.yaml deleted file mode 100644 index e36380f65..000000000 --- a/config/serverless/charts/webhook/values.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Default values for webhook. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -nameOverride: -fullnameOverride: -image: - pullPolicy: IfNotPresent - -commonLabels: - app: '{{ template "webhook.fullname" . }}' - app.kubernetes.io/name: '{{ template "webhook.fullname" . }}' - app.kubernetes.io/instance: "{{ .Release.Name }}" - role: webhook - -deployment: - replicas: 1 - labels: {} - annotations: {} - extraProperties: {} - resources: - requests: - cpu: 10m - memory: 50Mi - limits: - cpu: 300m - memory: 300Mi - livenessProbe: - initialDelaySeconds: 50 - timeoutSeconds: 1 - periodSeconds: 10 - readinessProbe: - initialDelaySeconds: 10 - timeoutSeconds: 1 - periodSeconds: 2 - -pod: - annotations: - sidecar.istio.io/inject: "false" - extraProperties: - # the following guidelines should be followed for this https://github.com/kyma-project/community/tree/main/concepts/psp-replacement - securityContext: - runAsNonRoot: true - runAsUser: 1000 # Optional. Use this setting only when necessary, otherwise delete it. Never set to 0 because this is the ID of root. - runAsGroup: 1000 # Optional. Use this setting only when necessary, otherwise delete it. Never set to 0 because this is the ID of root. - seccompProfile: # Optional. This option can also be set on container level but it is recommended to set it on Pod level and leave it undefined on container level. - type: RuntimeDefault - hostNetwork: false # Optional. The default is false if the entry is not there. - hostPID: false # Optional. The default is false if the entry is not there. - hostIPC: false # Optional. The default is false if the entry is not there. - -service: - ports: - httpMetrics: - name: "http-metrics" - port: 9090 - targetPort: 9090 - httpProfiling: - name: "http-profiling" - port: 8008 - targetPort: 8008 - httpsWebhook: - name: "https-webhook" - port: 443 - targetPort: 8443 - -container: - # the following guidelines should be followed for this https://github.com/kyma-project/community/tree/main/concepts/psp-replacement - securityContext: - allowPrivilegeEscalation: false - privileged: false - capabilities: - drop: ["ALL"] - procMount: default # Optional. The default is false if the entry is not there. - readOnlyRootFilesystem: true # Mandatory - envs: - logConfigPath: - value: "{{ .Values.global.configuration.targetDir }}/{{ .Values.global.configuration.logFilename }}" - configPath: - value: "{{ .Values.global.configuration.targetDir }}/{{ .Values.global.configuration.filename }}" - webhookServiceName: - value: serverless-webhook - webhookSecretName: - value: serverless-webhook - webhookPort: - value: "{{ .Values.service.ports.httpsWebhook.targetPort }}" - -initContainer: - # the following guidelines should be followed for this https://github.com/kyma-project/community/tree/main/concepts/psp-replacement - securityContext: - allowPrivilegeEscalation: false - privileged: false - capabilities: - drop: ["ALL"] - procMount: default # Optional. The default is false if the entry is not there. - readOnlyRootFilesystem: true # Mandatory - -values: - reservedEnvs: - - "FUNC_RUNTIME" - - "FUNC_HANDLER" - - "FUNC_PORT" - - "MOD_NAME" - - "NODE_PATH" - - "PYTHONPATH" # https://github.com/kubeless/runtimes/blob/master/stable/nodejs/kubeless.js;https://github.com/kubeless/runtimes/tree/master/stable/python - function: - resources: - minRequestCpu: "10m" - minRequestMemory: "16Mi" - - buildJob: - resources: - minRequestCpu: "200m" - minRequestMemory: "200Mi" - diff --git a/config/serverless/templates/busola-serverless-extension.yaml b/config/serverless/templates/busola-serverless-extension.yaml deleted file mode 100644 index ba12508e1..000000000 --- a/config/serverless/templates/busola-serverless-extension.yaml +++ /dev/null @@ -1,587 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: functions - namespace: kube-public - labels: - app.kubernetes.io/name: functions - busola.io/extension: resource - busola.io/extension-version: '0.5' -data: - details: |- - header: - - name: Replicas - widget: Badge - source: "$string($count($filter($replicas().items, function($r){ - $r.status.phase = 'Running'}))) & '/' & $string($count($replicas().items))" - highlights: - negative: "$count($replicas().items) != $count($filter($replicas().items, function($r){ - $r.status.phase = 'Running'}))" - warning: "$count($replicas().items) = 0 and $count($filter($replicas().items, function($r){ - $r.status.phase = 'Running'}) = 0)" # this condition needs to be above 'positive' - positive: "$count($replicas().items) = $count($filter($replicas().items, function($r){ - $r.status.phase = 'Running'}))" - - name: header.status - widget: Badge - highlights: - positive: - - RUNNING - negative: - - FAILED - - ERROR - informative: - - INITIALIZING - critical: - - DEPLOYING - - BUILDING - - PENDING - source: >- - ($.status = undefined or $.status.conditions = undefined or - $count($.status.conditions) = 0) ? 'INITIALIZING' : - $count($filter($.status.conditions, function($v) { $v.status = 'False' })) - != 0 ? $count($filter($.status.conditions, function($v) { $v.type = - 'Running' and $v.status = 'True' })) != 0 ? 'ERROR' : 'FAILED' : - $count($filter($.status.conditions, function($v) { $v.type = - 'ConfigurationReady' and $v.status = 'True' })) != 0 ? - $count($filter($.status.conditions, function($v) { $v.type = 'BuildReady' - and $v.status = 'True' })) != 0 ? $count($filter($.status.conditions, - function($v) { $v.type = 'Running' and $v.status = 'True' })) != 0 ? - 'RUNNING' : $count($filter($.status.conditions, function($v) { $v.type = - 'Running' and $v.status = 'Unknown' and $v.reason = - 'MinReplicasNotAvailable' })) != 0 ? 'PENDING' : 'DEPLOYING' : 'BUILDING' - : 'INITIALIZING' - description: >- - ($.status = undefined or $.status.conditions = undefined or - $count($.status.conditions) = 0) ? null : - $count($filter($.status.conditions, function($v) { $v.status = 'False' })) - != 0 ? $count($filter($.status.conditions, function($v) { $v.type = - 'Running' and $v.status = 'True' })) != 0 ? 'New revision error: ' & - $filter($.status.conditions, function($v) { $v.status = 'False' - })[0].message : 'Error: ' & $filter($.status.conditions, function($v) { - $v.status = 'False' })[0].message : null - - name: header.sourceType - source: 'spec.source.gitRepository ? "Git Repository" : "Inline Editor"' - - name: header.runtime - source: >- - spec.runtime = 'python39' ? 'Python 3.9 - deprecated' : (spec.runtime = 'nodejs18' ? 'Node.js 18 - deprecated' : (spec.runtime = 'python312' ? 'Python 3.12' : (spec.runtime = 'nodejs20' ? 'Node.js 20' : spec.runtime))) - body: - - widget: Tabs - children: - - name: tabs.code - children: - - source: spec.source.inline.source - widget: CodeViewer - name: code.source - language: '$contains($root.spec.runtime, "python") ? "python": "javascript"' - visibility: $exists($value) - - source: spec.source.inline.dependencies - widget: CodeViewer - name: code.dependencies - language: '"json"' - visibility: $exists($value) - - source: spec.source.gitRepository - widget: Panel - name: code.gitRepositoryConfig - visibility: $exists($value) - children: - - name: code.gitRepository.url - source: url - - name: code.gitRepository.reference - source: reference - - name: code.gitRepository.baseDir - source: baseDir - - name: code.gitRepository.auth - visibility: $exists($value) - widget: Panel - source: auth - children: - - name: code.gitRepository.auth.secretName - widget: ResourceLink - source: secretName - resource: - kind: "'Secret'" - name: secretName - namespace: $root.metadata.namespace - - name: code.gitRepository.auth.type - source: type - - source: spec.env - widget: Table - name: code.env - children: - - source: $item.name - name: code.env.name - - source: $item.value - name: code.env.value - - name: code.env.valueFrom - widget: ResourceLink - source: >- - $exists($item.valueFrom.configMapKeyRef)? - $item.valueFrom.configMapKeyRef.name : - $item.valueFrom.secretKeyRef.name - resource: - name: >- - $exists($item.valueFrom.configMapKeyRef) ? - $item.valueFrom.configMapKeyRef.name : - $item.valueFrom.secretKeyRef.name - namespace: $root.metadata.namespace - kind: >- - $exists($item.valueFrom.configMapKeyRef) ? 'ConfigMap' : - 'Secret' - - name: code.env.source - widget: Badge - source: >- - $exists($item.value) ? 'CUSTOM' : - $exists($item.valueFrom.configMapKeyRef) ? 'CONFIG MAP' : 'SECRET' - - name: code.env.key - source: >- - $exists($item.valueFrom.configMapKeyRef) ? - $item.valueFrom.configMapKeyRef.key : - $exists($item.valueFrom.secretKeyRef) ? - $item.valueFrom.secretKeyRef.key : 'N/A' - - widget: ResourceList - source: $replicas() - name: code.replicas - disableCreate: true - - widget: EventList - filter: $matchEvents($item, $root.kind, $root.metadata.name) - name: events - defaultType: information - hideInvolvedObjects: true - - name: tabs.configuration - children: - - widget: ResourceList - source: $apiRules() - name: configuration.apiRules - disableCreate: true - - widget: ResourceList - source: $subscriptions() - name: configuration.subscriptions - disableCreate: true - - name: tabs.resources - children: - - widget: Panel - description: resources.description - name: resources.scalingOptions - visibility: $exists(spec.scaleConfig.minReplicas) or $exists(spec.scaleConfig.maxReplicas) - children: - - name: resources.minReplicas - source: spec.scaleConfig.minReplicas - - name: resources.maxReplicas - source: spec.scaleConfig.maxReplicas - - widget: Columns - inline: false - children: - - name: resources.runtimeProfile - widget: Panel - children: - - name: resources.requests.memory - source: >- - spec.resourceConfiguration.function.resources.requests.memory - - name: resources.requests.cpu - source: spec.resourceConfiguration.function.resources.requests.cpu - - name: resources.limits.memory - source: >- - spec.resourceConfiguration.function.resources.limits.memory - - name: resources.limits.cpu - source: spec.resourceConfiguration.function.resources.limits.cpu - - name: resources.buildProfile - widget: Panel - children: - - name: resources.requests.memory - source: spec.resourceConfiguration.build.resources.requests.memory - - name: resources.requests.cpu - source: spec.resourceConfiguration.build.resources.requests.cpu - - name: resources.limits.memory - source: spec.resourceConfiguration.build.resources.limits.memory - - name: resources.limits.cpu - source: spec.resourceConfiguration.build.resources.limits.cpu - form: |- - - var: sourceType - widget: Text - enum: - - Inline - - Git Repository - dynamicValue: '$exists(spec.source.gitRepository) ? "Git Repository" : "Inline"' - name: header.sourceType - trigger: [sourceType] - - simple: true - type: string - name: Language - var: language - required: true - enum: [JavaScript, Python] - trigger: [language] - dynamicValue: | - spec.runtime in ['nodejs18', 'nodejs20'] ? 'JavaScript' : - spec.runtime in ['python39', 'python312'] ? 'Python' : - '' - - simple: true - path: spec.runtime - placeholder: placeholders.spec.runtime - enum: | - $language = 'JavaScript' ? ['nodejs18', 'nodejs20'] : - $language = 'Python' ? ['python39', 'python312'] : - [] - subscribe: - language: | - $language = 'JavaScript' ? ($exists($root.spec.runtime) and $root.spec.runtime != 'python39') ? $root.spec.runtime : 'nodejs20' : - $language = 'Python' ? 'python39' : - '' - - path: spec.resourceConfiguration.function.profile - simple: true - enum: ['XS', 'S', 'M', 'L', 'XL'] - - path: spec.source.inline - visibility: $sourceType = 'Inline' - simple: true - children: - - path: source - widget: CodeEditor - simple: true - language: '$contains($root.spec.runtime, "node") ? "javascript" : "python"' - defaultExpanded: true - subscribe: - sourceType: |- - $sourceType = 'Inline' ? $language = 'JavaScript' ? $exists($root.metadata.creationTimestamp) ? $root.spec.source.inline.source : "module.exports = { - main: async function (event, context) { - var queryParams = event['extensions']['request']['query']; - - //read query param, for example `?greeting=Hi` - var greetingMsg = queryParams['greeting']; - if(!greetingMsg) { - greetingMsg = 'Hello world'; - } - const message = greetingMsg - + ` from the Kyma Function ${context['function-name']}` - + ` running on ${context.runtime}!`; - console.log(message); - return message; - } - }" : - $language = 'Python' ? $exists($root.metadata.creationTimestamp) ? $root.spec.source.inline.source : "def main(event, context): - request = event['extensions']['request'] - greetingMsg = request.query.get('greeting') - if not greetingMsg: - greetingMsg = 'Hello world' - message = greetingMsg + ' from the Kyma Function '+context['function-name']+' running on '+context['runtime']+ '!'; - print(message) - return message" : - '' : '' - language: |- - $language = 'JavaScript' ? $exists($root.metadata.creationTimestamp) ? $root.spec.source.inline.source : "module.exports = { - main: async function (event, context) { - var queryParams = event['extensions']['request']['query']; - - //read query param, for example `?greeting=Hi` - var greetingMsg = queryParams['greeting']; - if(!greetingMsg) { - greetingMsg = 'Hello world'; - } - const message = greetingMsg - + ` from the Kyma Function ${context['function-name']}` - + ` running on ${context.runtime}!`; - console.log(message); - return message; - } - }" : - $language = 'Python' ? $exists($root.metadata.creationTimestamp) ? $root.spec.source.inline.source : "def main(event, context): - request = event['extensions']['request'] - greetingMsg = request.query.get('greeting') - if not greetingMsg: - greetingMsg = 'Hello world' - message = greetingMsg + ' from the Kyma Function '+context['function-name']+' running on '+context['runtime']+ '!'; - print(message) - return message" : - '' - - path: dependencies - widget: CodeEditor - language: '$contains($root.spec.runtime, "node") ? "json" : "plaintext"' - - path: spec.source.gitRepository - widget: FormGroup - visibility: $sourceType = 'Git Repository' - defaultExpanded: true - children: - - path: url - - path: baseDir - required: true - - path: reference - required: true - - var: useAuthorization - type: boolean - name: code.gitRepository.auth - dynamicValue: $exists($.spec.source.gitRepository.auth) - - widget: FormGroup - path: auth - visibility: $useAuthorization - children: - - path: secretName - widget: Resource - resource: - kind: Secret - version: v1 - scope: namespace - - path: type - - path: spec.scaleConfig - widget: FormGroup - columns: '2' - children: - - advanced: true - path: minReplicas - required: false - min: '1' - - advanced: true - path: maxReplicas - required: false - min: '1' - - path: spec.resourceConfiguration.function - widget: FormGroup - children: - - path: resources.limits - widget: KeyValuePair - - visibility: $boolean($root.spec.resourceConfiguration.function.profile) - severity: warning - alert: "'alert.resources.limits'" - widget: Alert - - path: resources.requests - widget: KeyValuePair - - visibility: $boolean($root.spec.resourceConfiguration.function.profile) - severity: warning - alert: "'alert.resources.requests'" - widget: Alert - - path: spec.resourceConfiguration.build - widget: FormGroup - children: - - path: resources.limits - widget: KeyValuePair - - path: resources.requests - widget: KeyValuePair - - path: spec.env - widget: GenericList - children: - - path: '[]' - children: - - var: envType - widget: Text - name: spec.env.source - enum: - - Custom - - From Config Map - - From Secret - dynamicValue: >- - $exists($item.valueFrom.secretKeyRef) ? 'From Secret' : - ($exists($item.valueFrom.configMapKeyRef) ? 'From Config Map' : - 'Custom') - - path: name - - path: value - visibility: $envType = 'Custom' - - path: valueFrom.secretKeyRef.name - widget: Resource - resource: - kind: Secret - version: v1 - scope: namespace - provideVar: secret - visibility: $envType = 'From Secret' - - path: valueFrom.secretKeyRef.key - widget: Text - enum: $keys($secret.data) - visibility: $envType = 'From Secret' - - path: valueFrom.configMapKeyRef.name - widget: Resource - resource: - kind: ConfigMap - version: v1 - scope: namespace - provideVar: configMap - visibility: $envType = 'From Config Map' - - path: valueFrom.configMapKeyRef.key - widget: Text - enum: $keys($configMap.data) - visibility: $envType = 'From Config Map' - - path: spec - widget: FormGroup - children: - - path: labels - widget: KeyValuePair - defaultExpanded: false - - path: annotations - widget: KeyValuePair - defaultExpanded: false - general: |- - resource: - kind: Function - group: serverless.kyma-project.io - version: v1alpha2 - name: Functions - category: Workloads - urlPath: functions - scope: namespace - description: >- - {{"{{[Function](https://kyma-project.io/docs/kyma/latest/05-technical-reference/00-custom-resources/svls-01-function/#documentation-content/)}}"}} - is a simple code snippet that you can run without provisioning or managing - servers. - list: |- - - name: header.runtime - source: >- - spec.runtime = 'python39' ? 'Python 3.9 - deprecated' : (spec.runtime = 'nodejs18' ? 'Node.js 18 - deprecated' : (spec.runtime = 'python312' ? 'Python 3.12' : (spec.runtime = 'nodejs20' ? 'Node.js 20' : spec.runtime))) - - name: header.sourceType - source: 'spec.source.gitRepository ? "Git Repository" : "Inline Editor"' - - name: header.status - widget: Badge - highlights: - positive: - - RUNNING - negative: - - FAILED - - ERROR - informative: - - INITIALIZING - critical: - - DEPLOYING - - BUILDING - - PENDING - source: >- - ($.status = undefined or $.status.conditions = undefined or - $count($.status.conditions) = 0) ? 'INITIALIZING' : - $count($filter($.status.conditions, function($v) { $v.status = 'False' })) - != 0 ? $count($filter($.status.conditions, function($v) { $v.type = - 'Running' and $v.status = 'True' })) != 0 ? 'ERROR' : 'FAILED' : - $count($filter($.status.conditions, function($v) { $v.type = - 'ConfigurationReady' and $v.status = 'True' })) != 0 ? - $count($filter($.status.conditions, function($v) { $v.type = 'BuildReady' - and $v.status = 'True' })) != 0 ? $count($filter($.status.conditions, - function($v) { $v.type = 'Running' and $v.status = 'True' })) != 0 ? - 'RUNNING' : $count($filter($.status.conditions, function($v) { $v.type = - 'Running' and $v.status = 'Unknown' and $v.reason = - 'MinReplicasNotAvailable' })) != 0 ? 'PENDING' : 'DEPLOYING' : 'BUILDING' : - 'INITIALIZING' - description: >- - ($.status = undefined or $.status.conditions = undefined or - $count($.status.conditions) = 0) ? null : - $count($filter($.status.conditions, function($v) { $v.status = 'False' })) - != 0 ? $count($filter($.status.conditions, function($v) { $v.type = - 'Running' and $v.status = 'True' })) != 0 ? 'New revision error: ' & - $filter($.status.conditions, function($v) { $v.status = 'False' - })[0].message : 'Error: ' & $filter($.status.conditions, function($v) { - $v.status = 'False' })[0].message : null - dataSources: |- - replicas: - resource: - kind: Pod - version: v1 - filter: >- - ($item.metadata.labels.'serverless.kyma-project.io/function-name' = - $root.metadata.name) and - ($item.metadata.labels.'serverless.kyma-project.io/resource' = 'deployment') - apiRules: - resource: - kind: APIRule - version: v1beta1 - group: gateway.kyma-project.io - filter: $contains($item.spec.service.name, $root.metadata.name) - subscriptions: - resource: - kind: Subscription - version: v1alpha2 - group: eventing.kyma-project.io - filter: $contains($item.spec.sink, $root.metadata.name) - translations: | - en: - tabs.code: Code - tabs.configuration: Configuration - tabs.resources: Resources - code.gitRepositoryConfig: Repository Configuration - code.replicas: Replicas of the Function - code.source: Source - code.dependencies: Dependencies - code.gitRepository.url: URL - code.gitRepository.reference: Reference - code.gitRepository.baseDir: Base Directory - code.gitRepository.auth: Auth - code.gitRepository.auth.secretName: Secret name - code.gitRepository.auth.type: Type - code.env: Environment Variables - code.env.name: Name - code.env.value: Value - code.env.valueFrom: Value From - code.env.source: Source - code.env.key: Key - events: Events - configuration.apiRules: API Rules - configuration.subscriptions: Subscriptions - header.runtime: Runtime - header.status: Status - header.sourceType: Source Type - resources.scalingOptions: Scaling Options - resources.minReplicas: Minimum Replicas - resources.maxReplicas: Maximum Replicas - resources.description: Minimum and maximum number of running Replicas. - resources.runtimeProfile: Runtime Profile - resources.buildProfile: Build Job Profile - resources.requests.memory: Memory Requests - resources.requests.cpu: CPU Requests - resources.limits.memory: Memory Limits - resources.limits.cpu: CPU Limits - spec.scaleConfig: Scale Config - spec.scaleConfig.maxReplicas: Max Replicas - spec.scaleConfig.minReplicas: Min Replicas - spec.source.inline.dependencies: Dependencies - spec.source.inline.source: Source - spec.env: Environment Variables - Requests: Requests - Limits: Limits - spec.runtime: Runtime - Status: Status - Runtime: Runtime - 'Source Type': Source Type - spec.runtime.nodejs18: Node.js 18 - deprecated - spec.runtime.nodejs20: Node.js 20 - spec.runtime.python39: Python 3.9 - deprecated - spec.runtime.python312: Python 3.12 - spec.resourceConfiguration.build: Build - spec.resourceConfiguration.function: Function - spec.resourceConfiguration.function.profile: Function profile - placeholders.spec.runtime: Choose Function runtime - spec.env.name: Variable Name - spec.env.source: Source - envType: Variable Type - 'Node.js Function': Node.js Function - 'Python Function': Python Function - alert.resources.requests: If you want to provide your own requests configuration, leave the Function profile field empty. - alert.resources.limits: If you want to provide your own limits configuration, leave the Function profile field empty. - spec.labels: Runtime Labels - spec.annotations: Runtime Annotations - presets: |- - - name: Default - default: true - value: - spec: - resourceConfiguration: - function: - profile: XS - - name: Node.js Function - value: - spec: - runtime: nodejs20 - source: - inline: - source: |- - module.exports = { - main: async function (event, context) { - const message = `Hello World` - + ` from the Kyma Function ${context["function-name"]}` - + ` running on ${context.runtime}!`; - console.log(message); - return message; - } - } - - name: Python Function - value: - spec: - runtime: python312 - source: - inline: - source: |- - def main(event, context): - message = "Hello World from the Kyma Function "+context['function-name']+" running on "+context['runtime']+ "!"; - print(message) - return message diff --git a/config/serverless/templates/cluster-role-binding.yaml b/config/serverless/templates/cluster-role-binding.yaml deleted file mode 100644 index 9e4b4809e..000000000 --- a/config/serverless/templates/cluster-role-binding.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ template "fullname" . }} - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "fullname" . }} -subjects: -- kind: ServiceAccount - name: {{ template "fullname" . }}-controller-manager - namespace: {{ .Release.Namespace }} diff --git a/config/serverless/templates/cluster-role.yaml b/config/serverless/templates/cluster-role.yaml deleted file mode 100644 index c06fbf349..000000000 --- a/config/serverless/templates/cluster-role.yaml +++ /dev/null @@ -1,173 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ template "fullname" . }} - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - configmaps - - secrets - - serviceaccounts - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch -- apiGroups: - - "" - resources: - - namespaces - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - secrets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - serviceaccounts - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - services - verbs: - - create - - delete - - get - - list - - update - - watch -- apiGroups: - - apps - resources: - - deployments - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - apps - resources: - - deployments/status - verbs: - - get -- apiGroups: - - autoscaling - resources: - - horizontalpodautoscalers - verbs: - - create - - deletecollection - - get - - list - - update - - watch -- apiGroups: - - batch - resources: - - jobs - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - batch - resources: - - jobs/status - verbs: - - get -- apiGroups: - - serverless.kyma-project.io - resources: - - functions - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - serverless.kyma-project.io - resources: - - functions/status - verbs: - - get - - patch - - update -- apiGroups: - - rbac.authorization.k8s.io - resources: - - roles - - rolebindings - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - policy - resources: - - podsecuritypolicies - verbs: - - use diff --git a/config/serverless/templates/configmap.yaml b/config/serverless/templates/configmap.yaml deleted file mode 100644 index 7cac1b924..000000000 --- a/config/serverless/templates/configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: "{{ .Values.global.configuration.configmapName }}" - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} -data: - {{ .Values.global.configuration.logFilename }}: {{ include "tplValue" ( dict "value" .Values.containers.manager.logConfiguration.data "context" . ) | quote }} diff --git a/config/serverless/templates/crds.yaml b/config/serverless/templates/crds.yaml deleted file mode 100644 index 9f7c29d01..000000000 --- a/config/serverless/templates/crds.yaml +++ /dev/null @@ -1,610 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: functions.serverless.kyma-project.io -spec: - group: serverless.kyma-project.io - names: - kind: Function - listKind: FunctionList - plural: functions - singular: function - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=='ConfigurationReady')].status - name: Configured - type: string - - jsonPath: .status.conditions[?(@.type=='BuildReady')].status - name: Built - type: string - - jsonPath: .status.conditions[?(@.type=='Running')].status - name: Running - type: string - - jsonPath: .spec.runtime - name: Runtime - type: string - - jsonPath: .metadata.generation - name: Version - type: integer - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha2 - schema: - openAPIV3Schema: - description: |- - A simple code snippet that you can run without provisioning or managing servers. - It implements the exact business logic you define. - A Function is based on the Function custom resource (CR) and can be written in either Node.js or Python. - A Function can perform a business logic of its own. You can also bind it to an instance of a service - and configure it to be triggered whenever it receives a particular event type from the service - or a call is made to the service's API. - Functions are executed only if they are triggered by an event or an API call. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: Defines the desired state of the Function - properties: - annotations: - additionalProperties: - type: string - description: Defines annotations used in Deployment's PodTemplate - and applied on the Function's runtime Pod. - type: object - x-kubernetes-validations: - - message: Annotations has key starting with serverless.kyma-project.io/ - which is not allowed - rule: '!(self.exists(e, e.startsWith(''serverless.kyma-project.io/'')))' - env: - description: |- - Specifies an array of key-value pairs to be used as environment variables for the Function. - You can define values as static strings or reference values from ConfigMaps or Secrets. - For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). - items: - description: EnvVar represents an environment variable present in - a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: |- - Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in the container and - any service environment variables. If a variable cannot be resolved, - the reference in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. - "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether the variable - exists or not. - Defaults to "". - type: string - valueFrom: - description: Source for the environment variable's value. Cannot - be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? - type: string - optional: - description: Specify whether the ConfigMap or its key - must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: |- - Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, - spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - properties: - apiVersion: - description: Version of the schema the FieldPath is - written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified - API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: |- - Selects a resource of the container: only resources limits and requests - (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed - resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must - be a valid secret key. - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? - type: string - optional: - description: Specify whether the Secret or its key must - be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - x-kubernetes-validations: - - message: 'Following envs are reserved and cannot be used: [''FUNC_RUNTIME'',''FUNC_HANDLER'',''FUNC_PORT'',''MOD_NAME'',''NODE_PATH'',''PYTHONPATH'']' - rule: (self.all(e, !(e.name in ['FUNC_RUNTIME','FUNC_HANDLER','FUNC_PORT','MOD_NAME','NODE_PATH','PYTHONPATH']))) - labels: - additionalProperties: - type: string - description: Defines labels used in Deployment's PodTemplate and applied - on the Function's runtime Pod. - type: object - x-kubernetes-validations: - - message: Labels has key starting with serverless.kyma-project.io/ - which is not allowed - rule: '!(self.exists(e, e.startsWith(''serverless.kyma-project.io/'')))' - - message: Label value cannot be longer than 63 - rule: self.all(e, size(e)<64) - replicas: - default: 1 - description: |- - Defines the exact number of Function's Pods to run at a time. - If **ScaleConfig** is configured, or if the Function is targeted by an external scaler, - then the **Replicas** field is used by the relevant HorizontalPodAutoscaler to control the number of active replicas. - format: int32 - minimum: 0 - type: integer - resourceConfiguration: - description: Specifies resources requested by the Function and the - build Job. - properties: - build: - description: Specifies resources requested by the build Job's - Pod. - properties: - profile: - description: |- - Defines the name of the predefined set of values of the resource. - Can't be used together with **Resources**. - type: string - resources: - description: |- - Defines the amount of resources available for the Pod. - Can't be used together with **Profile**. - For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). - properties: - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. Requests cannot exceed Limits. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - type: object - type: object - x-kubernetes-validations: - - message: Use profile or resources - rule: has(self.profile) && !has(self.resources) || !has(self.profile) - && has(self.resources) - - message: 'Invalid profile, please use one of: [''local-dev'',''slow'',''normal'',''fast'']' - rule: (!has(self.profile) || self.profile in ['local-dev','slow','normal','fast']) - function: - description: Specifies resources requested by the Function's Pod. - properties: - profile: - description: |- - Defines the name of the predefined set of values of the resource. - Can't be used together with **Resources**. - type: string - resources: - description: |- - Defines the amount of resources available for the Pod. - Can't be used together with **Profile**. - For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). - properties: - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. Requests cannot exceed Limits. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - type: object - type: object - x-kubernetes-validations: - - message: Use profile or resources - rule: has(self.profile) && !has(self.resources) || !has(self.profile) - && has(self.resources) - - message: 'Invalid profile, please use one of: [''XS'',''S'',''M'',''L'',''XL'']' - rule: (!has(self.profile) || self.profile in ['XS','S','M','L','XL']) - type: object - runtime: - description: Specifies the runtime of the Function. The available - values are `nodejs18` - deprecated, `nodejs20`, `python39` - deprecated, - and `python312`. - enum: - - nodejs18 - - nodejs20 - - python39 - - python312 - type: string - runtimeImageOverride: - description: Specifies the runtime image used instead of the default - one. - type: string - scaleConfig: - description: |- - Defines the minimum and maximum number of Function's Pods to run at a time. - When it is configured, a HorizontalPodAutoscaler will be deployed and will control the **Replicas** field - to scale the Function based on the CPU utilisation. - properties: - maxReplicas: - description: Defines the maximum number of Function's Pods to - run at a time. - format: int32 - minimum: 1 - type: integer - minReplicas: - description: Defines the minimum number of Function's Pods to - run at a time. - format: int32 - minimum: 1 - type: integer - required: - - maxReplicas - - minReplicas - type: object - x-kubernetes-validations: - - message: minReplicas should be less than or equal maxReplicas - rule: self.minReplicas <= self.maxReplicas - secretMounts: - description: Specifies Secrets to mount into the Function's container - filesystem. - items: - properties: - mountPath: - description: Specifies the path within the container where the - Secret should be mounted. - minLength: 1 - type: string - secretName: - description: Specifies the name of the Secret in the Function's - Namespace. - maxLength: 253 - minLength: 1 - type: string - required: - - mountPath - - secretName - type: object - type: array - source: - description: Contains the Function's source code configuration. - properties: - gitRepository: - description: Defines the Function as git-sourced. Can't be used - together with **Inline**. - properties: - auth: - description: Specifies the authentication method. Required - for SSH. - properties: - secretName: - description: |- - Specifies the name of the Secret with credentials used by the Function Controller - to authenticate to the Git repository in order to fetch the Function's source code and dependencies. - This Secret must be stored in the same Namespace as the Function CR. - type: string - x-kubernetes-validations: - - message: SecretName is required and cannot be empty - rule: self.trim().size() != 0 - type: - description: |- - Defines the repository authentication method. The value is either `basic` if you use a password or token, - or `key` if you use an SSH key. - enum: - - basic - - key - type: string - required: - - secretName - - type - type: object - baseDir: - description: |- - Specifies the relative path to the Git directory that contains the source code - from which the Function is built. - type: string - reference: - description: |- - Specifies either the branch name, tag or commit revision from which the Function Controller - automatically fetches the changes in the Function's code and dependencies. - type: string - url: - description: |- - Specifies the URL of the Git repository with the Function's code and dependencies. - Depending on whether the repository is public or private and what authentication method is used to access it, - the URL must start with the `http(s)`, `git`, or `ssh` prefix. - type: string - required: - - url - type: object - x-kubernetes-validations: - - message: BaseDir is required and cannot be empty - rule: has(self.baseDir) && (self.baseDir.trim().size() != 0) - - message: Reference is required and cannot be empty - rule: has(self.reference) && (self.reference.trim().size() != - 0) - inline: - description: Defines the Function as the inline Function. Can't - be used together with **GitRepository**. - properties: - dependencies: - description: Specifies the Function's dependencies. - type: string - source: - description: Specifies the Function's full source code. - minLength: 1 - type: string - required: - - source - type: object - type: object - x-kubernetes-validations: - - message: Use GitRepository or Inline source - rule: has(self.gitRepository) && !has(self.inline) || !has(self.gitRepository) - && has(self.inline) - template: - description: 'Deprecated: Use **Labels** and **Annotations** to label - and/or annotate Function''s Pods.' - properties: - annotations: - additionalProperties: - type: string - description: 'Deprecated: Use **FunctionSpec.Annotations** to - annotate Function''s Pods.' - type: object - labels: - additionalProperties: - type: string - description: 'Deprecated: Use **FunctionSpec.Labels** to label - Function''s Pods.' - type: object - type: object - x-kubernetes-validations: - - message: 'Not supported: Use spec.labels and spec.annotations to - label and/or annotate Function''s Pods.' - rule: '!has(self.labels) && !has(self.annotations)' - required: - - runtime - - source - type: object - status: - description: FunctionStatus defines the observed state of the Function - properties: - baseDir: - description: |- - Specifies the relative path to the Git directory that contains the source code - from which the Function is built. - type: string - buildResourceProfile: - description: Specifies the preset used for the build job - type: string - commit: - description: Specifies the commit hash used to build the Function. - type: string - conditions: - description: Specifies an array of conditions describing the status - of the parser. - items: - properties: - lastTransitionTime: - description: Specifies the last time the condition transitioned - from one status to another. - format: date-time - type: string - message: - description: Provides a human-readable message indicating details - about the transition. - type: string - reason: - description: Specifies the reason for the condition's last transition. - type: string - status: - description: Specifies the status of the condition. The value - is either `True`, `False`, or `Unknown`. - type: string - type: - description: Specifies the type of the Function's condition. - type: string - required: - - status - type: object - type: array - functionResourceProfile: - description: Specifies the preset used for the function - type: string - podSelector: - description: Specifies the Pod selector used to match Pods in the - Function's Deployment. - type: string - reference: - description: |- - Specifies either the branch name, tag or commit revision from which the Function Controller - automatically fetches the changes in the Function's code and dependencies. - type: string - replicas: - description: Specifies the total number of non-terminated Pods targeted - by this Function. - format: int32 - type: integer - runtime: - description: Specifies the **Runtime** type of the Function. - type: string - runtimeImage: - description: Specifies the image version used to build and run the - Function's Pods. - type: string - runtimeImageOverride: - description: |- - Deprecated: Specifies the runtime image version which overrides the **RuntimeImage** status parameter. - **RuntimeImageOverride** exists for historical compatibility - and should be removed with v1alpha3 version. - type: string - type: object - type: object - served: true - storage: true - subresources: - scale: - labelSelectorPath: .status.podSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} diff --git a/config/serverless/templates/deployment.yaml b/config/serverless/templates/deployment.yaml deleted file mode 100644 index 8fed92960..000000000 --- a/config/serverless/templates/deployment.yaml +++ /dev/null @@ -1,158 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "fullname" . }}-ctrl-mngr - namespace: {{ .Release.Namespace }} - labels: - kyma-project.io/component: controller - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} - {{- if .Values.deployment.labels }} - {{- include "tplValue" ( dict "value" .Values.deployment.labels "context" . ) | nindent 4 }} - {{- end }} - {{- if .Values.deployment.annotations }} - annotations: - {{ include "tplValue" ( dict "value" .Values.deployment.annotations "context" . ) | nindent 4 }} - {{- end }} -spec: - selector: - matchLabels: - app: {{ template "name" . }} - app.kubernetes.io/name: {{ template "name" . }} - app.kubernetes.io/instance: "{{ .Release.Name }}" - replicas: {{ .Values.deployment.replicas }} - {{- if .Values.deployment.extraProperties }} - {{ include "tplValue" ( dict "value" .Values.deployment.extraProperties "context" . ) | nindent 2 }} - {{- end }} - template: - metadata: - labels: - app: {{ template "name" . }} - app.kubernetes.io/name: {{ template "name" . }} - app.kubernetes.io/instance: "{{ .Release.Name }}" - kyma-project.io/component: controller - {{- if .Values.pod.labels }} - {{ include "tplValue" ( dict "value" .Values.pod.labels "context" . ) | nindent 8 }} - {{- end }} - {{- if or .Values.pod.annotations (and .Values.metrics.enabled .Values.metrics.pod.annotations) }} - annotations: - {{- if .Values.pod.annotations }} - {{ include "tplValue" ( dict "value" .Values.pod.annotations "context" . ) | nindent 8 }} - {{- end }} - {{- if and .Values.metrics.enabled .Values.metrics.pod.annotations }} - {{ include "tplValue" ( dict "value" .Values.metrics.pod.annotations "context" . ) | nindent 8 }} - {{- end }} - {{- end }} - spec: - volumes: - - name: configuration - configMap: - name: "{{ .Values.global.configuration.configmapName }}" - - name: tmpdir # Needed to allow git repo fetching with read-only rootfs enabled - emptyDir: { } - serviceAccountName: {{ template "fullname" . }}-controller-manager - {{- if .Values.pod.extraProperties }} - {{ include "tplValue" ( dict "value" .Values.pod.extraProperties "context" . ) | nindent 6 }} - {{- end }} - containers: - - name: manager - volumeMounts: - - name: configuration - mountPath: {{ .Values.global.configuration.targetDir }} - - name: tmpdir # Needed to allow git repo fetching with read-only rootfs enabled - mountPath: "/tmp" - image: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_controller) }}" - imagePullPolicy: {{ .Values.images.function_controller.pullPolicy }} - command: - - /app/manager - {{- if .Values.containers.manager.resources }} - resources: - {{- include "tplValue" ( dict "value" .Values.containers.manager.resources "context" . ) | nindent 12 }} - {{- end }} - {{- if .Values.containers.manager.containerSecurityContext }} - securityContext: - {{- include "tplValue" ( dict "value" .Values.containers.manager.containerSecurityContext "context" . ) | nindent 12 }} - {{- end }} - ports: - - containerPort: {{ .Values.services.manager.https.targetPort }} - name: "webhook" - protocol: TCP - {{- if .Values.metrics.enabled }} - - containerPort: {{ .Values.metrics.manager.port.port }} - name: {{ .Values.metrics.manager.port.name }} - protocol: {{ .Values.metrics.manager.port.protocol }} - {{- end }} - - containerPort: {{ .Values.containers.manager.healthz.port }} - name: "health" - protocol: TCP - livenessProbe: - httpGet: - port: {{ .Values.containers.manager.healthz.port }} - path: "/healthz/" - initialDelaySeconds: {{ .Values.deployment.livenessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.deployment.livenessProbe.timeoutSeconds }} - periodSeconds: {{.Values.deployment.livenessProbe.periodSeconds }} - failureThreshold: {{.Values.deployment.livenessProbe.failureThreshold }} - successThreshold: {{.Values.deployment.livenessProbe.successThreshold }} - readinessProbe: - httpGet: - port: {{ .Values.containers.manager.healthz.port }} - path: "/readyz/" - initialDelaySeconds: {{ .Values.deployment.readinessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.deployment.readinessProbe.timeoutSeconds }} - periodSeconds: {{.Values.deployment.readinessProbe.periodSeconds }} - failureThreshold: {{.Values.deployment.readinessProbe.failureThreshold }} - successThreshold: {{.Values.deployment.readinessProbe.successThreshold }} - env: - {{- if .Values.metrics.enabled }} - - name: APP_METRICS_ADDRESS - value: ":{{ .Values.metrics.manager.port.port }}" - {{- end }} - {{- if gt (int .Values.deployment.replicas) 1 }} - - name: APP_LEADER_ELECTION_ENABLED - value: "true" - {{- end }} - - name: APP_HEALTHZ_ADDRESS - value: ":{{ .Values.containers.manager.healthz.port }}" - - name: APP_KUBERNETES_BASE_NAMESPACE - value: "{{- tpl ( .Values.containers.manager.configuration.data.baseNamespace) . }}" - - name: APP_KUBERNETES_BASE_DEFAULT_SECRET_NAME - value: "{{- tpl ( .Values.containers.manager.configuration.data.imageRegistryDefaultDockerConfigSecretName) . }}" - - name: APP_KUBERNETES_CONFIG_MAP_REQUEUE_DURATION - value: "{{ .Values.containers.manager.configuration.data.configMapRequeueDuration }}" - - name: APP_KUBERNETES_SECRET_REQUEUE_DURATION - value: {{.Values.containers.manager.configuration.data.secretRequeueDuration }} - - name: APP_KUBERNETES_SERVICE_ACCOUNT_REQUEUE_DURATION - value: {{.Values.containers.manager.configuration.data.serviceAccountRequeueDuration }} - - name: APP_KUBERNETES_EXCLUDED_NAMESPACES - value: "{{ .Release.Namespace }}" - - name: APP_FUNCTION_TRACE_COLLECTOR_ENDPOINT - value: "{{.Values.containers.manager.configuration.data.functionTraceCollectorEndpoint }}" - - name: APP_FUNCTION_PUBLISHER_PROXY_ADDRESS - value: "{{.Values.containers.manager.configuration.data.functionPublisherProxyAddress }}" - - name: APP_FUNCTION_IMAGE_REGISTRY_DEFAULT_DOCKER_CONFIG_SECRET_NAME - value: "{{- tpl ( .Values.containers.manager.configuration.data.imageRegistryDefaultDockerConfigSecretName) . }}" - - name: APP_FUNCTION_IMAGE_REGISTRY_EXTERNAL_DOCKER_CONFIG_SECRET_NAME - value: "{{- tpl ( .Values.containers.manager.configuration.data.imageRegistryExternalDockerConfigSecretName) . }}" - - name: APP_FUNCTION_PACKAGE_REGISTRY_CONFIG_SECRET_NAME - value: "{{- tpl ( .Values.containers.manager.configuration.data.packageRegistryConfigSecretName) . }}" - - name: APP_FUNCTION_IMAGE_PULL_ACCOUNT_NAME - value: "{{- tpl ( .Values.containers.manager.configuration.data.imagePullAccountName ) . }}" - - name: APP_FUNCTION_REQUEUE_DURATION - value: "{{.Values.containers.manager.configuration.data.functionRequeueDuration }}" - - name: APP_FUNCTION_BUILD_EXECUTOR_ARGS - value: "{{.Values.containers.manager.configuration.data.functionBuildExecutorArgs }}" - - name: APP_FUNCTION_BUILD_EXECUTOR_IMAGE - value: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.kaniko_executor) }}" - - name: APP_FUNCTION_TARGET_CPU_UTILIZATION_PERCENTAGE - value: "{{.Values.containers.manager.configuration.data.targetCPUUtilizationPercentage }}" - - name: APP_FUNCTION_BUILD_REPO_FETCHER_IMAGE - value: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_build_init)}}" - - name: APP_FUNCTION_BUILD_MAX_SIMULTANEOUS_JOBS - value: "{{.Values.containers.manager.configuration.data.functionBuildMaxSimultaneousJobs }}" - - name: APP_HEALTHZ_LIVENESS_TIMEOUT - value: "{{.Values.containers.manager.configuration.data.healthzLivenessTimeout }}" - - name: APP_FUNCTION_RESOURCE_CONFIG - value: {{ .Values.containers.manager.configuration.data.resourcesConfiguration | toYaml | quote }} - - name: APP_LOG_CONFIG_PATH - value: "{{ .Values.global.configuration.targetDir }}/{{ .Values.global.configuration.logFilename }}" - priorityClassName: {{ .Values.global.serverlessPriorityClassName }} diff --git a/config/serverless/templates/leader-election-role-binding.yaml b/config/serverless/templates/leader-election-role-binding.yaml deleted file mode 100644 index a93981777..000000000 --- a/config/serverless/templates/leader-election-role-binding.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if gt (int .Values.deployment.replicas) 1 }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ template "fullname" . }}-leader-election - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ template "fullname" . }}-leader-election -subjects: -- kind: ServiceAccount - name: {{ template "fullname" . }}-controller-manager - namespace: {{ .Release.Namespace }} -{{- end }} diff --git a/config/serverless/templates/leader-election-role.yaml b/config/serverless/templates/leader-election-role.yaml deleted file mode 100644 index a7adda52b..000000000 --- a/config/serverless/templates/leader-election-role.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if gt (int .Values.deployment.replicas) 1 }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: {{ template "fullname" . }}-leader-election - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - configmaps/status - verbs: - - get - - update - - patch -- apiGroups: - - "" - resources: - - events - verbs: - - create -{{- end }} diff --git a/config/serverless/templates/runtimes.yaml b/config/serverless/templates/runtimes.yaml deleted file mode 100644 index 5fb10930a..000000000 --- a/config/serverless/templates/runtimes.yaml +++ /dev/null @@ -1,103 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: dockerfile-nodejs18 - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: runtime - serverless.kyma-project.io/runtime: nodejs18 -data: - Dockerfile: |- - ARG base_image={{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_runtime_nodejs18) }} - FROM ${base_image} - USER root - ARG SRC_DIR=/src - - RUN mkdir -p /usr/src/app/function - WORKDIR /usr/src/app/function - - COPY /registry-config/* /usr/src/app/function/ - COPY $SRC_DIR/package.json /usr/src/app/function/package.json - - RUN npm install --omit=dev - COPY $SRC_DIR /usr/src/app/function - RUN ls -l /usr/src/app/function - WORKDIR /usr/src/app - - USER 1000 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: dockerfile-nodejs20 - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: runtime - serverless.kyma-project.io/runtime: nodejs20 -data: - Dockerfile: |- - ARG base_image={{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_runtime_nodejs20) }} - FROM ${base_image} - USER root - ARG SRC_DIR=/src - - RUN mkdir -p /usr/src/app/function - WORKDIR /usr/src/app/function - - COPY /registry-config/* /usr/src/app/function/ - COPY $SRC_DIR/package.json /usr/src/app/function/package.json - - RUN npm install --omit=dev - COPY $SRC_DIR /usr/src/app/function - RUN ls -l /usr/src/app/function - WORKDIR /usr/src/app - - USER 1000 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: dockerfile-python39 - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: runtime - serverless.kyma-project.io/runtime: python39 -data: - Dockerfile: |- - ARG base_image={{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_runtime_python39) }} - FROM ${base_image} - USER root - ENV KUBELESS_INSTALL_VOLUME=/kubeless - - COPY /src/requirements.txt $KUBELESS_INSTALL_VOLUME/requirements.txt - COPY /registry-config/* /etc/ - RUN pip install --no-cache-dir -r $KUBELESS_INSTALL_VOLUME/requirements.txt - COPY /src $KUBELESS_INSTALL_VOLUME - - RUN rm -rf /etc/pip.conf - - USER 1000 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: dockerfile-python312 - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: runtime - serverless.kyma-project.io/runtime: python312 -data: - Dockerfile: |- - ARG base_image={{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.function_runtime_python312) }} - FROM ${base_image} - USER root - ENV KUBELESS_INSTALL_VOLUME=/kubeless - - COPY /src/requirements.txt $KUBELESS_INSTALL_VOLUME/requirements.txt - COPY /registry-config/* /etc/ - RUN pip install --no-cache-dir -r $KUBELESS_INSTALL_VOLUME/requirements.txt - COPY /src $KUBELESS_INSTALL_VOLUME - - RUN rm -rf /etc/pip.conf - - USER 1000 diff --git a/config/serverless/templates/service-accounts.yaml b/config/serverless/templates/service-accounts.yaml deleted file mode 100644 index 2bd00d0c9..000000000 --- a/config/serverless/templates/service-accounts.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "fullname" . }}-controller-manager - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "fullname" . }}-function - namespace: {{ .Release.Namespace }} - labels: - serverless.kyma-project.io/config: service-account -automountServiceAccountToken: false -imagePullSecrets: - - name: {{ template "fullname" . }}-registry-config - - name: {{ template "fullname" . }}-registry-config-default diff --git a/config/serverless/templates/service.yaml b/config/serverless/templates/service.yaml deleted file mode 100644 index 35ba0c216..000000000 --- a/config/serverless/templates/service.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "fullname" . }}-controller-manager - namespace: {{ .Release.Namespace }} - labels: - {{- include "tplValue" ( dict "value" .Values.global.commonLabels "context" . ) | nindent 4 }} - {{- if .Values.services.manager.labels }} - {{- include "tplValue" ( dict "value" .Values.services.manager.labels "context" . ) | nindent 4 }} - {{- end }} - {{- if .Values.services.manager.annotations }} - annotations: - {{- include "tplValue" ( dict "value" .Values.services.manager.annotations "context" . ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.services.manager.type }} - ports: - - name: {{ .Values.metrics.manager.port.name }} - port: {{ .Values.metrics.manager.port.port }} - protocol: {{ .Values.metrics.manager.port.protocol }} - targetPort: {{ .Values.metrics.manager.port.targerPort }} - - name: "https" - port: {{ .Values.services.manager.https.port }} - protocol: TCP - targetPort: {{ .Values.services.manager.https.targetPort }} - selector: - app: {{ template "name" . }} - app.kubernetes.io/name: {{ template "name" . }} - app.kubernetes.io/instance: "{{ .Release.Name }}"