Skip to content

Commit

Permalink
feat(vector): Support enable for both the normal and headless service (
Browse files Browse the repository at this point in the history
…#257)

* feat(vector): Support configuration for both the normal and headless service

The headless service can be disabled and configured separately, but the default behavior will be to reuse the config from the service.

Signed-off-by: Spencer Gilbert <[email protected]>

* per service enablement

Signed-off-by: Spencer Gilbert <[email protected]>

Signed-off-by: Spencer Gilbert <[email protected]>
  • Loading branch information
spencergilbert authored Oct 20, 2022
1 parent 42bf5b0 commit 9842060
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/vector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: vector
version: "0.16.4"
version: "0.17.0"
kubeVersion: ">=1.15.0-0"
description: A lightweight, ultra-fast tool for building observability pipelines
type: application
Expand Down
7 changes: 4 additions & 3 deletions charts/vector/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vector

![Version: 0.16.4](https://img.shields.io/badge/Version-0.16.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.24.1-distroless-libc](https://img.shields.io/badge/AppVersion-0.24.1--distroless--libc-informational?style=flat-square)
![Version: 0.17.0](https://img.shields.io/badge/Version-0.17.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.24.1-distroless-libc](https://img.shields.io/badge/AppVersion-0.24.1--distroless--libc-informational?style=flat-square)

[Vector](https://vector.dev/) is a high-performance, end-to-end observability data pipeline that puts you in control of your observability data. Collect, transform, and route all your logs, metrics, and traces to any vendors you want today and any other vendors you may want tomorrow. Vector enables dramatic cost reduction, novel data enrichment, and data security where you need it, not where is most convenient for your vendors.

Expand Down Expand Up @@ -135,13 +135,13 @@ helm install --name <RELEASE_NAME> \
| command | list | `[]` | Override Vector's default command |
| commonLabels | object | `{}` | Add additional labels to all created resources |
| containerPorts | list | `[]` | Manually define Vector's Container ports, overrides automated generation of Container ports |
| customConfig | object | `{}` | Override Vector's default configs, if used **all** options need to be specified # This section supports using helm templates to populate dynamic values # Ref: https://vector.dev/docs/reference/configuration/ |
| customConfig | object | `{}` | Override Vector's default configs, if used **all** options need to be specified. This section supports using helm templates to populate dynamic values. # Ref: https://vector.dev/docs/reference/configuration/ |
| dataDir | string | `""` | Specify the path for Vector's data, only used when existingConfigMaps are used |
| dnsConfig | object | `{}` | Specify DNS configuration options for Vector Pods # Ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config |
| dnsPolicy | string | `"ClusterFirst"` | Specify DNS policy for Vector Pods # Ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy |
| env | list | `[]` | Set environment variables in Vector containers # The examples below leverage examples from secrets.generic and assume no name overrides with a Release name of "vector" |
| envFrom | list | `[]` | Define environment variables from Secrets or ConfigMaps |
| existingConfigMaps | list | `[]` | List of existing ConfigMaps for Vector's configuration instead of creating a new one, if used requires dataDir to be set. Additionally, containerPorts and service.ports should be specified based on your supplied configuration # If set, this parameter takes precedence over customConfig and the chart's default configs |
| existingConfigMaps | list | `[]` | List of existing ConfigMaps for Vector's configuration instead of creating a new one, if used requires dataDir to be set. Additionally, containerPorts, service.ports, and serviceHeadless.ports should be specified based on your supplied configuration If set, this parameter takes precedence over customConfig and the chart's default configs |
| extraContainers | list | `[]` | Extra Containers to be added to the Vector Pod |
| extraVolumeMounts | list | `[]` | Additional Volume to mount into Vector Containers |
| extraVolumes | list | `[]` | Additional Volumes to use with Vector Pods |
Expand Down Expand Up @@ -204,6 +204,7 @@ helm install --name <RELEASE_NAME> \
| serviceAccount.automountToken | bool | `true` | Automount API credentials for the Vector ServiceAccount |
| serviceAccount.create | bool | `true` | If true, create ServiceAccount |
| serviceAccount.name | string | `nil` | The name of the ServiceAccount to use. # If not set and create is true, a name is generated using the fullname template |
| serviceHeadless.enabled | bool | `true` | If true, create and use a Headless Service resource |
| terminationGracePeriodSeconds | int | `60` | Override Vector's terminationGracePeriodSeconds |
| tolerations | list | `[]` | Allow Vector to schedule on tainted nodes |
| updateStrategy | object | `{}` | Customize the updateStrategy used to replace Vector Pods # Also used for the DeploymentStrategy for Stateless-Aggregators # Valid options are used depending on the chosen role # Agent (DaemonSetUpdateStrategy): https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/daemon-set-v1/#DaemonSetSpec) # Aggregator (StatefulSetUpdateStrategy): https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/stateful-set-v1/#StatefulSetSpec # Stateless-Aggregator (DeploymentStrategy): https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/deployment-v1/ |
Expand Down
8 changes: 8 additions & 0 deletions charts/vector/ci/serviceHeadless-disabled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Separately disable the Headless Service
## Values file for testing separate enabling for service and serviceHeadless.

service:
enabled: true
serviceHeadless:
enabled: false

1 change: 0 additions & 1 deletion charts/vector/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ spec:
{{- end }}
{{- end }}
{{- end }}

61 changes: 60 additions & 1 deletion charts/vector/templates/service-headless.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
{{- if .Values.service.enabled }}
{{/*
TODO: Remove outer "if/elseif"
*/}}
{{- if .Values.serviceHeadless }}
{{- if .Values.serviceHeadless.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "vector.fullname" . }}-headless
labels:
{{- include "vector.labels" . | nindent 4 }}
annotations:
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
ports:
{{- if or .Values.service.ports .Values.existingConfigMaps }}
{{- toYaml .Values.service.ports | nindent 4 }}
{{- else if .Values.customConfig }}
{{- include "vector.ports" . | indent 4 }}
{{- else }}
- name: datadog-agent
port: 8282
protocol: TCP
- name: fluent
port: 24224
protocol: TCP
- name: logstash
port: 5044
protocol: TCP
- name: splunk-hec
port: 8080
protocol: TCP
- name: statsd
port: 8125
protocol: TCP
- name: syslog
port: 9000
protocol: TCP
- name: vector
port: 6000
protocol: TCP
- name: prom-exporter
port: 9090
protocol: TCP
{{- end }}
selector:
{{- include "vector.selectorLabels" . | nindent 4 }}
type: ClusterIP
{{- with or .Values.service.topologyKeys }}
topologyKeys:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{/*
Allow for clean upgrade from 0.16.3 -> 0.17.0
*/}}
{{- else if .Values.service.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down
13 changes: 9 additions & 4 deletions charts/vector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ service:
# service.ports -- Manually set Service ports, overrides automated generation of Service ports
ports: []

## Configuration for Vector's Headless Service
serviceHeadless:
# serviceHeadless.enabled -- If true, create and use a Headless Service resource
enabled: true

## Configuration for Vector's Ingress
ingress:
# ingress.enabled -- If true, create and use an Ingress resource
Expand Down Expand Up @@ -250,15 +255,15 @@ ingress:
# - chart-example.local

# existingConfigMaps -- List of existing ConfigMaps for Vector's configuration instead of creating a new one, if used requires dataDir to be set.
# Additionally, containerPorts and service.ports should be specified based on your supplied configuration
## If set, this parameter takes precedence over customConfig and the chart's default configs
# Additionally, containerPorts, service.ports, and serviceHeadless.ports should be specified based on your supplied configuration
# If set, this parameter takes precedence over customConfig and the chart's default configs
existingConfigMaps: []

# dataDir -- Specify the path for Vector's data, only used when existingConfigMaps are used
dataDir: ""

# customConfig -- Override Vector's default configs, if used **all** options need to be specified
## This section supports using helm templates to populate dynamic values
# customConfig -- Override Vector's default configs, if used **all** options need to be specified.
# This section supports using helm templates to populate dynamic values.
## Ref: https://vector.dev/docs/reference/configuration/
customConfig: {}
# data_dir: /vector-data-dir
Expand Down

0 comments on commit 9842060

Please sign in to comment.