Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Add hostPort support to the common chart #116

Open
utkuozdemir opened this issue Dec 27, 2021 · 1 comment
Open

Add hostPort support to the common chart #116

utkuozdemir opened this issue Dec 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@utkuozdemir
Copy link

Details

Helm chart name:
common

Describe the solution you'd like:
Add possibility to specify a hostPort

Anything else you would like to add:
It can be useful

Additional Information:
none

@utkuozdemir
Copy link
Author

Until this gets added, it is possible to get it done when using FluxCD - use postRenderers on your HelmRelease like the following (example for Samba):

 postRenderers:
  - kustomize:
      patchesStrategicMerge:
        - apiVersion: apps/v1
          kind: Deployment
          metadata:
            name: samba
          spec:
            template:
              spec:
                containers:
                  - name: samba
                    ports:
                      - containerPort: 139
                        protocol: TCP
                        hostPort: 139
                      - containerPort: 445
                        protocol: TCP
                        hostPort: 445

Alternatively, using JSON Patch:

patchesJson6902:
  - target:
      group: apps
      version: v1
      kind: Deployment
      name: samba
    patch:
      - op: add
        path: "/spec/template/spec/containers/0/ports/0/hostPort"
        value: 139
      - op: add
        path: "/spec/template/spec/containers/0/ports/1/hostPort"
        value: 445

Both will give the same result.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant