Skip to content

Commit 82949ea

Browse files
Yansonkhorshuheng
authored andcommitted
Helm Chart Upgrades (#458)
Move prometheus-statsd-exporter to toggleable core dependency (default false). Add ingresses for gRPC and HTTP for both core and serving. Refactor ConfigMaps to user Spring profiles rather than manipulating the base application.yaml. Add ability to define and enable arbitrary Spring profiles. Add toggle to enable prometheus scraping in core. Add parameters to change LOG_LEVEL and LOG_TYPE (#430). Add parameter to specify GOOGLE_CLOUD_PROJECT. Allow jar path to be specified (e.g. if using non-standard image). Add missing documentation for Helm parameters.
1 parent 14fe2d1 commit 82949ea

29 files changed

+510
-160
lines changed

infra/charts/feast/README.md

+76-4
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,26 @@ The following table lists the configurable parameters of the Feast chart and the
8181
| `feast-core.kafka.topics[0].name` | Default topic name in Kafka| `feast`
8282
| `feast-core.kafka.topics[0].replicationFactor` | No of replication factor for the topic| `1`
8383
| `feast-core.kafka.topics[0].partitions` | No of partitions for the topic | `1`
84+
| `feast-core.prometheus-statsd-exporter.enabled` | Flag to install Prometheus StatsD Exporter | `false`
85+
| `feast-core.prometheus-statsd-exporter.*` | Refer to this [link](charts/feast-core/charts/prometheus-statsd-exporter/values.yaml |
8486
| `feast-core.replicaCount` | No of pods to create | `1`
8587
| `feast-core.image.repository` | Repository for Feast Core Docker image | `gcr.io/kf-feast/feast-core`
86-
| `feast-core.image.tag` | Tag for Feast Core Docker image | `0.3.2`
88+
| `feast-core.image.tag` | Tag for Feast Core Docker image | `0.4.4`
8789
| `feast-core.image.pullPolicy` | Image pull policy for Feast Core Docker image | `IfNotPresent`
90+
| `feast-core.prometheus.enabled` | Add annotations to enable Prometheus scraping | `false`
8891
| `feast-core.application.yaml` | Configuration for Feast Core application | Refer to this [link](charts/feast-core/values.yaml)
8992
| `feast-core.springConfigMountPath` | Directory to mount application.yaml | `/etc/feast/feast-core`
9093
| `feast-core.gcpServiceAccount.useExistingSecret` | Flag to use existing secret for GCP service account | `false`
9194
| `feast-core.gcpServiceAccount.existingSecret.name` | Secret name for the service account | `feast-gcp-service-account`
9295
| `feast-core.gcpServiceAccount.existingSecret.key` | Secret key for the service account | `key.json`
9396
| `feast-core.gcpServiceAccount.mountPath` | Directory to mount the JSON key file | `/etc/gcloud/service-accounts`
97+
| `feast-core.gcpProjectId` | Project ID to set `GOOGLE_CLOUD_PROJECT` to change default project used by SDKs | `""`
98+
| `feast-core.jarPath` | Path to Jar file in the Docker image | `/opt/feast/feast-core.jar`
9499
| `feast-core.jvmOptions` | Options for the JVM | `[]`
100+
| `feast-core.logLevel` | Application logging level | `warn`
101+
| `feast-core.logType` | Application logging type (`JSON` or `Console`) | `JSON`
102+
| `feast-core.springConfigProfiles` | Map of profile name to file content for additional Spring profiles | `{}`
103+
| `feast-core.springConfigProfilesActive` | CSV of profiles to enable from `springConfigProfiles` | `""`
95104
| `feast-core.livenessProbe.enabled` | Flag to enable liveness probe | `true`
96105
| `feast-core.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60`
97106
| `feast-core.livenessProbe.periodSeconds` | How often to perform the probe | `10`
@@ -109,23 +118,31 @@ The following table lists the configurable parameters of the Feast chart and the
109118
| `feast-core.grpc.port` | Kubernetes Service port for GRPC request| `6565`
110119
| `feast-core.grpc.targetPort` | Container port for GRPC request| `6565`
111120
| `feast-core.resources` | CPU and memory allocation for the pod | `{}`
121+
| `feast-core.ingress` | See *Ingress Parameters* [below](#ingress-parameters) | `{}`
112122
| `feast-serving-online.enabled` | Flag to install Feast Online Serving | `true`
113123
| `feast-serving-online.redis.enabled` | Flag to install Redis in Feast Serving | `false`
114124
| `feast-serving-online.redis.usePassword` | Flag to use password to access Redis | `false`
115125
| `feast-serving-online.redis.cluster.enabled` | Flag to enable Redis cluster | `false`
116126
| `feast-serving-online.core.enabled` | Flag for Feast Serving to use Feast Core in the same Helm release | `true`
117127
| `feast-serving-online.replicaCount` | No of pods to create | `1`
118128
| `feast-serving-online.image.repository` | Repository for Feast Serving Docker image | `gcr.io/kf-feast/feast-serving`
119-
| `feast-serving-online.image.tag` | Tag for Feast Serving Docker image | `0.3.2`
129+
| `feast-serving-online.image.tag` | Tag for Feast Serving Docker image | `0.4.4`
120130
| `feast-serving-online.image.pullPolicy` | Image pull policy for Feast Serving Docker image | `IfNotPresent`
131+
| `feast-serving-online.prometheus.enabled` | Add annotations to enable Prometheus scraping | `true`
121132
| `feast-serving-online.application.yaml` | Application configuration for Feast Serving | Refer to this [link](charts/feast-serving/values.yaml)
122133
| `feast-serving-online.store.yaml` | Store configuration for Feast Serving | Refer to this [link](charts/feast-serving/values.yaml)
123134
| `feast-serving-online.springConfigMountPath` | Directory to mount application.yaml and store.yaml | `/etc/feast/feast-serving`
124135
| `feast-serving-online.gcpServiceAccount.useExistingSecret` | Flag to use existing secret for GCP service account | `false`
125136
| `feast-serving-online.gcpServiceAccount.existingSecret.name` | Secret name for the service account | `feast-gcp-service-account`
126137
| `feast-serving-online.gcpServiceAccount.existingSecret.key` | Secret key for the service account | `key.json`
127138
| `feast-serving-online.gcpServiceAccount.mountPath` | Directory to mount the JSON key file | `/etc/gcloud/service-accounts`
139+
| `feast-serving-online.gcpProjectId` | Project ID to set `GOOGLE_CLOUD_PROJECT` to change default project used by SDKs | `""`
140+
| `feast-serving-online.jarPath` | Path to Jar file in the Docker image | `/opt/feast/feast-serving.jar`
128141
| `feast-serving-online.jvmOptions` | Options for the JVM | `[]`
142+
| `feast-serving-online.logLevel` | Application logging level | `warn`
143+
| `feast-serving-online.logType` | Application logging type (`JSON` or `Console`) | `JSON`
144+
| `feast-serving-online.springConfigProfiles` | Map of profile name to file content for additional Spring profiles | `{}`
145+
| `feast-serving-online.springConfigProfilesActive` | CSV of profiles to enable from `springConfigProfiles` | `""`
129146
| `feast-serving-online.livenessProbe.enabled` | Flag to enable liveness probe | `true`
130147
| `feast-serving-online.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60`
131148
| `feast-serving-online.livenessProbe.periodSeconds` | How often to perform the probe | `10`
@@ -143,23 +160,31 @@ The following table lists the configurable parameters of the Feast chart and the
143160
| `feast-serving-online.grpc.port` | Kubernetes Service port for GRPC request| `6566`
144161
| `feast-serving-online.grpc.targetPort` | Container port for GRPC request| `6566`
145162
| `feast-serving-online.resources` | CPU and memory allocation for the pod | `{}`
163+
| `feast-serving-online.ingress` | See *Ingress Parameters* [below](#ingress-parameters) | `{}`
146164
| `feast-serving-batch.enabled` | Flag to install Feast Batch Serving | `true`
147165
| `feast-serving-batch.redis.enabled` | Flag to install Redis in Feast Serving | `false`
148166
| `feast-serving-batch.redis.usePassword` | Flag to use password to access Redis | `false`
149167
| `feast-serving-batch.redis.cluster.enabled` | Flag to enable Redis cluster | `false`
150168
| `feast-serving-batch.core.enabled` | Flag for Feast Serving to use Feast Core in the same Helm release | `true`
151169
| `feast-serving-batch.replicaCount` | No of pods to create | `1`
152170
| `feast-serving-batch.image.repository` | Repository for Feast Serving Docker image | `gcr.io/kf-feast/feast-serving`
153-
| `feast-serving-batch.image.tag` | Tag for Feast Serving Docker image | `0.3.2`
171+
| `feast-serving-batch.image.tag` | Tag for Feast Serving Docker image | `0.4.4`
154172
| `feast-serving-batch.image.pullPolicy` | Image pull policy for Feast Serving Docker image | `IfNotPresent`
173+
| `feast-serving-batch.prometheus.enabled` | Add annotations to enable Prometheus scraping | `true`
155174
| `feast-serving-batch.application.yaml` | Application configuration for Feast Serving | Refer to this [link](charts/feast-serving/values.yaml)
156175
| `feast-serving-batch.store.yaml` | Store configuration for Feast Serving | Refer to this [link](charts/feast-serving/values.yaml)
157176
| `feast-serving-batch.springConfigMountPath` | Directory to mount application.yaml and store.yaml | `/etc/feast/feast-serving`
158177
| `feast-serving-batch.gcpServiceAccount.useExistingSecret` | Flag to use existing secret for GCP service account | `false`
159178
| `feast-serving-batch.gcpServiceAccount.existingSecret.name` | Secret name for the service account | `feast-gcp-service-account`
160179
| `feast-serving-batch.gcpServiceAccount.existingSecret.key` | Secret key for the service account | `key.json`
161180
| `feast-serving-batch.gcpServiceAccount.mountPath` | Directory to mount the JSON key file | `/etc/gcloud/service-accounts`
181+
| `feast-serving-batch.gcpProjectId` | Project ID to set `GOOGLE_CLOUD_PROJECT` to change default project used by SDKs | `""`
182+
| `feast-serving-batch.jarPath` | Path to Jar file in the Docker image | `/opt/feast/feast-serving.jar`
162183
| `feast-serving-batch.jvmOptions` | Options for the JVM | `[]`
184+
| `feast-serving-batch.logLevel` | Application logging level | `warn`
185+
| `feast-serving-batch.logType` | Application logging type (`JSON` or `Console`) | `JSON`
186+
| `feast-serving-batch.springConfigProfiles` | Map of profile name to file content for additional Spring profiles | `{}`
187+
| `feast-serving-batch.springConfigProfilesActive` | CSV of profiles to enable from `springConfigProfiles` | `""`
163188
| `feast-serving-batch.livenessProbe.enabled` | Flag to enable liveness probe | `true`
164189
| `feast-serving-batch.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60`
165190
| `feast-serving-batch.livenessProbe.periodSeconds` | How often to perform the probe | `10`
@@ -176,4 +201,51 @@ The following table lists the configurable parameters of the Feast chart and the
176201
| `feast-serving-batch.http.targetPort` | Container port for HTTP request | `8080`
177202
| `feast-serving-batch.grpc.port` | Kubernetes Service port for GRPC request| `6566`
178203
| `feast-serving-batch.grpc.targetPort` | Container port for GRPC request| `6566`
179-
| `feast-serving-batch.resources` | CPU and memory allocation for the pod | `{}`
204+
| `feast-serving-batch.resources` | CPU and memory allocation for the pod | `{}`
205+
| `feast-serving-batch.ingress` | See *Ingress Parameters* [below](#ingress-parameters) | `{}`
206+
207+
## Ingress Parameters
208+
209+
The following table lists the configurable parameters of the ingress section for each Feast module.
210+
211+
Note, there are two ingresses available for each module - `grpc` and `http`.
212+
213+
| Parameter | Description | Default
214+
| ----------------------------- | ----------- | -------
215+
| `ingress.grcp.enabled` | Enables an ingress (endpoint) for the gRPC server | `false`
216+
| `ingress.grcp.*` | See below |
217+
| `ingress.http.enabled` | Enables an ingress (endpoint) for the HTTP server | `false`
218+
| `ingress.http.*` | See below |
219+
| `ingress.*.class` | Value for `kubernetes.io/ingress.class` | `nginx`
220+
| `ingress.*.hosts` | List of host-names for the ingress | `[]`
221+
| `ingress.*.annotations` | Additional ingress annotations | `{}`
222+
| `ingress.*.https.enabled` | Add a tls section to the ingress | `true`
223+
| `ingress.*.https.secretNames` | Map of hostname to TLS secret name | `{}` If not specified, defaults to `domain-tld-tls` e.g. `feast.example.com` uses secret `example-com-tls`
224+
| `ingress.*.auth.enabled` | Enable auth on the ingress (only applicable for `nginx` type | `false`
225+
| `ingress.*.auth.signinHost` | External hostname of the OAuth2 proxy to use | First item in `ingress.hosts`, replacing the sub-domain with 'auth' e.g. `feast.example.com` uses `auth.example.com`
226+
| `ingress.*.auth.authUrl` | Internal URI to internal auth endpoint | `http://auth-server.auth-ns.svc.cluster.local/auth`
227+
| `ingress.*.whitelist` | Subnet masks to whitelist (i.e. value for `nginx.ingress.kubernetes.io/whitelist-source-range`) | `"""`
228+
229+
To enable all the ingresses will a config like the following (while also adding the hosts etc):
230+
231+
```yaml
232+
feast-core:
233+
ingress:
234+
grpc:
235+
enabled: true
236+
http:
237+
enabled: true
238+
feast-serving-online:
239+
ingress:
240+
grpc:
241+
enabled: true
242+
http:
243+
enabled: true
244+
feast-serving-batch:
245+
ingress:
246+
grpc:
247+
enabled: true
248+
http:
249+
enabled: true
250+
```
251+

infra/charts/feast/charts/feast-core/requirements.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ dependencies:
66
- name: kafka
77
version: 0.20.1
88
repository: "@incubator"
9-
condition: kafka.enabled
9+
condition: kafka.enabled
10+
- name: common
11+
version: 0.0.5
12+
repository: "@incubator"
13+
- name: prometheus-statsd-exporter
14+
version: 0.1.2
15+
condition: prometheus-statsd-exporter.enabled
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{- /*
2+
This takes an array of three values:
3+
- the top context
4+
- the feast component
5+
- the service protocol
6+
- the ingress context
7+
*/ -}}
8+
{{- define "feast.ingress" -}}
9+
{{- $top := (index . 0) -}}
10+
{{- $component := (index . 1) -}}
11+
{{- $protocol := (index . 2) -}}
12+
{{- $ingressValues := (index . 3) -}}
13+
apiVersion: extensions/v1beta1
14+
kind: Ingress
15+
{{ include "feast.ingress.metadata" . }}
16+
spec:
17+
rules:
18+
{{- range $host := $ingressValues.hosts }}
19+
- host: {{ $host }}
20+
http:
21+
paths:
22+
- path: /
23+
backend:
24+
serviceName: {{ include (printf "feast-%s.fullname" $component) $top }}
25+
servicePort: {{ index $top.Values "service" $protocol "port" }}
26+
{{- end }}
27+
{{- if $ingressValues.https.enabled }}
28+
tls:
29+
{{- range $host := $ingressValues.hosts }}
30+
- secretName: {{ index $ingressValues.https.secretNames $host | default (splitList "." $host | rest | join "-" | printf "%s-tls") }}
31+
hosts:
32+
- {{ $host }}
33+
{{- end }}
34+
{{- end -}}
35+
{{- end -}}
36+
37+
{{- define "feast.ingress.metadata" -}}
38+
{{- $commonMetadata := fromYaml (include "common.metadata" (first .)) }}
39+
{{- $overrides := fromYaml (include "feast.ingress.metadata-overrides" .) -}}
40+
{{- toYaml (merge $overrides $commonMetadata) -}}
41+
{{- end -}}
42+
43+
{{- define "feast.ingress.metadata-overrides" -}}
44+
{{- $top := (index . 0) -}}
45+
{{- $component := (index . 1) -}}
46+
{{- $protocol := (index . 2) -}}
47+
{{- $ingressValues := (index . 3) -}}
48+
{{- $commonFullname := include "common.fullname" $top }}
49+
metadata:
50+
name: {{ $commonFullname }}-{{ $component }}-{{ $protocol }}
51+
annotations:
52+
kubernetes.io/ingress.class: {{ $ingressValues.class | quote }}
53+
{{- if (and (eq $ingressValues.class "nginx") $ingressValues.auth.enabled) }}
54+
nginx.ingress.kubernetes.io/auth-url: {{ $ingressValues.auth.authUrl | quote }}
55+
nginx.ingress.kubernetes.io/auth-response-headers: "x-auth-request-email, x-auth-request-user"
56+
nginx.ingress.kubernetes.io/auth-signin: "https://{{ $ingressValues.auth.signinHost | default (splitList "." (index $ingressValues.hosts 0) | rest | join "." | printf "auth.%s")}}/oauth2/start?rd=/r/$host/$request_uri"
57+
{{- end }}
58+
{{- if (and (eq $ingressValues.class "nginx") $ingressValues.whitelist) }}
59+
nginx.ingress.kubernetes.io/whitelist-source-range: {{ $ingressValues.whitelist | quote -}}
60+
{{- end }}
61+
{{- if (and (eq $ingressValues.class "nginx") (eq $protocol "grpc") ) }}
62+
# TODO: Allow choice of GRPC/GRPCS
63+
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
64+
{{- end }}
65+
{{- if $ingressValues.annotations -}}
66+
{{ include "common.annote" $ingressValues.annotations | indent 4 }}
67+
{{- end }}
68+
{{- end -}}

infra/charts/feast/charts/feast-core/templates/configmap.yaml

+33-12
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,43 @@ metadata:
1111
heritage: {{ .Release.Service }}
1212
data:
1313
application.yaml: |
14-
{{- $config := index .Values "application.yaml"}}
14+
{{- toYaml (index .Values "application.yaml") | nindent 4 }}
1515

1616
{{- if .Values.postgresql.enabled }}
17-
{{- $datasource := dict "url" (printf "jdbc:postgresql://%s:%s/%s" (printf "%s-postgresql" .Release.Name) (.Values.postgresql.service.port | toString) (.Values.postgresql.postgresqlDatabase)) "driverClassName" "org.postgresql.Driver" }}
18-
{{- $newConfig := dict "spring" (dict "datasource" $datasource) }}
19-
{{- $config := mergeOverwrite $config $newConfig }}
17+
application-bundled-postgresql.yaml: |
18+
spring:
19+
datasource:
20+
url: {{ printf "jdbc:postgresql://%s:%s/%s" (printf "%s-postgresql" .Release.Name) (.Values.postgresql.service.port | toString) (.Values.postgresql.postgresqlDatabase) }}
21+
driverClassName: org.postgresql.Driver
2022
{{- end }}
2123

22-
{{- if .Values.kafka.enabled }}
23-
{{- $topic := index .Values.kafka.topics 0 }}
24-
{{- $options := dict "topic" $topic.name "replicationFactor" $topic.replicationFactor "partitions" $topic.partitions }}
25-
{{- if not .Values.kafka.external.enabled }}
26-
{{- $_ := set $options "bootstrapServers" (printf "%s:9092" (printf "%s-kafka" .Release.Name)) }}
24+
{{ if .Values.kafka.enabled }}
25+
{{- $topic := index .Values.kafka.topics 0 }}
26+
application-bundled-kafka.yaml: |
27+
feast:
28+
stream:
29+
type: kafka
30+
options:
31+
topic: {{ $topic.name | quote }}
32+
replicationFactor: {{ $topic.replicationFactor }}
33+
partitions: {{ $topic.partitions }}
34+
{{- if not .Values.kafka.external.enabled }}
35+
bootstrapServers: {{ printf "%s:9092" (printf "%s-kafka" .Release.Name) }}
36+
{{- end }}
2737
{{- end }}
28-
{{- $newConfig := dict "feast" (dict "stream" (dict "type" "kafka" "options" $options))}}
29-
{{- $config := mergeOverwrite $config $newConfig }}
38+
39+
{{- if (index .Values "prometheus-statsd-exporter" "enabled" )}}
40+
application-bundled-statsd.yaml: |
41+
feast:
42+
jobs:
43+
metrics:
44+
enabled: true
45+
type: statsd
46+
host: prometheus-statsd-exporter
47+
port: 9125
3048
{{- end }}
3149

32-
{{- toYaml $config | nindent 4 }}
50+
{{- range $name, $content := .Values.springConfigProfiles }}
51+
application-{{ $name }}.yaml: |
52+
{{- toYaml $content | nindent 4 }}
53+
{{- end }}

0 commit comments

Comments
 (0)