helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[fluentd] add support to nodePort

Open shurikg opened this issue 2 years ago • 8 comments

Provide ability to define specific nodePort value in the service.yaml file

Closes: https://github.com/fluent/helm-charts/issues/233

shurikg avatar Apr 28 '22 08:04 shurikg

Hello @shurikg,

Do you mind to rebsae and update the chart version?

dioguerra avatar Jun 24 '22 12:06 dioguerra

Hello @shurikg,

Do you mind to rebase and update the chart version?

Done

shurikg avatar Jun 26 '22 06:06 shurikg

You need to bump chart version under Chart.yaml!

dioguerra avatar Jun 27 '22 09:06 dioguerra

You need to bump chart version under Chart.yaml!

version bumped

shurikg avatar Jun 28 '22 10:06 shurikg

Your contribution is not working. For me, at least. Can you review?

You need to replace {{- if and ( eq .Values.service.type "NodePort" ) $port.nodePort }} with {{- if and ( eq $.Values.service.type "NodePort" ) $port.nodePort }} and then test with helm template fluentd ../fluentd -n kube-system --set service.type="NodePort" -s templates/service.yaml

dioguerra avatar Jul 04 '22 15:07 dioguerra

@dioguerra you are right, my bad.

Fixed now.

I did the below test:

  1. Create the custom values file with the content
service:
   type: "NodePort"
   ports:
   - name: "test_1"
     protocol: TCP
     containerPort: 24224
     nodePort: 22222
   - name: "test_2"
     protocol: TCP
     containerPort: 32000
  1. Run the helm template fluentd ../fluentd -s templates/service.yaml -f /tmp/cust_values.yaml command and verify that I see nodePort definition under the test_1 port and test_2 port created without nodePort definition as expected.

Output of template command is

---
# Source: fluentd/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: fluentd
  labels:
    helm.sh/chart: fluentd-0.3.10
    app.kubernetes.io/name: fluentd
    app.kubernetes.io/instance: fluentd
    app.kubernetes.io/version: "v1.14.6"
    app.kubernetes.io/managed-by: Helm
spec:
  type: NodePort
  ports:
  - port: 24231
    targetPort: metrics
    protocol: TCP
    name: metrics
  - name: test_1
    port: 24224
    targetPort: 24224
    protocol: TCP
    nodePort: 22222
  - name: test_2
    port: 32000
    targetPort: 32000
    protocol: TCP
  selector:
    app.kubernetes.io/name: fluentd
    app.kubernetes.io/instance: fluentd

shurikg avatar Jul 04 '22 19:07 shurikg

Ok, for me we can merge.

I was thinking we might actually want to split the services into type? so not to expose everything @naseemkullah

dioguerra avatar Jul 07 '22 14:07 dioguerra

+1 really required feature (to create for example a Fluent gateway)

kladiv avatar Aug 10 '23 10:08 kladiv