From 1b3833205cf4b73f9bf8baf6b192b327ab5f1efc Mon Sep 17 00:00:00 2001 From: Sanket Sudake Date: Tue, 19 Oct 2021 15:59:14 +0530 Subject: [PATCH] refactoring: Breakdown fission-all chart into components and removed fission-core (#2224) * Sync a few files from fission-all to fission-core chart * Change values in fission-all chart We keep the following components by default disabled now, which were enabled by default earlier. 1. nats - Fission Nats integration 2. influxdb - Influxdb and logger component 3. prometheus - Prometheus disabled by default 4. canaryDeployment - Disabled by default This change reduces the need for a fission-core chart and we can configure values of fission-all so that it can provide the behaviour of fission-all as well as fission-core. * Remove fission-core chart * Add README in the fission-all chart * Rename clusterrolebinding fission-crd to fission-cr-admin * Add icon and sources in helm chart Signed-off-by: Sanket Sudake --- .github/workflows/push_pr.yaml | 2 +- charts/README.md | 131 -- charts/fission-all/Chart.yaml | 14 +- charts/fission-all/README.md | 108 ++ .../{ => analytics}/nonhelm-install-job.yaml | 0 .../{ => analytics}/post-install-job.yaml | 0 .../{ => analytics}/post-upgrade-job.yaml | 0 .../templates/buildermgr/deployment.yaml | 54 + .../templates/common/clusterrole.yaml | 100 ++ .../templates/common/clusterrolebinding.yaml | 12 + .../templates/common/rolebinding.yaml | 13 + .../templates/common/serviceaccount.yaml | 5 + .../fission-all/templates/controller/cm.yaml | 7 + .../templates/controller/deployment.yaml | 71 + .../fission-all/templates/controller/svc.yaml | 18 + charts/fission-all/templates/deployment.yaml | 1161 ----------------- .../templates/executor/deployment.yaml | 84 ++ .../fission-all/templates/executor/svc.yaml | 14 + .../templates/fission-ui/deployment.yaml | 29 + .../templates/{ => fluentbit}/fluentbit.yaml | 2 + .../templates/heapster/deployment.yaml | 46 + .../templates/influxdb/deployment.yaml | 55 + .../templates/influxdb/secret.yaml | 12 + .../templates/kubewatcher/deployment.yaml | 34 + .../templates/misc-functions/clusterrole.yaml | 33 + .../templates/misc-functions/namespace.yaml | 24 + .../templates/misc-functions/role.yaml | 70 + .../templates/misc-functions/rolebinding.yaml | 43 + .../misc-functions/serviceaccount.yaml | 12 + .../deployment.yaml | 52 + .../secret.yaml} | 12 - .../mqt-fission-kafka/deployment.yaml | 94 ++ .../mqt-fission-nats/deployment.yaml | 110 ++ .../templates/mqt-fission-nats/svc.yaml | 19 + .../templates/mqt-keda/deployment.yaml | 53 + .../pre-upgrade-job.yaml | 0 .../{router.yaml => router/deployment.yaml} | 0 charts/fission-all/templates/router/svc.yaml | 22 + .../templates/storagesvc/deployment.yaml | 92 ++ .../templates/{ => storagesvc}/pvc.yaml | 0 .../fission-all/templates/storagesvc/svc.yaml | 15 + charts/fission-all/templates/svc.yaml | 95 -- .../templates/timer/deployment.yaml | 34 + charts/fission-all/values.yaml | 73 +- charts/fission-core/.helmignore | 21 - charts/fission-core/Chart.lock | 6 - charts/fission-core/Chart.yaml | 21 - charts/fission-core/LICENSE | 202 --- charts/fission-core/templates/NOTES.txt | 25 - charts/fission-core/templates/_helpers.tpl | 70 - charts/fission-core/templates/deployment.yaml | 521 -------- .../templates/nonhelm-install-job.yaml | 41 - .../templates/post-install-job.yaml | 45 - .../templates/post-upgrade-job.yaml | 45 - .../templates/pre-upgrade-job.yaml | 33 - charts/fission-core/templates/pvc.yaml | 23 - charts/fission-core/templates/router.yaml | 93 -- charts/fission-core/templates/svc.yaml | 75 -- charts/fission-core/values.yaml | 305 ----- hack/generate-helm-manifest.sh | 39 +- skaffold.yaml | 18 +- 61 files changed, 1422 insertions(+), 2986 deletions(-) delete mode 100644 charts/README.md create mode 100644 charts/fission-all/README.md rename charts/fission-all/templates/{ => analytics}/nonhelm-install-job.yaml (100%) rename charts/fission-all/templates/{ => analytics}/post-install-job.yaml (100%) rename charts/fission-all/templates/{ => analytics}/post-upgrade-job.yaml (100%) create mode 100644 charts/fission-all/templates/buildermgr/deployment.yaml create mode 100644 charts/fission-all/templates/common/clusterrole.yaml create mode 100644 charts/fission-all/templates/common/clusterrolebinding.yaml create mode 100644 charts/fission-all/templates/common/rolebinding.yaml create mode 100644 charts/fission-all/templates/common/serviceaccount.yaml create mode 100644 charts/fission-all/templates/controller/cm.yaml create mode 100644 charts/fission-all/templates/controller/deployment.yaml create mode 100644 charts/fission-all/templates/controller/svc.yaml delete mode 100644 charts/fission-all/templates/deployment.yaml create mode 100644 charts/fission-all/templates/executor/deployment.yaml create mode 100644 charts/fission-all/templates/executor/svc.yaml create mode 100644 charts/fission-all/templates/fission-ui/deployment.yaml rename charts/fission-all/templates/{ => fluentbit}/fluentbit.yaml (99%) create mode 100644 charts/fission-all/templates/heapster/deployment.yaml create mode 100644 charts/fission-all/templates/influxdb/deployment.yaml create mode 100644 charts/fission-all/templates/influxdb/secret.yaml create mode 100644 charts/fission-all/templates/kubewatcher/deployment.yaml create mode 100644 charts/fission-all/templates/misc-functions/clusterrole.yaml create mode 100644 charts/fission-all/templates/misc-functions/namespace.yaml create mode 100644 charts/fission-all/templates/misc-functions/role.yaml create mode 100644 charts/fission-all/templates/misc-functions/rolebinding.yaml create mode 100644 charts/fission-all/templates/misc-functions/serviceaccount.yaml create mode 100644 charts/fission-all/templates/mqt-fission-azurestoragequeue/deployment.yaml rename charts/fission-all/templates/{secrets.yaml => mqt-fission-azurestoragequeue/secret.yaml} (55%) create mode 100644 charts/fission-all/templates/mqt-fission-kafka/deployment.yaml create mode 100644 charts/fission-all/templates/mqt-fission-nats/deployment.yaml create mode 100644 charts/fission-all/templates/mqt-fission-nats/svc.yaml create mode 100644 charts/fission-all/templates/mqt-keda/deployment.yaml rename charts/fission-all/templates/{ => pre-upgrade-checks}/pre-upgrade-job.yaml (100%) rename charts/fission-all/templates/{router.yaml => router/deployment.yaml} (100%) create mode 100644 charts/fission-all/templates/router/svc.yaml create mode 100644 charts/fission-all/templates/storagesvc/deployment.yaml rename charts/fission-all/templates/{ => storagesvc}/pvc.yaml (100%) create mode 100644 charts/fission-all/templates/storagesvc/svc.yaml delete mode 100644 charts/fission-all/templates/svc.yaml create mode 100644 charts/fission-all/templates/timer/deployment.yaml delete mode 100644 charts/fission-core/.helmignore delete mode 100644 charts/fission-core/Chart.lock delete mode 100644 charts/fission-core/Chart.yaml delete mode 100644 charts/fission-core/LICENSE delete mode 100644 charts/fission-core/templates/NOTES.txt delete mode 100644 charts/fission-core/templates/_helpers.tpl delete mode 100644 charts/fission-core/templates/deployment.yaml delete mode 100644 charts/fission-core/templates/nonhelm-install-job.yaml delete mode 100644 charts/fission-core/templates/post-install-job.yaml delete mode 100644 charts/fission-core/templates/post-upgrade-job.yaml delete mode 100644 charts/fission-core/templates/pre-upgrade-job.yaml delete mode 100644 charts/fission-core/templates/pvc.yaml delete mode 100644 charts/fission-core/templates/router.yaml delete mode 100644 charts/fission-core/templates/svc.yaml delete mode 100644 charts/fission-core/values.yaml diff --git a/.github/workflows/push_pr.yaml b/.github/workflows/push_pr.yaml index e9a0af05..a4500d53 100644 --- a/.github/workflows/push_pr.yaml +++ b/.github/workflows/push_pr.yaml @@ -72,7 +72,7 @@ jobs: - name: Helm chart lint run: | - helm lint charts/fission-all/ charts/fission-core/ + helm lint charts/fission-all/ - name: Helm update run: helm repo add prometheus-community https://prometheus-community.github.io/helm-charts diff --git a/charts/README.md b/charts/README.md deleted file mode 100644 index c70d90bb..00000000 --- a/charts/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Fission - -[Fission](http://fission.io/) is a framework for serverless functions on Kubernetes. - - -## Prerequisites - -- Kubernetes 1.9 or later - - -## Helm charts - -The following table lists two helm charts for Fission. - -| Parameter | Description | -| ---------------| ---------------------------------------------------------------------------------------| -| `fission-core` | FaaS essentials, and triggers for HTTP, Timers and Kubernetes Watches | -| `fission-all` | Log aggregation with fluentd and InfluxDB; NATS for message queue triggers; Fission-UI | - -## Installing the chart - -To install the chart with the release name `my-release`, - -```bash -$ helm install --name my-release fission-all -``` - -## Uninstalling the chart - -To uninstall/delete chart, - -```bash -$ helm delete my-release -``` - -## Configuration - -The following table lists the configurable parameters of the Fission chart and their default values. - -Parameter | Description | Default ---------- | ----------- | ------- -`serviceType` | Type of Fission Controller service to use. For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. | `ClusterIP` -`routerServiceType` | Type of Fission Router service to use. For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. | `LoadBalancer` -`repository` | Image base repository | `index.docker.io` -`image` | Fission image repository | `fission/fission-bundle` -`imageTag` | Fission image tag | `1.13.1` -`pullPolicy` | Image pull policy | `IfNotPresent` -`fetcher.image` | Fission fetcher repository | `fission/fetcher` -`fetcher.imageTag` | Fission fetcher image tag | `1.13.1` -`controllerPort` | Fission Controller service port | `31313` -`routerPort` | Fission Router service port | ` 31314` -`functionNamespace` | Namespace in which to run fission functions (this is different from the release namespace) | `fission-function` -`builderNamespace` | Namespace in which to run fission builders (this is different from the release namespace) | `fission-builder` -`enableIstio` | Enable istio integration | `false` -`persistence.enabled` | If true, persist data to a persistent volume | `true` -`persistence.existingClaim` | Provide an existing PersistentVolumeClaim instead of creating a new one | `nil` -`persistence.storageClass` | PersistentVolumeClaim storage class | `nil` -`persistence.accessMode` | PersistentVolumeClaim access mode | `ReadWriteOnce` -`persistence.size` | PersistentVolumeClaim size | `8Gi` -`analytics` | Analytics let us count how many people installed fission. Set to false to disable analytics | `true` -`analyticsNonHelmInstall` | Internally used for generating an analytics job for non-helm installs | `false` -`pruneInterval` | The frequency of archive pruner (in minutes) | `60` -`preUpgradeChecksImage` | Fission pre-install/pre-upgrade checks live in this image | `fission/pre-upgrade-checks` -`debugEnv` | If there are any pod specialization errors when a function is triggered and this flag is set to true, the error summary is returned as part of http response | `true` -`prometheus.enabled` | Set to true if prometheus needs to be deployed along with fission | `true` in `fission-all`, `false` in `fission-core` -`prometheus.serviceEndpoint` | If prometheus.enabled is false, please assign the prometheus service URL that is accessible by components. | `nil` -`canaryDeployment.enabled` | Set to true if you need canary deployment feature | `true` in `fission-all`, `false` in `fission-core` -`extraCoreComponentPodConfig` | Extend the container specs for the core fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. | None -`executor.adoptExistingResources` | If true, executor will try to adopt existing resources created by the old executor instance. | `false` -`router.deployAsDaemonSet` | Deploy router as DaemonSet instead of Deployment | `false` -`router.extraCoreComponentPodConfig` | Extend the container specs for the router fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. Overrides the generic `extraCoreComponentPodConfig`| None -`router.svcAddressMaxRetries` | Max retries times for router to retry on a certain service URL returns from cache/executor | `5` -`router.svcAddressUpdateTimeout` | The length of update lock expiry time for router to get a service URL returns from executor | `30` -`router.svcAnnotations` | Annotations for router service | None -`router.useEncodedPath` | For router to match encoded path. If true, "/foo%2Fbar" will match the path "/{var}"; Otherwise, it will match the path "/foo/bar". | `false` -`router.traceSamplingRate` | Uniformly sample traces with the given probabilistic sampling rate | `0.5` -`router.roundTrip.disableKeepAlive` | Disable transport keep-alive for fast switching function version | `true` -`router.roundTrip.keepAliveTime` | The keep-alive period for an active network connection to function pod | `30s` -`router.roundTrip.timeout` | HTTP transport request timeout | `50ms` -`router.roundTrip.timeoutExponent` | The length of request timeout will multiply with timeoutExponent after each retry | `2` -`router.roundTrip.maxRetries` | Max retries times of a failed request | `10` -`openTracing.enabled` | If true, OpenTracing is enabled | `false` -`openTracing.collectorEndpoint` | Jaeger collector endpoint | `` -`openTracing.samplingRate` | Probabilistic sampling rate | `0.5` -`otelCollectorEndpoint` | OpenTelemetry collector endpoint | None - -### Extra configuration for `fission-all` - -Parameter | Description | Default ---------- | ----------- | ------- -`createNamespace` | If true, create `fission-function` and `fission-builder` namespaces | ` true` -`logger.influxdbAdmin` | Log database admin username | `admin` -`logger.fluentdImageRepository` | Logger fluentbit image repository | `index.docker.io` -`logger.fluentdImage` | Logger fluentbit image | `fluent/fluent-bit` -`logger.fluentdImageTag` | Logger fluentbit image tag | `1.0.4` -`nats.enabled` | Nats streaming enabled | `true` -`nats.external` | Use external Nats installation | `false` -`nats.hostaddress` | Address of NATS cluster | `nats-streaming:4222` -`nats.authToken` | Nats streaming auth token | `defaultFissionAuthToken` -`nats.clusterID` | Nats streaming clusterID | `fissionMQTrigger` -`nats.clientID` | Client name registered with nats streaming | `fission` -`nats.queueGroup` | Queue group registered with nats streaming | `fission-messageQueueNatsTrigger` -`natsStreamingPort` | Nats streaming service port | `31316` -`azureStorageQueue.enabled` | Azure storage account name | `false` -`azureStorageQueue.key` | Azure storage account name | `""` -`azureStorageQueue.accountName` | Azure storage access key | `""` -`kafka.enabled` | Kafka trigger enabled | `false` -`kafka.brokers` | Kafka brokers uri | `broker.kafka:9092` -`kafka.version` | Kafka broker version | `nil` -`heapster` | Enable Heapster (only enable this in clusters where heapster does not exist already) | `false` - -Please note that deploying of Azure Storage Queue or Kafka is not done by Fission chart and you will have to explicitly deploy them. - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```bash -$ helm install --name my-release --set image=custom/fission-bundle,imageTag=v1 fission-all -``` - -If you're using minikube, set serviceType and routerServiceType to NodePort: - -```bash -$ helm install --name my-release --set serviceType=NodePort,routerServiceType=NodePort fission-all -``` - -You can also set parameters with a yaml file (see [values.yaml](fission-all/values.yaml) for -what it should look like): - -```bash -$ helm install --name my-release -f values.yaml fission-all -``` diff --git a/charts/fission-all/Chart.yaml b/charts/fission-all/Chart.yaml index a5528050..fcf67713 100644 --- a/charts/fission-all/Chart.yaml +++ b/charts/fission-all/Chart.yaml @@ -1,21 +1,25 @@ apiVersion: v2 name: fission-all version: v1.15.0-rc1 +appVersion: v1.15.0-rc1 description: Fission is a fast serverless framework for Kubernetes. -keywords: -- fission -- serverless home: https://fission.io/ +icon: https://fission.io/images/logo-gh.svg +sources: + - https://github.com/fission/fission + - https://github.com/fission/keda-connectors +keywords: + - fission + - serverless maintainers: - name: Vishal Biyani email: vishal@infracloud.io - name: Sanket Sudake email: sanket@infracloud.io engine: gotpl -appVersion: v1.15.0-rc1 type: application dependencies: - name: prometheus version: 13.2.1 repository: https://prometheus-community.github.io/helm-charts - condition: prometheus.enabled \ No newline at end of file + condition: prometheus.enabled diff --git a/charts/fission-all/README.md b/charts/fission-all/README.md new file mode 100644 index 00000000..b1989336 --- /dev/null +++ b/charts/fission-all/README.md @@ -0,0 +1,108 @@ +# fission-all + +[Fission](https://fission.io/) is a framework for serverless functions on Kubernetes. + +## Prerequisites + +- Kubernetes 1.19+ +- Helm 3+ + +## Get Repo Info + +```console +helm repo add fission-charts https://fission.github.io/fission-charts +helm repo update +``` + +_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ + +## Install Chart + +Replace `{{version}}` with [the latest Fission version](https://github.com/fission/fission/releases/latest). +![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/fission/fission) + +```console +# Helm +$ export FISSION_NAMESPACE="fission" +$ kubectl create namespace $FISSION_NAMESPACE +$ kubectl create -k "github.com/fission/fission/crds/v1?ref={{version}}" +$ helm install [RELEASE_NAME] fission-charts/fission-all --namespace fission +``` + +_See [configuration](#configuration) below._ + +_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._ + +## Dependencies + +By default this chart installs additional, dependent charts: + +- [prometheus-community/prometheus](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus) + +To disable dependencies during installation, see [multiple releases](#multiple-releases) below. + +_See [helm dependency](https://helm.sh/docs/helm/helm_dependency/) for command documentation._ + +## Uninstall Chart + +```console +# Helm +$ helm uninstall [RELEASE_NAME] +``` + +This removes all the Kubernetes components associated with the chart and deletes the release. + +_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._ + +CRDs are not removed by this chart and should be manually cleaned up: + +`{{version}}` references the version you used during the installation of chart. + +```console +kubectl delete -k "github.com/fission/fission/crds/v1?ref={{version}}" +``` + +OR + +You can list all Fission CRDs and clean them up with `kubectl delete crd` command. + +```console +kubectl get crds| grep ".fission.io" +``` + +## Upgrading Chart + +CRDs created by this chart are not updated by default and should be manually updated. + +`{{version}}` references the version you are upgrading to ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/fission/fission) + +```console +kubectl replace -k "github.com/fission/fission/crds/v1?ref={{version}}" +``` + +```console +# Helm +$ helm upgrade [RELEASE_NAME] fission-charts/fission-all +``` + +_See [configuration](#configuration) below._ + +_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ + +### Upgrading an existing Release to a new major version + +A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions. + +## Configuration + +See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments: + +```console +helm show values fission-charts/fission-all +``` + +You may also `helm show values` on this chart's [dependencies](#dependencies) for additional options. + +### Multiple releases + +The same chart can be used to run multiple Fission instances in the same cluster if required. To disable a dependency during installation, set `prometheus.enabled` to `false`. diff --git a/charts/fission-all/templates/nonhelm-install-job.yaml b/charts/fission-all/templates/analytics/nonhelm-install-job.yaml similarity index 100% rename from charts/fission-all/templates/nonhelm-install-job.yaml rename to charts/fission-all/templates/analytics/nonhelm-install-job.yaml diff --git a/charts/fission-all/templates/post-install-job.yaml b/charts/fission-all/templates/analytics/post-install-job.yaml similarity index 100% rename from charts/fission-all/templates/post-install-job.yaml rename to charts/fission-all/templates/analytics/post-install-job.yaml diff --git a/charts/fission-all/templates/post-upgrade-job.yaml b/charts/fission-all/templates/analytics/post-upgrade-job.yaml similarity index 100% rename from charts/fission-all/templates/post-upgrade-job.yaml rename to charts/fission-all/templates/analytics/post-upgrade-job.yaml diff --git a/charts/fission-all/templates/buildermgr/deployment.yaml b/charts/fission-all/templates/buildermgr/deployment.yaml new file mode 100644 index 00000000..aa210c3c --- /dev/null +++ b/charts/fission-all/templates/buildermgr/deployment.yaml @@ -0,0 +1,54 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: buildermgr + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: buildermgr +spec: + replicas: 1 + selector: + matchLabels: + svc: buildermgr + template: + metadata: + labels: + svc: buildermgr + spec: + containers: + - name: buildermgr + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"] + env: + - name: FETCHER_IMAGE + {{- if eq .Values.fetcher.imageTag "" }} + value: "{{ .Values.fetcher.image }}" + {{- else }} + value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}" + {{- end }} + - name: FETCHER_IMAGE_PULL_POLICY + value: "{{ .Values.pullPolicy }}" + - name: BUILDER_IMAGE_PULL_POLICY + value: "{{ .Values.pullPolicy }}" + - name: ENABLE_ISTIO + value: "{{ .Values.enableIstio }}" + - name: FETCHER_MINCPU + value: {{ .Values.fetcher.resource.cpu.requests | quote }} + - name: FETCHER_MINMEM + value: {{ .Values.fetcher.resource.mem.requests | quote }} + - name: FETCHER_MAXCPU + value: {{ .Values.fetcher.resource.cpu.limits | quote }} + - name: FETCHER_MAXMEM + value: {{ .Values.fetcher.resource.mem.limits | quote }} + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/common/clusterrole.yaml b/charts/fission-all/templates/common/clusterrole.yaml new file mode 100644 index 00000000..c2105c96 --- /dev/null +++ b/charts/fission-all/templates/common/clusterrole.yaml @@ -0,0 +1,100 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: fission-cr-admin +rules: +- apiGroups: + - "" + resources: + - configmaps + - pods + - secrets + - services + - serviceaccounts + - namespaces + - events + verbs: + - create + - delete + - get + - list + - watch + - patch +- apiGroups: + - apps + resources: + - deployments + - deployments/scale + - replicasets + verbs: + - '*' +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - create + - delete + - get + - list + - watch + - patch +- apiGroups: + - fission.io + resources: + - canaryconfigs + - environments + - functions + - httptriggers + - kuberneteswatchtriggers + - messagequeuetriggers + - packages + - timetriggers + verbs: + - '*' +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - '*' +- apiGroups: + - rbac.authorization.k8s.io + resources: + - rolebindings + verbs: + - '*' +- apiGroups: ["rbac.authorization.k8s.io"] + resources: ["clusterroles"] + verbs: ["bind"] +- apiGroups: + - keda.sh + resources: + - scaledjobs + - scaledobjects + - scaledjobs/finalizers + - scaledjobs/status + - triggerauthentications + - triggerauthentications/status + verbs: + - '*' +{{- if .Values.mqt_keda.enabled }} +- apiGroups: + - keda.k8s.io + resources: + - scaledjobs + - scaledobjects + - scaledjobs/finalizers + - scaledjobs/status + - triggerauthentications + - triggerauthentications/status + verbs: + - '*' +{{- end }} +- apiGroups: + - metrics.k8s.io + resources: + - pods + verbs: + - get + - list diff --git a/charts/fission-all/templates/common/clusterrolebinding.yaml b/charts/fission-all/templates/common/clusterrolebinding.yaml new file mode 100644 index 00000000..178f6b8a --- /dev/null +++ b/charts/fission-all/templates/common/clusterrolebinding.yaml @@ -0,0 +1,12 @@ +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: fission-cr-admin +subjects: + - kind: ServiceAccount + name: fission-svc + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: fission-cr-admin + apiGroup: rbac.authorization.k8s.io diff --git a/charts/fission-all/templates/common/rolebinding.yaml b/charts/fission-all/templates/common/rolebinding.yaml new file mode 100644 index 00000000..ae634847 --- /dev/null +++ b/charts/fission-all/templates/common/rolebinding.yaml @@ -0,0 +1,13 @@ +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: fission-admin + namespace: {{ .Release.Namespace }} +subjects: + - kind: ServiceAccount + name: fission-svc + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: admin + apiGroup: rbac.authorization.k8s.io diff --git a/charts/fission-all/templates/common/serviceaccount.yaml b/charts/fission-all/templates/common/serviceaccount.yaml new file mode 100644 index 00000000..b0b1a807 --- /dev/null +++ b/charts/fission-all/templates/common/serviceaccount.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: fission-svc + namespace: {{ .Release.Namespace }} diff --git a/charts/fission-all/templates/controller/cm.yaml b/charts/fission-all/templates/controller/cm.yaml new file mode 100644 index 00000000..6abc104a --- /dev/null +++ b/charts/fission-all/templates/controller/cm.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: feature-config + namespace: {{ .Release.Namespace }} +data: + "config.yaml": {{ include "config" . | b64enc }} diff --git a/charts/fission-all/templates/controller/deployment.yaml b/charts/fission-all/templates/controller/deployment.yaml new file mode 100644 index 00000000..c576b254 --- /dev/null +++ b/charts/fission-all/templates/controller/deployment.yaml @@ -0,0 +1,71 @@ +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 + spec: + containers: + - name: controller + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--controllerPort", "8888"] + env: + - name: FISSION_FUNCTION_NAMESPACE + value: "{{ .Values.functionNamespace }}" + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + 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: 8888 + name: http + {{- if .Values.pprof.enabled }} + - containerPort: 6060 + name: pprof + {{- end }} + serviceAccountName: fission-svc + volumes: + - name: config-volume + configMap: + name: feature-config +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/controller/svc.yaml b/charts/fission-all/templates/controller/svc.yaml new file mode 100644 index 00000000..fd92e57f --- /dev/null +++ b/charts/fission-all/templates/controller/svc.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: controller + labels: + svc: controller + application: fission-api + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + type: {{ .Values.serviceType }} + ports: + - port: 80 + targetPort: 8888 +{{- if eq .Values.serviceType "NodePort" }} + nodePort: {{ .Values.controllerPort }} +{{- end }} + selector: + svc: controller \ No newline at end of file diff --git a/charts/fission-all/templates/deployment.yaml b/charts/fission-all/templates/deployment.yaml deleted file mode 100644 index 4f7a1553..00000000 --- a/charts/fission-all/templates/deployment.yaml +++ /dev/null @@ -1,1161 +0,0 @@ -{{- if .Values.createNamespace }} -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.functionNamespace }} - labels: - name: fission-function - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - {{- if .Values.enableIstio }} - istio-injection: enabled - {{- end }} - ---- -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.builderNamespace }} - labels: - name: fission-builder - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - {{- if .Values.enableIstio }} - istio-injection: enabled - {{- end }} -{{- end }} ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: secret-configmap-getter -rules: -- apiGroups: - - '*' - resources: - - secrets - - configmaps - verbs: - - get - - watch - - list - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: package-getter -rules: -- apiGroups: - - '*' - resources: - - packages - verbs: - - '*' -- apiGroups: - - rbac.authorization.k8s.io - resources: - - rolebindings - verbs: - - '*' - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: fission-cr-admin -rules: -- apiGroups: - - "" - resources: - - configmaps - - pods - - secrets - - services - - serviceaccounts - - namespaces - - events - verbs: - - create - - delete - - get - - list - - watch - - patch -- apiGroups: - - apps - resources: - - deployments - - deployments/scale - - replicasets - verbs: - - '*' -- apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - - create - - delete - - get - - list - - watch - - patch -- apiGroups: - - fission.io - resources: - - canaryconfigs - - environments - - functions - - httptriggers - - kuberneteswatchtriggers - - messagequeuetriggers - - packages - - timetriggers - verbs: - - '*' -- apiGroups: - - autoscaling - resources: - - horizontalpodautoscalers - verbs: - - '*' -- apiGroups: - - rbac.authorization.k8s.io - resources: - - rolebindings - verbs: - - '*' -- apiGroups: ["rbac.authorization.k8s.io"] - resources: ["clusterroles"] - verbs: ["bind"] -- apiGroups: - - keda.sh - resources: - - scaledjobs - - scaledobjects - - scaledjobs/finalizers - - scaledjobs/status - - triggerauthentications - - triggerauthentications/status - verbs: - - '*' -- apiGroups: - - keda.k8s.io - resources: - - scaledjobs - - scaledobjects - - scaledjobs/finalizers - - scaledjobs/status - - triggerauthentications - - triggerauthentications/status - verbs: - - '*' -- apiGroups: - - metrics.k8s.io - resources: - - pods - verbs: - - get - - list - - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-svc - namespace: {{ .Release.Namespace }} - ---- -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: fission-admin - namespace: {{ .Release.Namespace }} -subjects: - - kind: ServiceAccount - name: fission-svc - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: admin - apiGroup: rbac.authorization.k8s.io - ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: fission-crd -subjects: -- kind: ServiceAccount - name: fission-svc - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: fission-cr-admin - apiGroup: rbac.authorization.k8s.io - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-fetcher - namespace: {{ .Values.functionNamespace }} - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: fission-fetcher - namespace: default -rules: -- apiGroups: - - "" - resources: - - configmaps - - secrets - - pods - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - events - verbs: - - '*' -- apiGroups: - - fission.io - resources: - - canaryconfigs - - environments - - functions - - httptriggers - - kuberneteswatchtriggers - - messagequeuetriggers - - packages - - timetriggers - verbs: - - '*' - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: fission-fetcher - namespace: default -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: fission-fetcher -subjects: -- kind: ServiceAccount - name: fission-fetcher - namespace: {{ .Values.functionNamespace }} - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-builder - namespace: {{ .Values.builderNamespace }} - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: fission-builder - namespace: default -rules: -- apiGroups: - - fission.io - resources: - - canaryconfigs - - environments - - functions - - httptriggers - - kuberneteswatchtriggers - - messagequeuetriggers - - packages - - timetriggers - verbs: - - '*' - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: fission-builder - namespace: default -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: fission-builder -subjects: -- kind: ServiceAccount - name: fission-builder - namespace: {{ .Values.builderNamespace }} - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: feature-config - namespace: {{ .Release.Namespace }} -data: - "config.yaml": {{ include "config" . | b64enc }} - ---- -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 - spec: - containers: - - name: controller - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--controllerPort", "8888"] - env: - - name: FISSION_FUNCTION_NAMESPACE - value: "{{ .Values.functionNamespace }}" - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - 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: 8888 - name: http - {{- if .Values.pprof.enabled }} - - containerPort: 6060 - name: pprof - {{- end }} - serviceAccountName: fission-svc - volumes: - - name: config-volume - configMap: - name: feature-config -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: executor - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: executor -spec: - replicas: 1 - selector: - matchLabels: - svc: executor - template: - metadata: - labels: - svc: executor - annotations: - prometheus.io/scrape: "true" - prometheus.io/path: "/metrics" - prometheus.io/port: "8080" - spec: - containers: - - name: executor - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}"] - env: - - name: FETCHER_IMAGE - {{- if eq .Values.fetcher.imageTag "" }} - value: "{{ .Values.fetcher.image }}" - {{- else }} - value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}" - {{- end }} - - name: FETCHER_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: RUNTIME_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: ADOPT_EXISTING_RESOURCES - value: {{ .Values.executor.adoptExistingResources | default false | quote }} - - name: POD_READY_TIMEOUT - value: {{ .Values.executor.podReadyTimeout | default false | quote }} - - name: ENABLE_ISTIO - value: "{{ .Values.enableIstio }}" - - name: FETCHER_MINCPU - value: {{ .Values.fetcher.resource.cpu.requests | quote }} - - name: FETCHER_MINMEM - value: {{ .Values.fetcher.resource.mem.requests | quote }} - - name: FETCHER_MAXCPU - value: {{ .Values.fetcher.resource.cpu.limits | quote }} - - name: FETCHER_MAXMEM - value: {{ .Values.fetcher.resource.mem.limits | quote }} - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - readinessProbe: - httpGet: - path: "/healthz" - port: 8888 - initialDelaySeconds: 1 - periodSeconds: 1 - failureThreshold: 30 - livenessProbe: - httpGet: - path: "/healthz" - port: 8888 - initialDelaySeconds: 35 - periodSeconds: 5 - ports: - - containerPort: 8080 - name: metrics - - containerPort: 8888 - name: http - {{- if .Values.pprof.enabled }} - - containerPort: 6060 - name: pprof - {{- end }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: buildermgr - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: buildermgr -spec: - replicas: 1 - selector: - matchLabels: - svc: buildermgr - template: - metadata: - labels: - svc: buildermgr - spec: - containers: - - name: buildermgr - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"] - env: - - name: FETCHER_IMAGE - {{- if eq .Values.fetcher.imageTag "" }} - value: "{{ .Values.fetcher.image }}" - {{- else }} - value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}" - {{- end }} - - name: FETCHER_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: BUILDER_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: ENABLE_ISTIO - value: "{{ .Values.enableIstio }}" - - name: FETCHER_MINCPU - value: {{ .Values.fetcher.resource.cpu.requests | quote }} - - name: FETCHER_MINMEM - value: {{ .Values.fetcher.resource.mem.requests | quote }} - - name: FETCHER_MAXCPU - value: {{ .Values.fetcher.resource.cpu.limits | quote }} - - name: FETCHER_MAXMEM - value: {{ .Values.fetcher.resource.mem.limits | quote }} - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kubewatcher - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: kubewatcher -spec: - replicas: 1 - selector: - matchLabels: - svc: kubewatcher - template: - metadata: - labels: - svc: kubewatcher - spec: - containers: - - name: kubewatcher - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- if .Values.influxdb.enabled }} ---- -apiVersion: v1 -kind: Service -metadata: - name: influxdb - labels: - svc: influxdb - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: ClusterIP - ports: - - port: 8086 - targetPort: 8086 - selector: - svc: influxdb - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: influxdb - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: influxdb -spec: - replicas: 1 - selector: - matchLabels: - svc: influxdb - template: - metadata: - labels: - svc: influxdb - spec: - containers: - - name: influxdb - image: {{ .Values.influxdb.image | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - env: - - name: INFLUXDB_DB - value: fissionFunctionLog - - name: INFLUXDB_ADMIN_USER - valueFrom: - secretKeyRef: - name: influxdb - key: username - - name: INFLUXDB_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: influxdb - key: password -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} -{{- if .Values.heapster }} ---- -apiVersion: v1 -kind: Service -metadata: - name: heapster - namespace: kube-system - labels: - svc: heapster - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - kubernetes.io/cluster-service: 'true' - kubernetes.io/name: heapster -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 8082 - selector: - svc: heapster ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: heapster - namespace: kube-system - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: heapster -spec: - replicas: 1 - selector: - matchLabels: - svc: heapster - template: - metadata: - labels: - svc: heapster - spec: - containers: - - name: heapster - image: gcr.io/google_containers/heapster-amd64:v1.5.0 - imagePullPolicy: {{ .Values.pullPolicy }} - command: - - /heapster - - --source=kubernetes:https://kubernetes.default - serviceAccountName: {{ .Release.Namespace }}/fission-svc -{{- end }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: timer - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: timer -spec: - replicas: 1 - selector: - matchLabels: - svc: timer - template: - metadata: - labels: - svc: timer - spec: - containers: - - name: timer - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--timer", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - -# -# This is commented out until fission-ui allows configuring the -# namespace. Right now it just crashes if Release.Namespace != -# "fission". -# -#--- -#apiVersion: apps/v1 -#kind: Deployment -#metadata: -# name: fission-ui -# labels: -# chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -#spec: -# replicas: 1 -# template: -# metadata: -# labels: -# svc: fission-ui -# spec: -# containers: -# - name: nginx -# image: {{ .Values.repository }}/{{ .Values.fissionUiImage }} -# imagePullPolicy: {{ .Values.pullPolicy }} -# - name: kubectl-proxy -# image: {{ .Values.repository }}/lachlanevenson/k8s-kubectl -# args: ["proxy", "--port", "8001", "--address", "127.0.0.1"] -# serviceAccountName: fission-svc - -{{- if .Values.nats.enabled }} -{{- if not .Values.nats.external }} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-nats-streaming - namespace: {{ .Release.Namespace }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - svc: nats-streaming - name: nats-streaming -spec: - replicas: 1 - selector: - matchLabels: - svc: nats-streaming - template: - metadata: - labels: - svc: nats-streaming - spec: - serviceAccount: fission-nats-streaming - containers: - - name: nats-streaming - image: {{ .Values.nats.streamingserver.image | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - args: [ - "--cluster_id", "{{ .Values.nats.clusterID }}", - "--auth", "{{ .Values.nats.authToken }}", - "--max_channels", "0", - "--http_port", "4223" - ] - ports: - - containerPort: 4222 - protocol: TCP - - containerPort: 4223 - protocol: TCP - readinessProbe: - httpGet: - path: "/streaming/serverz" - port: 4223 - initialDelaySeconds: 30 - periodSeconds: 1 - failureThreshold: 30 - livenessProbe: - httpGet: - path: "/streaming/serverz" - port: 4223 - initialDelaySeconds: 30 - periodSeconds: 5 -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mqtrigger-nats-streaming - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: mqtrigger - messagequeue: nats-streaming -spec: - replicas: 1 - selector: - matchLabels: - svc: mqtrigger - messagequeue: nats-streaming - template: - metadata: - labels: - svc: mqtrigger - messagequeue: nats-streaming - spec: - containers: - - name: mqtrigger - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: MESSAGE_QUEUE_TYPE - value: nats-streaming - - name: MESSAGE_QUEUE_CLUSTER_ID - value: {{ .Values.nats.clusterID }} - - name: MESSAGE_QUEUE_QUEUE_GROUP - value: {{ .Values.nats.queueGroup }} - - name: MESSAGE_QUEUE_CLIENT_ID - value: {{ .Values.nats.clientID }} - - name: MESSAGE_QUEUE_URL - {{- if .Values.nats.authToken }} - value: nats://{{ .Values.nats.authToken }}@{{ .Values.nats.hostaddress }} - {{- else }} - value: nats://{{ .Values.nats.hostaddress }} - {{- end }} - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} - -{{- if .Values.kafka.enabled }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mqtrigger-kafka - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: mqtrigger - messagequeue: kafka -spec: - replicas: 1 - selector: - matchLabels: - svc: mqtrigger - messagequeue: kafka - template: - metadata: - labels: - svc: mqtrigger - messagequeue: kafka - spec: - containers: - - name: mqtrigger - {{- if eq .Values.imageTag "" }} - image: "{{ .Values.image }}" - {{- else }} - image: "{{ .Values.image }}:{{ .Values.imageTag }}" - {{- end }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: MESSAGE_QUEUE_TYPE - value: kafka - - name: MESSAGE_QUEUE_URL - value: "{{.Values.kafka.brokers}}" - - name: MESSAGE_QUEUE_KAFKA_VERSION - value: "{{.Values.kafka.version}}" - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - # TLS authentication is TLS with authentication (2 way) - # More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview - {{- if .Values.kafka.authentication.tls.enabled }} - - name: TLS_ENABLED - value: "true" - - name: MESSAGE_QUEUE_SECRETS - value: /etc/fission/secrets - - name: INSECURE_SKIP_VERIFY - value: "{{ .Values.kafka.authentication.tls.insecureSkipVerify }}" - volumeMounts: - - name: kafka-secrets - mountPath: /etc/fission/secrets - {{- end }} - serviceAccountName: fission-svc - {{- if .Values.kafka.authentication.tls.enabled }} - volumes: - - name: kafka-secrets - secret: - secretName: mqtrigger-kafka-secrets - {{- end }} - ---- -{{- if .Values.kafka.authentication.tls.enabled }} -apiVersion: v1 -kind: Secret -metadata: - name: mqtrigger-kafka-secrets - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -data: - {{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.caCert) }} - caCert: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.caCert) | b64enc }} - {{- else }} - {{ fail "Invalid chart. CA Certificate not found." }} - {{- end }} - {{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.userCert) }} - userCert: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.userCert) | b64enc }} - {{- else }} - {{ fail "Invalid chart. User Certificate not found." }} - {{- end }} - {{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.userKey) }} - userKey: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.userKey) | b64enc }} - {{- else }} - {{ fail "Invalid chart. User Key not found." }} - {{- end }} -{{- end }} -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} - -{{- if .Values.azureStorageQueue.enabled }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mqtrigger-azure-storage-queue - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: mqtrigger - messagequeue: azure-storage-queue -spec: - replicas: 1 - selector: - matchLabels: - svc: mqtrigger - messagequeue: azure-storage-queue - template: - metadata: - labels: - svc: mqtrigger - messagequeue: azure-storage-queue - spec: - containers: - - name: mqtrigger - {{- if eq .Values.imageTag "" }} - image: "{{ .Values.image }}" - {{- else }} - image: "{{ .Values.image }}:{{ .Values.imageTag }}" - {{- end }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: MESSAGE_QUEUE_TYPE - value: azure-storage-queue - - name: AZURE_STORAGE_ACCOUNT_NAME - value: {{ required "An Azure storage account name is required." .Values.azureStorageQueue.accountName }} - - name: AZURE_STORAGE_ACCOUNT_KEY - valueFrom: - secretKeyRef: - name: azure-storage-account-key - key: key - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: storagesvc - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: storagesvc - application: fission-storage -spec: - replicas: 1 - selector: - matchLabels: - svc: storagesvc - application: fission-storage - template: - metadata: - labels: - svc: storagesvc - application: fission-storage - spec: - containers: - - name: storagesvc - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - {{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }} - args: ["--storageServicePort", "8000", "--storageType", "s3"] - {{- else }} - args: ["--storageServicePort", "8000", "--storageType", "local"] - {{- end }} - env: - - name: PRUNE_INTERVAL - value: "{{.Values.pruneInterval}}" - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: PPROF_ENABLED - value: {{ .Values.pprof.enabled | quote }} - {{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }} - - name: STORAGE_S3_ENDPOINT - value: {{ .Values.persistence.s3.endPoint }} - - name: STORAGE_S3_BUCKET_NAME - value: {{ .Values.persistence.s3.bucketName }} - - name: STORAGE_S3_SUB_DIR - value: {{ .Values.persistence.s3.subDir }} - - name: STORAGE_S3_ACCESS_KEY_ID - value: {{ .Values.persistence.s3.accessKeyId }} - - name: STORAGE_S3_SECRET_ACCESS_KEY - value: {{ .Values.persistence.s3.secretAccessKey }} - - name: STORAGE_S3_REGION - value: {{ .Values.persistence.s3.region }} - {{- end }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - {{- if ne (.Values.persistence.storageType | default "local") "s3" }} - volumeMounts: - - name: fission-storage - mountPath: /fission - {{- end }} - readinessProbe: - httpGet: - path: "/healthz" - port: 8000 - initialDelaySeconds: 1 - periodSeconds: 1 - failureThreshold: 30 - livenessProbe: - httpGet: - path: "/healthz" - port: 8000 - initialDelaySeconds: 35 - periodSeconds: 5 - ports: - - containerPort: 8000 - name: http - {{- if .Values.pprof.enabled }} - - containerPort: 6060 - name: pprof - {{- end }} - serviceAccountName: fission-svc - {{- if and (.Values.persistence.enabled) (ne (.Values.persistence.storageType | default "local") "s3") }} - volumes: - - name: fission-storage - persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim | default "fission-storage-pvc" }} - {{- else }} - volumes: - - name: fission-storage - emptyDir: {} - {{- end }} -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - -{{- if .Values.mqt_keda.enabled }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mqtrigger-keda - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: mqtrigger-keda - messagequeue: keda -spec: - replicas: 1 - selector: - matchLabels: - svc: mqtrigger-keda - messagequeue: keda - template: - metadata: - labels: - svc: mqtrigger-keda - messagequeue: keda - spec: - containers: - - name: mqtrigger-keda - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--mqt_keda", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: CONNECTOR_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: KAFKA_IMAGE - value: "{{ .Values.mqt_keda.connector_images.kafka.image }}:{{ .Values.mqt_keda.connector_images.kafka.tag }}" - - name: RABBITMQ_IMAGE - value: "{{ .Values.mqt_keda.connector_images.rabbitmq.image }}:{{ .Values.mqt_keda.connector_images.rabbitmq.tag }}" - - name: AWS-KINESIS-STREAM_IMAGE - value: "{{ .Values.mqt_keda.connector_images.awskinesis.image }}:{{ .Values.mqt_keda.connector_images.awskinesis.tag }}" - - name: AWS-SQS-QUEUE_IMAGE - value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}" - - name: STAN_IMAGE - value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}" - - name: GCP-PUB-SUB_IMAGE - value: "{{ .Values.mqt_keda.connector_images.gcp_pub_sub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pub_sub.tag }}" - - name: REDIS_IMAGE - value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}" - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - namespace: {{ .Values.functionNamespace }} - name: event-fetcher -rules: -- apiGroups: [""] # "" indicates the core API group - resources: ["pods"] - verbs: ["get", "watch", "list"] -- apiGroups: [""] # "" indicates the core API group - resources: ["events"] - verbs: ["*"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: fission-fetcher-pod-reader - namespace: {{ .Values.functionNamespace }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: event-fetcher -subjects: -- kind: ServiceAccount - name: fission-fetcher - namespace: {{ .Values.functionNamespace }} diff --git a/charts/fission-all/templates/executor/deployment.yaml b/charts/fission-all/templates/executor/deployment.yaml new file mode 100644 index 00000000..c392338c --- /dev/null +++ b/charts/fission-all/templates/executor/deployment.yaml @@ -0,0 +1,84 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: executor + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: executor +spec: + replicas: 1 + selector: + matchLabels: + svc: executor + template: + metadata: + labels: + svc: executor + annotations: + prometheus.io/scrape: "true" + prometheus.io/path: "/metrics" + prometheus.io/port: "8080" + spec: + containers: + - name: executor + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}"] + env: + - name: FETCHER_IMAGE + {{- if eq .Values.fetcher.imageTag "" }} + value: "{{ .Values.fetcher.image }}" + {{- else }} + value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}" + {{- end }} + - name: FETCHER_IMAGE_PULL_POLICY + value: "{{ .Values.pullPolicy }}" + - name: RUNTIME_IMAGE_PULL_POLICY + value: "{{ .Values.pullPolicy }}" + - name: ADOPT_EXISTING_RESOURCES + value: {{ .Values.executor.adoptExistingResources | default false | quote }} + - name: POD_READY_TIMEOUT + value: {{ .Values.executor.podReadyTimeout | default false | quote }} + - name: ENABLE_ISTIO + value: "{{ .Values.enableIstio }}" + - name: FETCHER_MINCPU + value: {{ .Values.fetcher.resource.cpu.requests | quote }} + - name: FETCHER_MINMEM + value: {{ .Values.fetcher.resource.mem.requests | quote }} + - name: FETCHER_MAXCPU + value: {{ .Values.fetcher.resource.cpu.limits | quote }} + - name: FETCHER_MAXMEM + value: {{ .Values.fetcher.resource.mem.limits | quote }} + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + readinessProbe: + httpGet: + path: "/healthz" + port: 8888 + initialDelaySeconds: 1 + periodSeconds: 1 + failureThreshold: 30 + livenessProbe: + httpGet: + path: "/healthz" + port: 8888 + initialDelaySeconds: 35 + periodSeconds: 5 + ports: + - containerPort: 8080 + name: metrics + - containerPort: 8888 + name: http + {{- if .Values.pprof.enabled }} + - containerPort: 6060 + name: pprof + {{- end }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/executor/svc.yaml b/charts/fission-all/templates/executor/svc.yaml new file mode 100644 index 00000000..6b35260b --- /dev/null +++ b/charts/fission-all/templates/executor/svc.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: executor + labels: + svc: executor + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 8888 + selector: + svc: executor diff --git a/charts/fission-all/templates/fission-ui/deployment.yaml b/charts/fission-all/templates/fission-ui/deployment.yaml new file mode 100644 index 00000000..794bfa25 --- /dev/null +++ b/charts/fission-all/templates/fission-ui/deployment.yaml @@ -0,0 +1,29 @@ +{{- if .Values.fissionUiImage }} +# +# This is commented out until fission-ui allows configuring the +# namespace. Right now it just crashes if Release.Namespace != +# "fission". +# +#--- +#apiVersion: apps/v1 +#kind: Deployment +#metadata: +# name: fission-ui +# labels: +# chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +#spec: +# replicas: 1 +# template: +# metadata: +# labels: +# svc: fission-ui +# spec: +# containers: +# - name: nginx +# image: {{ .Values.repository }}/{{ .Values.fissionUiImage }} +# imagePullPolicy: {{ .Values.pullPolicy }} +# - name: kubectl-proxy +# image: {{ .Values.repository }}/lachlanevenson/k8s-kubectl +# args: ["proxy", "--port", "8001", "--address", "127.0.0.1"] +# serviceAccountName: fission-svc +{{- end}} \ No newline at end of file diff --git a/charts/fission-all/templates/fluentbit.yaml b/charts/fission-all/templates/fluentbit/fluentbit.yaml similarity index 99% rename from charts/fission-all/templates/fluentbit.yaml rename to charts/fission-all/templates/fluentbit/fluentbit.yaml index ce917126..2e7a5b5a 100644 --- a/charts/fission-all/templates/fluentbit.yaml +++ b/charts/fission-all/templates/fluentbit/fluentbit.yaml @@ -1,3 +1,4 @@ +{{- if .Values.influxdb.enabled }} # Fluentbit deployment for Fission # # Requires: @@ -190,3 +191,4 @@ spec: name: {{ .Release.Name }}-fission-fluentbit updateStrategy: type: RollingUpdate +{{- end }} diff --git a/charts/fission-all/templates/heapster/deployment.yaml b/charts/fission-all/templates/heapster/deployment.yaml new file mode 100644 index 00000000..b4bd832d --- /dev/null +++ b/charts/fission-all/templates/heapster/deployment.yaml @@ -0,0 +1,46 @@ +{{- if .Values.heapster }} +apiVersion: v1 +kind: Service +metadata: + name: heapster + namespace: kube-system + labels: + svc: heapster + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + kubernetes.io/cluster-service: 'true' + kubernetes.io/name: heapster +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 8082 + selector: + svc: heapster +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: heapster + namespace: kube-system + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: heapster +spec: + replicas: 1 + selector: + matchLabels: + svc: heapster + template: + metadata: + labels: + svc: heapster + spec: + containers: + - name: heapster + image: gcr.io/google_containers/heapster-amd64:v1.5.0 + imagePullPolicy: {{ .Values.pullPolicy }} + command: + - /heapster + - --source=kubernetes:https://kubernetes.default + serviceAccountName: {{ .Release.Namespace }}/fission-svc +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/influxdb/deployment.yaml b/charts/fission-all/templates/influxdb/deployment.yaml new file mode 100644 index 00000000..a3f36d2d --- /dev/null +++ b/charts/fission-all/templates/influxdb/deployment.yaml @@ -0,0 +1,55 @@ +{{- if .Values.influxdb.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: influxdb + labels: + svc: influxdb + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + type: ClusterIP + ports: + - port: 8086 + targetPort: 8086 + selector: + svc: influxdb + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: influxdb + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: influxdb +spec: + replicas: 1 + selector: + matchLabels: + svc: influxdb + template: + metadata: + labels: + svc: influxdb + spec: + containers: + - name: influxdb + image: {{ .Values.influxdb.image | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + env: + - name: INFLUXDB_DB + value: fissionFunctionLog + - name: INFLUXDB_ADMIN_USER + valueFrom: + secretKeyRef: + name: influxdb + key: username + - name: INFLUXDB_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: influxdb + key: password +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/influxdb/secret.yaml b/charts/fission-all/templates/influxdb/secret.yaml new file mode 100644 index 00000000..42d552e6 --- /dev/null +++ b/charts/fission-all/templates/influxdb/secret.yaml @@ -0,0 +1,12 @@ +{{- if .Values.influxdb.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: influxdb + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +type: Opaque +data: + username: {{ .Values.logger.influxdbAdmin | b64enc | quote }} + password: {{ randAlphaNum 20 | b64enc | quote }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/kubewatcher/deployment.yaml b/charts/fission-all/templates/kubewatcher/deployment.yaml new file mode 100644 index 00000000..ed67a712 --- /dev/null +++ b/charts/fission-all/templates/kubewatcher/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kubewatcher + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: kubewatcher +spec: + replicas: 1 + selector: + matchLabels: + svc: kubewatcher + template: + metadata: + labels: + svc: kubewatcher + spec: + containers: + - name: kubewatcher + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"] + env: + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} diff --git a/charts/fission-all/templates/misc-functions/clusterrole.yaml b/charts/fission-all/templates/misc-functions/clusterrole.yaml new file mode 100644 index 00000000..5bb4ec5d --- /dev/null +++ b/charts/fission-all/templates/misc-functions/clusterrole.yaml @@ -0,0 +1,33 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: secret-configmap-getter +rules: + - apiGroups: + - "*" + resources: + - secrets + - configmaps + verbs: + - get + - watch + - list + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: package-getter +rules: + - apiGroups: + - "*" + resources: + - packages + verbs: + - "*" + - apiGroups: + - rbac.authorization.k8s.io + resources: + - rolebindings + verbs: + - "*" diff --git a/charts/fission-all/templates/misc-functions/namespace.yaml b/charts/fission-all/templates/misc-functions/namespace.yaml new file mode 100644 index 00000000..61a5f6bb --- /dev/null +++ b/charts/fission-all/templates/misc-functions/namespace.yaml @@ -0,0 +1,24 @@ +{{- if .Values.createNamespace }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.functionNamespace }} + labels: + name: fission-function + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + {{- if .Values.enableIstio }} + istio-injection: enabled + {{- end }} + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.builderNamespace }} + labels: + name: fission-builder + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + {{- if .Values.enableIstio }} + istio-injection: enabled + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/misc-functions/role.yaml b/charts/fission-all/templates/misc-functions/role.yaml new file mode 100644 index 00000000..639a1055 --- /dev/null +++ b/charts/fission-all/templates/misc-functions/role.yaml @@ -0,0 +1,70 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: fission-fetcher + namespace: default +rules: + - apiGroups: + - "" + resources: + - configmaps + - secrets + - pods + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - events + verbs: + - "*" + - apiGroups: + - fission.io + resources: + - canaryconfigs + - environments + - functions + - httptriggers + - kuberneteswatchtriggers + - messagequeuetriggers + - packages + - timetriggers + verbs: + - "*" + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: fission-builder + namespace: default +rules: + - apiGroups: + - fission.io + resources: + - canaryconfigs + - environments + - functions + - httptriggers + - kuberneteswatchtriggers + - messagequeuetriggers + - packages + - timetriggers + verbs: + - "*" + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + namespace: {{ .Values.functionNamespace }} + name: event-fetcher +rules: + - apiGroups: [""] # "" indicates the core API group + resources: ["pods"] + verbs: ["get", "watch", "list"] + - apiGroups: [""] # "" indicates the core API group + resources: ["events"] + verbs: ["*"] diff --git a/charts/fission-all/templates/misc-functions/rolebinding.yaml b/charts/fission-all/templates/misc-functions/rolebinding.yaml new file mode 100644 index 00000000..0675bfc4 --- /dev/null +++ b/charts/fission-all/templates/misc-functions/rolebinding.yaml @@ -0,0 +1,43 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: fission-fetcher + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: fission-fetcher +subjects: + - kind: ServiceAccount + name: fission-fetcher + namespace: {{ .Values.functionNamespace }} + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: fission-builder + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: fission-builder +subjects: + - kind: ServiceAccount + name: fission-builder + namespace: {{ .Values.builderNamespace }} + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: fission-fetcher-pod-reader + namespace: {{ .Values.functionNamespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: event-fetcher +subjects: + - kind: ServiceAccount + name: fission-fetcher + namespace: {{ .Values.functionNamespace }} diff --git a/charts/fission-all/templates/misc-functions/serviceaccount.yaml b/charts/fission-all/templates/misc-functions/serviceaccount.yaml new file mode 100644 index 00000000..6a550352 --- /dev/null +++ b/charts/fission-all/templates/misc-functions/serviceaccount.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: fission-fetcher + namespace: {{ .Values.functionNamespace }} + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: fission-builder + namespace: {{ .Values.builderNamespace }} diff --git a/charts/fission-all/templates/mqt-fission-azurestoragequeue/deployment.yaml b/charts/fission-all/templates/mqt-fission-azurestoragequeue/deployment.yaml new file mode 100644 index 00000000..35c0a55d --- /dev/null +++ b/charts/fission-all/templates/mqt-fission-azurestoragequeue/deployment.yaml @@ -0,0 +1,52 @@ +{{- if .Values.azureStorageQueue.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mqtrigger-azure-storage-queue + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: mqtrigger + messagequeue: azure-storage-queue +spec: + replicas: 1 + selector: + matchLabels: + svc: mqtrigger + messagequeue: azure-storage-queue + template: + metadata: + labels: + svc: mqtrigger + messagequeue: azure-storage-queue + spec: + containers: + - name: mqtrigger + {{- if eq .Values.imageTag "" }} + image: "{{ .Values.image }}" + {{- else }} + image: "{{ .Values.image }}:{{ .Values.imageTag }}" + {{- end }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"] + env: + - name: MESSAGE_QUEUE_TYPE + value: azure-storage-queue + - name: AZURE_STORAGE_ACCOUNT_NAME + value: {{ required "An Azure storage account name is required." .Values.azureStorageQueue.accountName }} + - name: AZURE_STORAGE_ACCOUNT_KEY + valueFrom: + secretKeyRef: + name: azure-storage-account-key + key: key + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/secrets.yaml b/charts/fission-all/templates/mqt-fission-azurestoragequeue/secret.yaml similarity index 55% rename from charts/fission-all/templates/secrets.yaml rename to charts/fission-all/templates/mqt-fission-azurestoragequeue/secret.yaml index 1a752c47..78adbfb1 100644 --- a/charts/fission-all/templates/secrets.yaml +++ b/charts/fission-all/templates/mqt-fission-azurestoragequeue/secret.yaml @@ -1,16 +1,4 @@ -apiVersion: v1 -kind: Secret -metadata: - name: influxdb - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -type: Opaque -data: - username: {{ .Values.logger.influxdbAdmin | b64enc | quote }} - password: {{ randAlphaNum 20 | b64enc | quote }} - {{- if .Values.azureStorageQueue.enabled }} ---- apiVersion: v1 kind: Secret metadata: diff --git a/charts/fission-all/templates/mqt-fission-kafka/deployment.yaml b/charts/fission-all/templates/mqt-fission-kafka/deployment.yaml new file mode 100644 index 00000000..406cc054 --- /dev/null +++ b/charts/fission-all/templates/mqt-fission-kafka/deployment.yaml @@ -0,0 +1,94 @@ +{{- if .Values.kafka.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mqtrigger-kafka + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: mqtrigger + messagequeue: kafka +spec: + replicas: 1 + selector: + matchLabels: + svc: mqtrigger + messagequeue: kafka + template: + metadata: + labels: + svc: mqtrigger + messagequeue: kafka + spec: + containers: + - name: mqtrigger + {{- if eq .Values.imageTag "" }} + image: "{{ .Values.image }}" + {{- else }} + image: "{{ .Values.image }}:{{ .Values.imageTag }}" + {{- end }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"] + env: + - name: MESSAGE_QUEUE_TYPE + value: kafka + - name: MESSAGE_QUEUE_URL + value: "{{.Values.kafka.brokers}}" + - name: MESSAGE_QUEUE_KAFKA_VERSION + value: "{{.Values.kafka.version}}" + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + # TLS authentication is TLS with authentication (2 way) + # More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview + {{- if .Values.kafka.authentication.tls.enabled }} + - name: TLS_ENABLED + value: "true" + - name: MESSAGE_QUEUE_SECRETS + value: /etc/fission/secrets + - name: INSECURE_SKIP_VERIFY + value: "{{ .Values.kafka.authentication.tls.insecureSkipVerify }}" + volumeMounts: + - name: kafka-secrets + mountPath: /etc/fission/secrets + {{- end }} + serviceAccountName: fission-svc + {{- if .Values.kafka.authentication.tls.enabled }} + volumes: + - name: kafka-secrets + secret: + secretName: mqtrigger-kafka-secrets + {{- end }} + +--- +{{- if .Values.kafka.authentication.tls.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: mqtrigger-kafka-secrets + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +data: + {{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.caCert) }} + caCert: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.caCert) | b64enc }} + {{- else }} + {{ fail "Invalid chart. CA Certificate not found." }} + {{- end }} + {{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.userCert) }} + userCert: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.userCert) | b64enc }} + {{- else }} + {{ fail "Invalid chart. User Certificate not found." }} + {{- end }} + {{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.userKey) }} + userKey: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.userKey) | b64enc }} + {{- else }} + {{ fail "Invalid chart. User Key not found." }} + {{- end }} +{{- end }} +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/mqt-fission-nats/deployment.yaml b/charts/fission-all/templates/mqt-fission-nats/deployment.yaml new file mode 100644 index 00000000..2748d29e --- /dev/null +++ b/charts/fission-all/templates/mqt-fission-nats/deployment.yaml @@ -0,0 +1,110 @@ +{{- if .Values.nats.enabled }} +{{- if not .Values.nats.external }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: fission-nats-streaming + namespace: {{ .Release.Namespace }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + svc: nats-streaming + name: nats-streaming +spec: + replicas: 1 + selector: + matchLabels: + svc: nats-streaming + template: + metadata: + labels: + svc: nats-streaming + spec: + serviceAccount: fission-nats-streaming + containers: + - name: nats-streaming + image: {{ .Values.nats.streamingserver.image | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + args: [ + "--cluster_id", "{{ .Values.nats.clusterID }}", + "--auth", "{{ .Values.nats.authToken }}", + "--max_channels", "0", + "--http_port", "4223" + ] + ports: + - containerPort: 4222 + protocol: TCP + - containerPort: 4223 + protocol: TCP + readinessProbe: + httpGet: + path: "/streaming/serverz" + port: 4223 + initialDelaySeconds: 30 + periodSeconds: 1 + failureThreshold: 30 + livenessProbe: + httpGet: + path: "/streaming/serverz" + port: 4223 + initialDelaySeconds: 30 + periodSeconds: 5 +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} +--- +{{- end }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mqtrigger-nats-streaming + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: mqtrigger + messagequeue: nats-streaming +spec: + replicas: 1 + selector: + matchLabels: + svc: mqtrigger + messagequeue: nats-streaming + template: + metadata: + labels: + svc: mqtrigger + messagequeue: nats-streaming + spec: + containers: + - name: mqtrigger + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"] + env: + - name: MESSAGE_QUEUE_TYPE + value: nats-streaming + - name: MESSAGE_QUEUE_CLUSTER_ID + value: {{ .Values.nats.clusterID }} + - name: MESSAGE_QUEUE_QUEUE_GROUP + value: {{ .Values.nats.queueGroup }} + - name: MESSAGE_QUEUE_CLIENT_ID + value: {{ .Values.nats.clientID }} + - name: MESSAGE_QUEUE_URL + {{- if .Values.nats.authToken }} + value: nats://{{ .Values.nats.authToken }}@{{ .Values.nats.hostaddress }} + {{- else }} + value: nats://{{ .Values.nats.hostaddress }} + {{- end }} + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/mqt-fission-nats/svc.yaml b/charts/fission-all/templates/mqt-fission-nats/svc.yaml new file mode 100644 index 00000000..5129f43f --- /dev/null +++ b/charts/fission-all/templates/mqt-fission-nats/svc.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.nats.enabled (not .Values.nats.external) }} +apiVersion: v1 +kind: Service +metadata: + name: nats-streaming + labels: + svc: nats-streaming + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + type: {{ .Values.serviceType }} + ports: + - port: 4222 + targetPort: 4222 +{{- if eq .Values.serviceType "NodePort" }} + nodePort: {{ .Values.natsStreamingPort }} +{{- end }} + selector: + svc: nats-streaming +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/mqt-keda/deployment.yaml b/charts/fission-all/templates/mqt-keda/deployment.yaml new file mode 100644 index 00000000..61c3b847 --- /dev/null +++ b/charts/fission-all/templates/mqt-keda/deployment.yaml @@ -0,0 +1,53 @@ +{{- if .Values.mqt_keda.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mqtrigger-keda + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: mqtrigger-keda + messagequeue: keda +spec: + replicas: 1 + selector: + matchLabels: + svc: mqtrigger-keda + messagequeue: keda + template: + metadata: + labels: + svc: mqtrigger-keda + messagequeue: keda + spec: + containers: + - name: mqtrigger-keda + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--mqt_keda", "--routerUrl", "http://router.{{ .Release.Namespace }}"] + env: + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: CONNECTOR_IMAGE_PULL_POLICY + value: "{{ .Values.pullPolicy }}" + - name: KAFKA_IMAGE + value: "{{ .Values.mqt_keda.connector_images.kafka.image }}:{{ .Values.mqt_keda.connector_images.kafka.tag }}" + - name: RABBITMQ_IMAGE + value: "{{ .Values.mqt_keda.connector_images.rabbitmq.image }}:{{ .Values.mqt_keda.connector_images.rabbitmq.tag }}" + - name: AWS-KINESIS-STREAM_IMAGE + value: "{{ .Values.mqt_keda.connector_images.awskinesis.image }}:{{ .Values.mqt_keda.connector_images.awskinesis.tag }}" + - name: AWS-SQS-QUEUE_IMAGE + value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}" + - name: STAN_IMAGE + value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}" + - name: GCP-PUB-SUB_IMAGE + value: "{{ .Values.mqt_keda.connector_images.gcp_pub_sub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pub_sub.tag }}" + - name: REDIS_IMAGE + value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}" + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/templates/pre-upgrade-job.yaml b/charts/fission-all/templates/pre-upgrade-checks/pre-upgrade-job.yaml similarity index 100% rename from charts/fission-all/templates/pre-upgrade-job.yaml rename to charts/fission-all/templates/pre-upgrade-checks/pre-upgrade-job.yaml diff --git a/charts/fission-all/templates/router.yaml b/charts/fission-all/templates/router/deployment.yaml similarity index 100% rename from charts/fission-all/templates/router.yaml rename to charts/fission-all/templates/router/deployment.yaml diff --git a/charts/fission-all/templates/router/svc.yaml b/charts/fission-all/templates/router/svc.yaml new file mode 100644 index 00000000..b0f516aa --- /dev/null +++ b/charts/fission-all/templates/router/svc.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: router + labels: + svc: router + application: fission-router + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +{{- if .Values.router.svcAnnotations }} + annotations: +{{ toYaml .Values.router.svcAnnotations | indent 4 }} +{{- end }} +spec: + type: {{ .Values.routerServiceType }} + ports: + - port: 80 + targetPort: 8888 +{{- if eq .Values.routerServiceType "NodePort" }} + nodePort: {{ .Values.routerPort }} +{{- end }} + selector: + svc: router \ No newline at end of file diff --git a/charts/fission-all/templates/storagesvc/deployment.yaml b/charts/fission-all/templates/storagesvc/deployment.yaml new file mode 100644 index 00000000..6aab88a4 --- /dev/null +++ b/charts/fission-all/templates/storagesvc/deployment.yaml @@ -0,0 +1,92 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: storagesvc + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: storagesvc + application: fission-storage +spec: + replicas: 1 + selector: + matchLabels: + svc: storagesvc + application: fission-storage + template: + metadata: + labels: + svc: storagesvc + application: fission-storage + spec: + containers: + - name: storagesvc + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + {{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }} + args: ["--storageServicePort", "8000", "--storageType", "s3"] + {{- else }} + args: ["--storageServicePort", "8000", "--storageType", "local"] + {{- end }} + env: + - name: PRUNE_INTERVAL + value: "{{.Values.pruneInterval}}" + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }} + - name: STORAGE_S3_ENDPOINT + value: {{ .Values.persistence.s3.endPoint }} + - name: STORAGE_S3_BUCKET_NAME + value: {{ .Values.persistence.s3.bucketName }} + - name: STORAGE_S3_SUB_DIR + value: {{ .Values.persistence.s3.subDir }} + - name: STORAGE_S3_ACCESS_KEY_ID + value: {{ .Values.persistence.s3.accessKeyId }} + - name: STORAGE_S3_SECRET_ACCESS_KEY + value: {{ .Values.persistence.s3.secretAccessKey }} + - name: STORAGE_S3_REGION + value: {{ .Values.persistence.s3.region }} + {{- end }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + {{- if ne (.Values.persistence.storageType | default "local") "s3" }} + volumeMounts: + - name: fission-storage + mountPath: /fission + {{- end }} + readinessProbe: + httpGet: + path: "/healthz" + port: 8000 + initialDelaySeconds: 1 + periodSeconds: 1 + failureThreshold: 30 + livenessProbe: + httpGet: + path: "/healthz" + port: 8000 + initialDelaySeconds: 35 + periodSeconds: 5 + ports: + - containerPort: 8000 + name: http + {{- if .Values.pprof.enabled }} + - containerPort: 6060 + name: pprof + {{- end }} + serviceAccountName: fission-svc + {{- if and (.Values.persistence.enabled) (ne (.Values.persistence.storageType | default "local") "s3") }} + volumes: + - name: fission-storage + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default "fission-storage-pvc" }} + {{- else }} + volumes: + - name: fission-storage + emptyDir: {} + {{- end }} +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} diff --git a/charts/fission-all/templates/pvc.yaml b/charts/fission-all/templates/storagesvc/pvc.yaml similarity index 100% rename from charts/fission-all/templates/pvc.yaml rename to charts/fission-all/templates/storagesvc/pvc.yaml diff --git a/charts/fission-all/templates/storagesvc/svc.yaml b/charts/fission-all/templates/storagesvc/svc.yaml new file mode 100644 index 00000000..bff35fe8 --- /dev/null +++ b/charts/fission-all/templates/storagesvc/svc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: storagesvc + labels: + svc: storagesvc + application: fission-storage + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 8000 + selector: + svc: storagesvc diff --git a/charts/fission-all/templates/svc.yaml b/charts/fission-all/templates/svc.yaml deleted file mode 100644 index 28b1e709..00000000 --- a/charts/fission-all/templates/svc.yaml +++ /dev/null @@ -1,95 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: router - labels: - svc: router - application: fission-router - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -{{- if .Values.router.svcAnnotations }} - annotations: -{{ toYaml .Values.router.svcAnnotations | indent 4 }} -{{- end }} -spec: - type: {{ .Values.routerServiceType }} - ports: - - port: 80 - targetPort: 8888 -{{- if eq .Values.routerServiceType "NodePort" }} - nodePort: {{ .Values.routerPort }} -{{- end }} - selector: - svc: router - ---- -apiVersion: v1 -kind: Service -metadata: - name: controller - labels: - svc: controller - application: fission-api - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: {{ .Values.serviceType }} - ports: - - port: 80 - targetPort: 8888 -{{- if eq .Values.serviceType "NodePort" }} - nodePort: {{ .Values.controllerPort }} -{{- end }} - selector: - svc: controller - -{{- if and .Values.nats.enabled (not .Values.nats.external) }} ---- -apiVersion: v1 -kind: Service -metadata: - name: nats-streaming - labels: - svc: nats-streaming - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: {{ .Values.serviceType }} - ports: - - port: 4222 - targetPort: 4222 -{{- if eq .Values.serviceType "NodePort" }} - nodePort: {{ .Values.natsStreamingPort }} -{{- end }} - selector: - svc: nats-streaming -{{- end }} ---- -apiVersion: v1 -kind: Service -metadata: - name: storagesvc - labels: - svc: storagesvc - application: fission-storage - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 8000 - selector: - svc: storagesvc - ---- -apiVersion: v1 -kind: Service -metadata: - name: executor - labels: - svc: executor - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 8888 - selector: - svc: executor diff --git a/charts/fission-all/templates/timer/deployment.yaml b/charts/fission-all/templates/timer/deployment.yaml new file mode 100644 index 00000000..bb14b8aa --- /dev/null +++ b/charts/fission-all/templates/timer/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: timer + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + svc: timer +spec: + replicas: 1 + selector: + matchLabels: + svc: timer + template: + metadata: + labels: + svc: timer + spec: + containers: + - name: timer + image: {{ include "fission-bundleImage" . | quote }} + imagePullPolicy: {{ .Values.pullPolicy }} + command: ["/fission-bundle"] + args: ["--timer", "--routerUrl", "http://router.{{ .Release.Namespace }}"] + env: + - name: DEBUG_ENV + value: {{ .Values.debugEnv | quote }} + - name: PPROF_ENABLED + value: {{ .Values.pprof.enabled | quote }} + {{- include "opentracing.envs" . | indent 8 }} + {{- include "opentelemtry.envs" . | indent 8 }} + serviceAccountName: fission-svc +{{- if .Values.extraCoreComponentPodConfig }} +{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} +{{- end }} \ No newline at end of file diff --git a/charts/fission-all/values.yaml b/charts/fission-all/values.yaml index 4984532a..45461f14 100644 --- a/charts/fission-all/values.yaml +++ b/charts/fission-all/values.yaml @@ -16,22 +16,18 @@ repository: index.docker.io ## Fission image repository image: fission/fission-bundle -## Image pull policy -pullPolicy: IfNotPresent - ## Fission image version imageTag: v1.15.0-rc1 +## Image pull policy +pullPolicy: IfNotPresent + ## Port at which Fission controller service should be exposed controllerPort: 31313 ## Port at which Fission router service should be exposed routerPort: 31314 -## Port at which NATS streaming service should be exposed -## (only if nats enabled and not external) -natsStreamingPort: 31316 - ## Set to false if you create the namespaces manually createNamespace: true @@ -63,31 +59,6 @@ fetcher: requests: "16Mi" limits: "" -## Logger config -logger: - influxdbAdmin: "admin" - fluentdImageRepository: index.docker.io - fluentdImage: fluent/fluent-bit - fluentdImageTag: 1.5.1 - - ## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked - ## files and a state of offsets, this is very useful to resume a state if the ser- - ## vice is restarted. For Kubernetes environment with constraints like OpenShift, - ## the containers are limited to write hostPath volume. Hence, we have to enable - ## security context and set privileged to true. - enableSecurityContext: false - - ## Enable PodSecurityPolicies to allow privileged container - ## Only required in some clusters and when enableSecurityContext is true - podSecurityPolicy: - enabled: false - - ## Configure additional capabilities - additionalCapabilities: - # example values for linkerd - #- NET_RAW - #- NET_ADMIN - executor: adoptExistingResources: false podReadyTimeout: 300s @@ -173,7 +144,7 @@ router: ### NATS Streaming, enabled by default nats: # whether or not to use NATS - enabled: true + enabled: false # if true, don't install NATS, but external: false @@ -198,6 +169,10 @@ nats: streamingserver: image: nats-streaming +## Port at which NATS streaming service should be exposed +## (only if nats enabled and not external) +natsStreamingPort: 31316 + ## Azure-storage-queue: enable and configure the details azureStorageQueue: enabled: false @@ -303,9 +278,35 @@ gaTrackingID: UA-196546703-1 ## Enable Heapster only in clusters where heapster does not exist already heapster: false +## Logger config +## This would be used if influxdb is enabled +logger: + influxdbAdmin: "admin" + fluentdImageRepository: index.docker.io + fluentdImage: fluent/fluent-bit + fluentdImageTag: 1.5.1 + + ## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked + ## files and a state of offsets, this is very useful to resume a state if the ser- + ## vice is restarted. For Kubernetes environment with constraints like OpenShift, + ## the containers are limited to write hostPath volume. Hence, we have to enable + ## security context and set privileged to true. + enableSecurityContext: false + + ## Enable PodSecurityPolicies to allow privileged container + ## Only required in some clusters and when enableSecurityContext is true + podSecurityPolicy: + enabled: false + + ## Configure additional capabilities + additionalCapabilities: + # example values for linkerd + #- NET_RAW + #- NET_ADMIN + ## Enable InfluxDB influxdb: - enabled: true + enabled: false image: influxdb:1.7 # Allow user to override busybox image used in fluent-bit init container @@ -329,7 +330,7 @@ debugEnv: false ## Prometheus for scrapping service metrics prometheus: ## set this flag to true if prometheus needs to be deployed along with fission - enabled: true + enabled: false ## If enabled is false, please assign the prometheus service URL ## that is accessible by components. @@ -337,7 +338,7 @@ prometheus: ## set this flag to false if you dont need canary deployment feature canaryDeployment: - enabled: true + enabled: false # Use the following flags to enable OpenTracing. # Note: OpenTracing support will be removed in an upcoming release. diff --git a/charts/fission-core/.helmignore b/charts/fission-core/.helmignore deleted file mode 100644 index f0c13194..00000000 --- a/charts/fission-core/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/charts/fission-core/Chart.lock b/charts/fission-core/Chart.lock deleted file mode 100644 index c601838e..00000000 --- a/charts/fission-core/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: prometheus - repository: https://prometheus-community.github.io/helm-charts - version: 13.2.1 -digest: sha256:136360a97bdc11f1933d75bab77728acc75dd9583257b973cb3336b6d136c9b6 -generated: "2021-05-31T21:04:26.076006+05:30" diff --git a/charts/fission-core/Chart.yaml b/charts/fission-core/Chart.yaml deleted file mode 100644 index 8bff63ab..00000000 --- a/charts/fission-core/Chart.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v2 -name: fission-core -version: v1.15.0-rc1 -description: Fission is a fast serverless framework for Kubernetes. -keywords: -- fission -- serverless -home: https://fission.io/ -maintainers: - - name: Vishal Biyani - email: vishal@infracloud.io - - name: Sanket Sudake - email: sanket@infracloud.io -engine: gotpl -appVersion: v1.15.0-rc1 -type: application -dependencies: - - name: prometheus - version: 13.2.1 - repository: https://prometheus-community.github.io/helm-charts - condition: prometheus.enabled \ No newline at end of file diff --git a/charts/fission-core/LICENSE b/charts/fission-core/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/charts/fission-core/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. diff --git a/charts/fission-core/templates/NOTES.txt b/charts/fission-core/templates/NOTES.txt deleted file mode 100644 index 77ffa780..00000000 --- a/charts/fission-core/templates/NOTES.txt +++ /dev/null @@ -1,25 +0,0 @@ -1. Install the client CLI. - -Mac: - $ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-darwin-amd64 && chmod +x fission && sudo mv fission /usr/local/bin/ - -Linux: - $ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-linux-amd64 && chmod +x fission && sudo mv fission /usr/local/bin/ - -Windows: - For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-{{ .Chart.Version }}-windows-amd64.exe - -2. You're ready to use Fission! - - # Create an environment - $ fission env create --name nodejs --image fission/node-env - - # Get a hello world - $ curl https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js > hello.js - - # Register this function with Fission - $ fission function create --name hello --env nodejs --code hello.js - - # Run this function - $ fission function test --name hello - Hello, world! diff --git a/charts/fission-core/templates/_helpers.tpl b/charts/fission-core/templates/_helpers.tpl deleted file mode 100644 index 025bcbc2..00000000 --- a/charts/fission-core/templates/_helpers.tpl +++ /dev/null @@ -1,70 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} -{{- end -}} - -{{/* -This is a template with config parameters for optional features in fission. This gets mounted on to the controller pod -as a config map. -To add new features with config parameters, create a yaml block below with the feature name and define a corresponding struct in -controller/config.go -*/}} -{{- define "config" -}} -canary: - enabled: {{ .Values.canaryDeployment.enabled }} - {{- if .Values.prometheus.enabled }} - prometheusSvc: "http://{{ .Release.Name }}-prometheus-server.{{ .Release.Namespace }}" - {{- else }} - prometheusSvc: {{ .Values.prometheus.serviceEndpoint | default "" | quote }} - {{- end }} - {{- printf "\n" -}} -{{- end -}} - -{{/* -This template generates the image name for the deployment depending on the value of "repository" field in values.yaml file. -*/}} -{{- define "fission-bundleImage" -}} -{{- if .Values.repository -}} - {{ .Values.repository }}/{{ .Values.image }}:{{ .Values.imageTag }} -{{- else -}} - {{ .Values.image }}:{{ .Values.imageTag }} -{{- end }} -{{- end -}} - -{{- define "opentelemtry.envs" }} -- name: OTEL_EXPORTER_OTLP_ENDPOINT - value: "{{ .Values.openTelemetry.otlpCollectorEndpoint }}" -- name: OTEL_EXPORTER_OTLP_INSECURE - value: "{{ .Values.openTelemetry.otlpInsecure }}" -{{- if .Values.openTelemetry.otlpHeaders }} -- name: OTEL_EXPORTER_OTLP_HEADERS - value: "{{ .Values.openTelemetry.otlpHeaders }}" -{{- end }} -- name: OTEL_TRACES_SAMPLER - value: "{{ .Values.openTelemetry.tracesSampler }}" -- name: OTEL_TRACES_SAMPLER_ARG - value: "{{ .Values.openTelemetry.tracesSamplingRate }}" -- name: OTEL_PROPAGATORS - value: "{{ .Values.openTelemetry.propagators }}" -{{- end }} - -{{- define "opentracing.envs" }} -- name: OPENTRACING_ENABLED - value: {{ .Values.openTracing.enabled | default false | quote }} -- name: TRACE_JAEGER_COLLECTOR_ENDPOINT - value: "{{ .Values.openTracing.collectorEndpoint }}" -- name: TRACING_SAMPLING_RATE - value: {{ .Values.openTracing.samplingRate | default "0.5" | quote }} -{{- end }} diff --git a/charts/fission-core/templates/deployment.yaml b/charts/fission-core/templates/deployment.yaml deleted file mode 100644 index badac004..00000000 --- a/charts/fission-core/templates/deployment.yaml +++ /dev/null @@ -1,521 +0,0 @@ ---- -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.functionNamespace }} - labels: - name: fission-function - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - {{- if .Values.enableIstio }} - istio-injection: enabled - {{- end }} - ---- -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.builderNamespace }} - labels: - name: fission-builder - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - {{- if .Values.enableIstio }} - istio-injection: enabled - {{- end }} - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: secret-configmap-getter -rules: -- apiGroups: - - '*' - resources: - - secrets - - configmaps - verbs: - - get - - watch - - list - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: package-getter -rules: -- apiGroups: - - '*' - resources: - - packages - verbs: - - get - - watch - - list - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-svc - namespace: {{ .Release.Namespace }} - ---- -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: fission-admin - namespace: {{ .Release.Namespace }} -subjects: - - kind: ServiceAccount - name: fission-svc - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: admin - apiGroup: rbac.authorization.k8s.io - ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: fission-crd -subjects: -- kind: ServiceAccount - name: fission-svc - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: cluster-admin - apiGroup: rbac.authorization.k8s.io - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-fetcher - namespace: {{ .Values.functionNamespace }} - ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: fission-builder - namespace: {{ .Values.builderNamespace }} - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: feature-config - namespace: {{ .Release.Namespace }} -data: - "config.yaml": {{ include "config" . | b64enc }} - ---- -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 - spec: - containers: - - name: controller - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--controllerPort", "8888"] - env: - - name: FISSION_FUNCTION_NAMESPACE - value: "{{ .Values.functionNamespace }}" - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - 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: 8888 - name: http - serviceAccountName: fission-svc - volumes: - - name: config-volume - configMap: - name: feature-config -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: executor - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: executor -spec: - replicas: 1 - selector: - matchLabels: - svc: executor - template: - metadata: - labels: - svc: executor - annotations: - prometheus.io/scrape: "true" - prometheus.io/path: "/metrics" - prometheus.io/port: "8080" - spec: - containers: - - name: executor - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}"] - env: - - name: FETCHER_IMAGE - value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}" - - name: RUNTIME_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: FETCHER_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: ADOPT_EXISTING_RESOURCES - value: {{ .Values.executor.adoptExistingResources | default false | quote }} - - name: POD_READY_TIMEOUT - value: {{ .Values.executor.podReadyTimeout | default false | quote }} - - name: ENABLE_ISTIO - value: "{{ .Values.enableIstio }}" - - name: FETCHER_MINCPU - value: {{ .Values.fetcher.resource.cpu.requests | quote }} - - name: FETCHER_MINMEM - value: {{ .Values.fetcher.resource.mem.requests | quote }} - - name: FETCHER_MAXCPU - value: {{ .Values.fetcher.resource.cpu.limits | quote }} - - name: FETCHER_MAXMEM - value: {{ .Values.fetcher.resource.mem.limits | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - readinessProbe: - httpGet: - path: "/healthz" - port: 8888 - initialDelaySeconds: 1 - periodSeconds: 1 - failureThreshold: 30 - livenessProbe: - httpGet: - path: "/healthz" - port: 8888 - initialDelaySeconds: 35 - periodSeconds: 5 - ports: - - containerPort: 8080 - name: metrics - - containerPort: 8888 - name: http - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: buildermgr - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: buildermgr -spec: - replicas: 1 - selector: - matchLabels: - svc: buildermgr - template: - metadata: - labels: - svc: buildermgr - spec: - containers: - - name: buildermgr - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"] - env: - - name: FETCHER_IMAGE - value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}" - - name: FETCHER_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: BUILDER_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: ENABLE_ISTIO - value: "{{ .Values.enableIstio }}" - - name: FETCHER_MINCPU - value: {{ .Values.fetcher.resource.cpu.requests | quote }} - - name: FETCHER_MINMEM - value: {{ .Values.fetcher.resource.mem.requests | quote }} - - name: FETCHER_MAXCPU - value: {{ .Values.fetcher.resource.cpu.limits | quote }} - - name: FETCHER_MAXMEM - value: {{ .Values.fetcher.resource.mem.limits | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kubewatcher - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: kubewatcher -spec: - replicas: 1 - selector: - matchLabels: - svc: kubewatcher - template: - metadata: - labels: - svc: kubewatcher - spec: - containers: - - name: kubewatcher - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: timer - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: timer -spec: - replicas: 1 - selector: - matchLabels: - svc: timer - template: - metadata: - labels: - svc: timer - spec: - containers: - - name: timer - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--timer", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: storagesvc - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: storagesvc - application: fission-storage -spec: - replicas: 1 - selector: - matchLabels: - svc: storagesvc - application: fission-storage - template: - metadata: - labels: - svc: storagesvc - application: fission-storage - spec: - containers: - - name: storagesvc - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - {{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }} - args: ["--storageServicePort", "8000", "--storageType", "s3"] - {{- else }} - args: ["--storageServicePort", "8000", "--storageType", "local"] - {{- end }} - env: - - name: PRUNE_INTERVAL - value: "{{.Values.pruneInterval}}" - {{- if and (.Values.persistence.enabled) (eq (.Values.persistence.storageType | default "local") "s3") }} - - name: STORAGE_S3_ENDPOINT - value: {{ .Values.persistence.s3.endPoint }} - - name: STORAGE_S3_BUCKET_NAME - value: {{ .Values.persistence.s3.bucketName }} - - name: STORAGE_S3_SUB_DIR - value: {{ .Values.persistence.s3.subDir }} - - name: STORAGE_S3_ACCESS_KEY_ID - value: {{ .Values.persistence.s3.accessKeyId }} - - name: STORAGE_S3_SECRET_ACCESS_KEY - value: {{ .Values.persistence.s3.secretAccessKey }} - - name: STORAGE_S3_REGION - value: {{ .Values.persistence.s3.region }} - {{- end }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - {{- if ne (.Values.persistence.storageType | default "local") "s3" }} - volumeMounts: - - name: fission-storage - mountPath: /fission - {{- end }} - ports: - - containerPort: 8000 - name: http - serviceAccountName: fission-svc - {{- if and (.Values.persistence.enabled) (ne (.Values.persistence.storageType | default "local") "s3") }} - volumes: - - name: fission-storage - persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim | default "fission-storage-pvc" }} - {{- else }} - volumes: - - name: fission-storage - emptyDir: {} - {{- end }} -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} - -{{- if .Values.mqt_keda.enabled }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mqtrigger-keda - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: mqtrigger-keda - messagequeue: keda -spec: - replicas: 1 - selector: - matchLabels: - svc: mqtrigger-keda - messagequeue: keda - template: - metadata: - labels: - svc: mqtrigger-keda - messagequeue: keda - spec: - containers: - - name: mqtrigger-keda - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--mqt_keda", "--routerUrl", "http://router.{{ .Release.Namespace }}"] - env: - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: CONNECTOR_IMAGE_PULL_POLICY - value: "{{ .Values.pullPolicy }}" - - name: KAFKA_IMAGE - value: "{{ .Values.mqt_keda.connector_images.kafka.image }}:{{ .Values.mqt_keda.connector_images.kafka.tag }}" - - name: RABBITMQ_IMAGE - value: "{{ .Values.mqt_keda.connector_images.rabbitmq.image }}:{{ .Values.mqt_keda.connector_images.rabbitmq.tag }}" - - name: AWS-KINESIS-STREAM_IMAGE - value: "{{ .Values.mqt_keda.connector_images.awskinesis.image }}:{{ .Values.mqt_keda.connector_images.awskinesis.tag }}" - - name: AWS-SQS-QUEUE_IMAGE - value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}" - - name: STAN_IMAGE - value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}" - - name: GCP-PUB-SUB_IMAGE - value: "{{ .Values.mqt_keda.connector_images.gcp_pub_sub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pub_sub.tag }}" - - name: REDIS_IMAGE - value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}" - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - serviceAccountName: fission-svc -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - namespace: {{ .Values.functionNamespace }} - name: event-fetcher -rules: -- apiGroups: [""] # "" indicates the core API group - resources: ["pods"] - verbs: ["get", "watch", "list"] -- apiGroups: [""] # "" indicates the core API group - resources: ["events"] - verbs: ["*"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: fission-fetcher-pod-reader - namespace: {{ .Values.functionNamespace }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: event-fetcher -subjects: -- kind: ServiceAccount - name: fission-fetcher - namespace: {{ .Values.functionNamespace }} \ No newline at end of file diff --git a/charts/fission-core/templates/nonhelm-install-job.yaml b/charts/fission-core/templates/nonhelm-install-job.yaml deleted file mode 100644 index 77449975..00000000 --- a/charts/fission-core/templates/nonhelm-install-job.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if .Values.analyticsNonHelmInstall }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "fullname" . }}-{{ .Chart.Version }}-{{ randNumeric 3 }} - labels: - # The "release" convention makes it easy to tie a release to all of the - # Kubernetes resources that were created as part of that release. - release: {{ .Release.Name }} - # This makes it easy to audit chart usage. - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "name" . }} -spec: - #ttlSecondsAfterFinished: 120 - template: - metadata: - name: {{ template "fullname" . }} - labels: - release: {{ .Release.Name }} - app: {{ template "name" . }} - annotations: - {{- if .Values.enableIstio }} - "sidecar.istio.io/inject": "false" - {{- end }} - spec: - restartPolicy: Never - containers: - - name: post-install-job - {{- if .Values.imageTag }} - image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }} - {{- else }} - image: {{ .Values.postInstallReportImage }} - {{- end }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: [ "/reporter" ] - args: ["event", "-c", "fission-use", "-a", "yaml-post-install", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"] - env: - - name: GA_TRACKING_ID - value: "{{ .Values.gaTrackingID }}" - serviceAccountName: fission-svc -{{- end }} diff --git a/charts/fission-core/templates/post-install-job.yaml b/charts/fission-core/templates/post-install-job.yaml deleted file mode 100644 index e570fb2b..00000000 --- a/charts/fission-core/templates/post-install-job.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if .Values.analytics }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "fullname" . }}-{{ .Chart.Version }} - labels: - # The "release" convention makes it easy to tie a release to all of the - # Kubernetes resources that were created as part of that release. - release: {{ .Release.Name }} - # This makes it easy to audit chart usage. - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "name" . }} - annotations: - # This is what defines this resource as a hook. Without this line, the - # job is considered part of the release. - "helm.sh/hook": post-install - "helm.sh/hook-delete-policy": hook-succeeded -spec: - template: - metadata: - name: {{ template "fullname" . }} - labels: - release: {{ .Release.Name }} - app: {{ template "name" . }} - annotations: - {{- if .Values.enableIstio }} - "sidecar.istio.io/inject": "false" - {{- end }} - spec: - restartPolicy: Never - containers: - - name: post-install-job - {{- if .Values.imageTag }} - image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }} - {{- else }} - image: {{ .Values.postInstallReportImage }} - {{- end }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: [ "/reporter" ] - args: ["event", "-c", "fission-use", "-a", "helm-post-install", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"] - env: - - name: GA_TRACKING_ID - value: "{{ .Values.gaTrackingID }}" - serviceAccountName: fission-svc -{{- end }} diff --git a/charts/fission-core/templates/post-upgrade-job.yaml b/charts/fission-core/templates/post-upgrade-job.yaml deleted file mode 100644 index 8dec148f..00000000 --- a/charts/fission-core/templates/post-upgrade-job.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if .Values.analytics }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "fullname" . }}-{{ .Chart.Version }} - labels: - # The "release" convention makes it easy to tie a release to all of the - # Kubernetes resources that were created as part of that release. - release: {{ .Release.Name }} - # This makes it easy to audit chart usage. - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "name" . }} - annotations: - # This is what defines this resource as a hook. Without this line, the - # job is considered part of the release. - "helm.sh/hook": post-upgrade - "helm.sh/hook-delete-policy": hook-succeeded -spec: - template: - metadata: - name: {{ template "fullname" . }} - labels: - release: {{ .Release.Name }} - app: {{ template "name" . }} - annotations: - {{- if .Values.enableIstio }} - "sidecar.istio.io/inject": "false" - {{- end }} - spec: - restartPolicy: Never - containers: - - name: post-upgrade-job - {{- if .Values.imageTag }} - image: {{ .Values.postInstallReportImage }}:{{ .Values.imageTag }} - {{- else }} - image: {{ .Values.postInstallReportImage }} - {{- end }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: [ "/reporter" ] - args: ["event", "-c", "fission-use", "-a", "helm-post-upgrade", "-l", "{{ .Chart.Name }}-{{ .Chart.Version }}"] - env: - - name: GA_TRACKING_ID - value: "{{ .Values.gaTrackingID }}" - serviceAccountName: fission-svc -{{- end }} diff --git a/charts/fission-core/templates/pre-upgrade-job.yaml b/charts/fission-core/templates/pre-upgrade-job.yaml deleted file mode 100644 index b8ad16cd..00000000 --- a/charts/fission-core/templates/pre-upgrade-job.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "fullname" . }}-{{ .Chart.Version }}-{{ randNumeric 3 }} - labels: - # The "release" convention makes it easy to tie a release to all of the - # Kubernetes resources that were created as part of that release. - release: "{{ .Release.Name }}" - # This makes it easy to audit chart usage. - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "name" . }} - annotations: - # This is what defines this resource as a hook. Without this line, the - # job is considered part of the release. - "helm.sh/hook": pre-upgrade - "helm.sh/hook-delete-policy": hook-succeeded -spec: - backoffLimit: 0 - template: - metadata: - name: {{ template "fullname" . }} - labels: - release: "{{ .Release.Name }}" - app: {{ template "name" . }} - spec: - restartPolicy: Never - containers: - - name: pre-upgrade-job - image: {{ .Values.preUpgradeChecksImage }}:{{ .Values.imageTag }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: [ "/pre-upgrade-checks" ] - args: ["--fn-pod-namespace", "{{ .Values.functionNamespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"] - serviceAccountName: fission-svc diff --git a/charts/fission-core/templates/pvc.yaml b/charts/fission-core/templates/pvc.yaml deleted file mode 100644 index 9551f833..00000000 --- a/charts/fission-core/templates/pvc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) (eq (.Values.persistence.storageType | default "local") "local") }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: fission-storage-pvc - labels: - app: fission-storage - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} - {{- if .Values.persistence.storageClass }} - {{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" - {{- else }} - storageClassName: {{ .Values.persistence.storageClass | quote }} - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/fission-core/templates/router.yaml b/charts/fission-core/templates/router.yaml deleted file mode 100644 index be21eb4d..00000000 --- a/charts/fission-core/templates/router.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: apps/v1 -{{- if not .Values.router.deployAsDaemonSet }} -kind: Deployment -{{- else }} -kind: DaemonSet -{{- end }} -metadata: - name: router - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - svc: router - application: fission-router -spec: -{{- if not .Values.router.deployAsDaemonSet }} - replicas: 1 -{{- end }} - selector: - matchLabels: - application: fission-router - svc: router - template: - metadata: - labels: - application: fission-router - svc: router - annotations: - prometheus.io/scrape: "true" - prometheus.io/path: "/metrics" - prometheus.io/port: "8080" - spec: - containers: - - name: router - image: {{ include "fission-bundleImage" . | quote }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/fission-bundle"] - args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}"] - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: ROUTER_ROUND_TRIP_TIMEOUT - value: {{ .Values.router.roundTrip.timeout | default "50ms" | quote }} - - name: ROUTER_ROUNDTRIP_TIMEOUT_EXPONENT - value: {{ .Values.router.roundTrip.timeoutExponent | default 2 | quote }} - - name: ROUTER_ROUND_TRIP_KEEP_ALIVE_TIME - value: {{ .Values.router.roundTrip.keepAliveTime | default "30s" | quote }} - - name: ROUTER_ROUND_TRIP_DISABLE_KEEP_ALIVE - value: {{ .Values.router.roundTrip.disableKeepAlive | default true | quote }} - - name: ROUTER_ROUND_TRIP_MAX_RETRIES - value: {{ .Values.router.roundTrip.maxRetries | default 10 | quote }} - - name: ROUTER_SVC_ADDRESS_MAX_RETRIES - value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }} - - name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT - value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }} - - name: ROUTER_UNTAP_SERVICE_TIMEOUT - value: {{ .Values.router.unTapServiceTimeout | default "3600s" | quote }} - - name: USE_ENCODED_PATH - value: {{ .Values.router.useEncodedPath | default false | quote }} - - name: DEBUG_ENV - value: {{ .Values.debugEnv | quote }} - - name: DISPLAY_ACCESS_LOG - value: {{ .Values.router.displayAccessLog | default false | quote }} - {{- include "opentracing.envs" . | indent 8 }} - {{- include "opentelemtry.envs" . | indent 8 }} - resources: - {{- toYaml .Values.router.resources | indent 10 }} - readinessProbe: - httpGet: - path: "/router-healthz" - port: 8888 - initialDelaySeconds: 1 - periodSeconds: 1 - failureThreshold: 30 - livenessProbe: - httpGet: - path: "/router-healthz" - port: 8888 - initialDelaySeconds: 35 - periodSeconds: 5 - ports: - - containerPort: 8080 - name: metrics - - containerPort: 8888 - name: http - serviceAccountName: fission-svc -{{- if .Values.router.extraCoreComponentPodConfig }} -{{ toYaml .Values.router.extraCoreComponentPodConfig | indent 6 -}} -{{- else }} -{{- if .Values.extraCoreComponentPodConfig }} -{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}} -{{- end }} -{{- end }} diff --git a/charts/fission-core/templates/svc.yaml b/charts/fission-core/templates/svc.yaml deleted file mode 100644 index f51b37de..00000000 --- a/charts/fission-core/templates/svc.yaml +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: router - labels: - svc: router - application: fission-router - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -{{- if .Values.router.svcAnnotations }} - annotations: -{{ toYaml .Values.router.svcAnnotations | indent 4 }} -{{- end }} -spec: - type: {{ .Values.routerServiceType }} - ports: - - port: 80 - targetPort: 8888 -{{- if eq .Values.routerServiceType "NodePort" }} - nodePort: {{ .Values.routerPort }} -{{- end }} - selector: - svc: router - ---- -apiVersion: v1 -kind: Service -metadata: - name: controller - labels: - svc: controller - application: fission-api - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: {{ .Values.serviceType }} - ports: - - port: 80 - targetPort: 8888 -{{- if eq .Values.serviceType "NodePort" }} - nodePort: {{ .Values.controllerPort }} -{{- end }} - selector: - svc: controller - ---- -apiVersion: v1 -kind: Service -metadata: - name: storagesvc - labels: - svc: storagesvc - application: fission-storage - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 8000 - selector: - svc: storagesvc - ---- -apiVersion: v1 -kind: Service -metadata: - name: executor - labels: - svc: executor - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 8888 - selector: - svc: executor diff --git a/charts/fission-core/values.yaml b/charts/fission-core/values.yaml deleted file mode 100644 index c88c7389..00000000 --- a/charts/fission-core/values.yaml +++ /dev/null @@ -1,305 +0,0 @@ -# -# Fission chart configuration -# - -## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. -serviceType: ClusterIP - -## For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. -routerServiceType: LoadBalancer - -## Image base repository -## Leave it empty for using existing local image -repository: index.docker.io - -## Fission image repository -image: fission/fission-bundle - -## Fission image version -imageTag: v1.15.0-rc1 - -## Image pull policy -pullPolicy: IfNotPresent - -## Port at which Fission controller service should be exposed -controllerPort: 31313 - -## Port at which Fission router service should be exposed -routerPort: 31314 - -## Namespace in which to run fission functions (this is different from -## the release namespace) -functionNamespace: fission-function - -## Namespace in which to run fission builders (this is different from -## the release namespace) -builderNamespace: fission-builder - -## Enable istio integration -enableIstio: false - -fetcher: - ## Fetcher repository - image: fission/fetcher - ## Fetcher image version - imageTag: v1.15.0-rc1 - - ## Fetcher is only for to downloading or uploading archive. - ## Normally, you don't need to change the value here, unless necessary. - resource: - cpu: - requests: "10m" - ## Low CPU limits will increases the function specialization time. - limits: "" - mem: - requests: "16Mi" - limits: "" - -executor: - adoptExistingResources: false - podReadyTimeout: 300s - -## Router config -router: - deployAsDaemonSet: false - svcAddressMaxRetries: 5 - svcAddressUpdateTimeout: 30s - unTapServiceTimeout: 3600s - ## Display endpoint access logs - ## To be aware of enabling logging endpoint access log, it increases - ## router resource utilization when under heavy workloads. - displayAccessLog: false - - ## Add annotations for router - # svcAnnotations: - # cloud.google.com/load-balancer-type: Internal - - ## For router to match encoded path. - ## If true, "/foo%2Fbar" will match the path "/{var}"; - ## Otherwise, it will match the path "/foo/bar". - useEncodedPath: false - - roundTrip: - ## If true, router will disable the HTTP keep-alive which result in performance degradation. - ## But it ensures that router can redirect new coming requests to new function pods. - ## - ## If false, router will enable transport keep-alive feature for better performance. - ## However, the drawback is it takes longer to switch to newly created function pods - ## if using newdeploy as executor type for function. If you want to preserve the - ## performance while keeping the short switching time to new function, you can create - ## an environment with short grace period by setting flag "--graceperiod" (default 360s), - ## so that kubernetes will be able to reap old function pod quickly. - ## - ## For details, see https://github.com/fission/fission/issues/723 - disableKeepAlive: true - - ## The keep-alive period for an active network connection to function pod. - keepAliveTime: 30s - - ## HTTP transport request timeout - timeout: 50ms - - ## The length of request timeout will multiply with timeoutExponent after each retry - timeoutExponent: 2 - - ## Max retries times of a failed request - maxRetries: 10 - - ## Sample with a rate per time window (traces/second) - traceSamplingRate: 0.5 - - ## Extend the container specs for the router fission pods. - ## Can be used to add things like affinty/tolerations/nodeSelectors/etc. - ## For example: - ## extraCoreComponentPodConfig: - ## affinity: - ## nodeAffinity: - ## requiredDuringSchedulingIgnoredDuringExecution: - ## nodeSelectorTerms: - ## - matchExpressions: - ## - key: capability - ## operator: In - ## values: - ## - app - #extraCoreComponentPodConfig: - # affinity: - # tolerations: - # nodeSelector: - - # Pod resources as: - # resources: - # limits: - # cpu: - # memory: - # requests: - # cpu: - # memory: - resources: {} - -## Persist data to a persistent volume. -persistence: - ## If true, fission will create/use a Persistent Volume Claim unless storageType is set to s3 - ## If false, use emptyDir - ## - enabled: true - - ## Must be set to either local or S3. - ## If storateType is set(other than local), one of its backend configuration must be set as below. - #storageType: local | s3 - - ## Sample configruation for AWS s3 storage backend - #s3: - # bucketName: - # subDir: - # accessKeyId: - # secretAccessKey: - # region: - - ## A manually managed Persistent Volume Claim name - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - ## - # existingClaim: - - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - - accessMode: ReadWriteOnce - size: 8Gi - -## Extend the container specs for the core fission pods. -## Can be used to add things like affinty/tolerations/nodeSelectors/etc. -## For example: -## extraCoreComponentPodConfig: -## affinity: -## nodeAffinity: -## requiredDuringSchedulingIgnoredDuringExecution: -## nodeSelectorTerms: -## - matchExpressions: -## - key: capability -## operator: In -## values: -## - app -#extraCoreComponentPodConfig: -# affinity: -# tolerations: -# nodeSelector: - -## Analytics let us count how many people installed fission. Set to -## false to disable analytics. -analytics: true - -## Internally used for generating an analytics job for non-helm installs -analyticsNonHelmInstall: false - -## Google Analytics Tracking ID -gaTrackingID: UA-196546703-1 - -## Archive pruner is a garbage collector for archives on the fission storage service. -## This interval configures the frequency at which it runs inside the storagesvc pod. -## The value is in minutes. -pruneInterval: 60 - -## Fission pre-install/pre-upgrade checks live in this image -preUpgradeChecksImage: fission/pre-upgrade-checks - -## Fission ppost-install/post-upgrade reporting live in this image -postInstallReportImage: fission/reporter - -## if there are any pod specialization errors when a function is triggered and this flag is set to true, the error -## summary is returned as part of http response -debugEnv: false - -## Prometheus for scrapping service metrics -prometheus: - ## set this flag to true if prometheus needs to be deployed along with fission - enabled: false - - ## If enabled is false, please assign the prometheus service URL - ## that is accessible by components. - serviceEndpoint: "" - -## set this flag to false if you dont need canary deployment feature -canaryDeployment: - enabled: false - -# Use the following flags to enable OpenTracing. -# Note: OpenTracing support will be removed in an upcoming release. -# Please prefer using OpenTelemetry instead. -openTracing: - ## set this flag to true if you wish to enable OpenTracing - enabled: false - - ## if enabled is true, the variable is endpoint of Jaeger collector in the format shown below - #collectorEndpoint: "http://jaeger-collector.jaeger.svc:14268/api/traces?format=jaeger.thrift" - - ## uniformly sample traces with the given probabilistic sampling rate - #samplingRate: 0.75 - -# It is an alternate to OpenTracing. -openTelemetry: - # Use this flag to set the collector endpoint for OpenTelemetry. - # The variable is endpoint of the collector in the format shown below. - # otlpCollectorEndpoint: "otel-collector.observability.svc:4317" - otlpCollectorEndpoint: "" - # Set this flag to false if you are using secure endpoint for the collector. - otlpInsecure: true - # Key-value pairs to be used as headers associated with gRPC or HTTP requests - # to the collector. - # Eg. otlpHeaders: "key1=value1,key2=value2" - otlpHeaders: "" - # Supported samplers: - # always_on - Sampler that always samples spans, regardless of the parent span's sampling decision. - # always_off - Sampler that never samples spans, regardless of the parent span's sampling decision. - # traceidratio - Sampler that samples probabalistically based on rate. - # parentbased_always_on - (default if empty) Sampler that respects its parent span's sampling decision, but otherwise always samples. - # parentbased_always_off - Sampler that respects its parent span's sampling decision, but otherwise never samples. - # parentbased_traceidratio - Sampler that respects its parent span's sampling decision, but otherwise samples probabalistically based on rate. - tracesSampler: "parentbased_traceidratio" - # Each Sampler type defines its own expected input, if any. - # Currently we get trace ratio for the case of, - # 1. traceidratio - # 2. parentbased_traceidratio - # Sampling probability, a number in the [0..1] range, e.g. "0.1". Default is 0.1. - tracesSamplingRate: "0.1" - # Supported providers: - # tracecontext - W3C Trace Context - # baggage - W3C Baggage - # b3 - B3 Single - # b3multi - B3 Multi - # jaeger - Jaeger uber-trace-id header - # xray - AWS X-Ray (third party) - # ottrace - OpenTracing Trace (third party) - propagators: "tracecontext,baggage" - -## Message Queue Trigger Kind, KEDA: enable and configuration -mqt_keda: - enabled: true - connector_images: - kafka: - image: fission/keda-kafka-http-connector - tag: v0.8 - rabbitmq: - image: fission/keda-rabbitmq-http-connector - tag: v0.8 - awskinesis: - image: fission/keda-aws-kinesis-http-connector - tag: v0.8 - aws_sqs: - image: fission/keda-aws-sqs-http-connector - tag: v0.8 - nats_steaming: - image: fission/keda-nats-streaming-http-connector - tag: v0.9 - gcp_pub_sub: - image: fission/keda-gcp-pubsub-http-connector - tag: v0.3 - redis: - image: fission/keda-redis-http-connector - tag: v0.1 diff --git a/hack/generate-helm-manifest.sh b/hack/generate-helm-manifest.sh index 3aaf243d..6ec9919e 100755 --- a/hack/generate-helm-manifest.sh +++ b/hack/generate-helm-manifest.sh @@ -5,6 +5,7 @@ set -x DIR=$(realpath $(dirname "$0"))/../ MANIFESTDIR=$(realpath "$DIR")/manifest +CHARTS="fission-all" source $(realpath "${DIR}"/test/init_tools.sh) doit() { @@ -23,28 +24,33 @@ check_charts_repo() { } update_chart_version() { + pushd "$DIR"/charts local version=$1 - sed -i "s/^version.*/version\: ${version}/" charts/fission-core/Chart.yaml - sed -i "s/^version.*/version\: ${version}/" charts/fission-all/Chart.yaml - sed -i "s/appVersion.*/appVersion\: ${version}/" charts/fission-core/Chart.yaml - sed -i "s/appVersion.*/appVersion\: ${version}/" charts/fission-all/Chart.yaml - sed -i "s/\bimageTag:.*/imageTag\: ${version}/" charts/fission-core/values.yaml - sed -i "s/\bimageTag:.*/imageTag\: ${version}/" charts/fission-all/values.yaml + for c in $CHARTS; do + sed -i "s/^version.*/version\: ${version}/" $c/Chart.yaml + sed -i "s/appVersion.*/appVersion\: ${version}/" $c/Chart.yaml + sed -i "s/\bimageTag:.*/imageTag\: ${version}/" $c/values.yaml + done + popd } lint_charts() { - helm lint charts/fission-all charts/fission-core - if [ $? -ne 0 ]; then - echo "helm lint failed" - exit 1 - fi + pushd "$DIR"/charts + for c in $CHARTS; do + doit helm lint $c + if [ $? -ne 0 ]; then + echo "helm lint failed" + exit 1 + fi + done + popd } build_charts() { mkdir -p "$MANIFESTDIR"/charts pushd "$DIR"/charts find . -iname *.~?~ | xargs -r rm - for c in fission-all fission-core; do + for c in $CHARTS; do doit helm package -u $c/ mv ./*.tgz "$MANIFESTDIR"/charts/ done @@ -60,7 +66,7 @@ build_yamls() { releaseName=fission-$(echo "${version}" | sed 's/\./-/g') - for c in fission-all fission-core; do + for c in $CHARTS; do # fetch dependencies pushd ${c} doit helm dependency update @@ -96,9 +102,10 @@ update_github_charts_repo() { local chartsrepo=$2 pushd "$chartsrepo" - cp "$MANIFESTDIR"/charts/fission-all-"${version}".tgz . - cp "$MANIFESTDIR"/charts/fission-core-"${version}".tgz . - ./index.sh + for c in $CHARTS; do + cp "$MANIFESTDIR"/charts/$c-"${version}".tgz . + ./index.sh + done popd } diff --git a/skaffold.yaml b/skaffold.yaml index a4f9ebdb..76ad99a6 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -36,13 +36,16 @@ deploy: preUpgradeChecksImage: pre-upgrade-checks namespace: fission setValues: - analytics: "false" - debugEnv: "false" + analytics: false + debugEnv: false fetcher.imageTag: "" imageTag: "" namespace: fission pprof.enabled: false - prometheus.enabled: "false" + prometheus.enabled: false + canaryDeployment.enabled: false + nats.enabled: false + influxdb.enabled: false pruneInterval: "60" repository: index.docker.io routerServiceType: LoadBalancer @@ -97,6 +100,15 @@ profiles: - op: replace path: /deploy/helm/releases/0/setValues/prometheus.enabled value: true + - op: replace + path: /deploy/helm/releases/0/setValues/nats.enabled + value: true + - op: replace + path: /deploy/helm/releases/0/setValues/influxdb.enabled + value: true + - op: replace + path: /deploy/helm/releases/0/setValues/canaryDeployment.enabled + value: true - name: kind-opentelemetry patches: - op: replace