Skip to content

Commit 909ae50

Browse files
committed
allow additional resources
1 parent f579c10 commit 909ae50

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

charts/envoy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: envoy
33
description: |-
44
Helm chart to deploy [envoy](https://www.envoyproxy.io/).
55
type: application
6-
version: 0.0.15
6+
version: 0.0.16
77
appVersion: "v1.18.2"
88
home: https://github.com/slamdev/helm-charts/tree/master/charts/envoy
99
icon: https://www.envoyproxy.io/docs/envoy/latest/_static/envoy-logo.png

charts/envoy/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# envoy
22

3-
![Version: 0.0.15](https://img.shields.io/badge/Version-0.0.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.18.2](https://img.shields.io/badge/AppVersion-v1.18.2-informational?style=flat-square)
3+
![Version: 0.0.16](https://img.shields.io/badge/Version-0.0.16-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.18.2](https://img.shields.io/badge/AppVersion-v1.18.2-informational?style=flat-square)
44

55
Helm chart to deploy [envoy](https://www.envoyproxy.io/).
66

@@ -16,6 +16,7 @@ Helm chart to deploy [envoy](https://www.envoyproxy.io/).
1616

1717
| Key | Type | Default | Description |
1818
|-----|------|---------|-------------|
19+
| additionalResources | list | `[]` | list of additional resources to create (are processed via `tpl` function) |
1920
| affinity | object | `{}` | affinity for scheduler pod assignment |
2021
| args | list | `[]` | extra args to pass to container |
2122
| configYaml | string | `"admin:\n access_log_path: /tmp/admin_access.log\n address:\n socket_address:\n protocol: TCP\n address: 0.0.0.0\n port_value: 9901\nstatic_resources:\n listeners:\n - name: listener_0\n address:\n socket_address:\n protocol: TCP\n address: 0.0.0.0\n port_value: 10000\n filter_chains:\n - filters:\n - name: envoy.filters.network.http_connection_manager\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager\n stat_prefix: ingress_http\n access_log:\n - name: envoy.access_loggers.file\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog\n # For the demo config in the Docker container we use:\n # - system logs -> `/dev/stderr`\n # - (listener) access_logs -> `/dev/stdout`\n path: /dev/stdout\n route_config:\n name: local_route\n virtual_hosts:\n - name: local_service\n domains: [\"*\"]\n routes:\n - match:\n prefix: \"/\"\n route:\n host_rewrite_literal: www.envoyproxy.io\n cluster: service_envoyproxy_io\n http_filters:\n - name: envoy.filters.http.router\n clusters:\n - name: service_envoyproxy_io\n connect_timeout: 30s\n type: LOGICAL_DNS\n # Comment out the following line to test on v6 networks\n dns_lookup_family: V4_ONLY\n lb_policy: ROUND_ROBIN\n load_assignment:\n cluster_name: service_envoyproxy_io\n endpoints:\n - lb_endpoints:\n - endpoint:\n address:\n socket_address:\n address: www.envoyproxy.io\n port_value: 443\n transport_socket:\n name: envoy.transport_sockets.tls\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext\n sni: www.envoyproxy.io"` | config yaml |

charts/envoy/templates/_helpers.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,13 @@ Create the tag for the docker image to use
6868
{{- define "envoy.tag" -}}
6969
{{- .Values.image.tag | default .Chart.AppVersion -}}
7070
{{- end -}}
71+
72+
{{/*
73+
envoy.rawResource will create a resource template that can be
74+
merged with each item in `.Values.additionalResources`.
75+
*/}}
76+
{{- define "envoy.rawResource" -}}
77+
metadata:
78+
labels:
79+
{{- include "envoy.labels" . | nindent 4 }}
80+
{{- end }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{- $template := fromYaml (include "envoy.rawResource" .) -}}
2+
{{- range $i, $t := .Values.additionalResources }}
3+
---
4+
{{ toYaml (merge (tpl $t $ | fromYaml) $template) -}}
5+
{{- end }}

charts/envoy/values.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,24 @@ containerPorts:
147147
# containerPort -- container port, should match admin port_value from config.yaml
148148
containerAdminPort: 9901
149149

150+
# additionalResources -- list of additional resources to create (are processed via `tpl` function)
151+
additionalResources: []
152+
# - |
153+
# apiVersion: v1
154+
# kind: ConfigMap
155+
# metadata:
156+
# name: {{ include "envoy.fullname" . }}-cm
157+
# namespace: {{ .Release.Namespace }}
158+
#
159+
# - |
160+
# apiVersion: v1
161+
# kind: Secret
162+
# metadata:
163+
# name: {{ include "envoy.fullname" . }}-s
164+
# namespace: {{ .Release.Namespace }}
165+
# stringData:
166+
# mykey: my-value
167+
150168
# configYaml -- config yaml
151169
configYaml: |-
152170
admin:

0 commit comments

Comments
 (0)