Merge pull request #2 from truenas/new-version

Introduce support for host networking / host ports
This commit is contained in:
Waqar Ahmed 2020-11-09 04:50:12 +05:00 committed by GitHub
commit 4d49433f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 40 additions and 2 deletions

View File

@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2010.0.1
version: 2010.0.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to

View File

@ -30,6 +30,8 @@ their default values.
| `externalInterfaces` | Add external interfaces in the pod | `null` |
| `dnsPolicy` | Specify DNS Policy for pod | `Default` |
| `dnsConfig` | Specify custom DNS configuration which will be applied to the pod | `{"nameservers": [], "searches": []}` |
| `hostNetwork` | Use host network for workload ( similar to docker host networking ) | `false` |
| `hostPortsList` | Specify ports of host and workload to forward traffic from host port to workload port. | `null` |
| `portForwardingList` | Specify ports of node and workload to forward traffic from node port to workload port | `null` |
| `hostPathVolumes` | Specify host paths to be used as hostpath volumes for the workload | `null` |
| `volumes` | Specify `ix_volumes` | `null` |

View File

@ -293,6 +293,36 @@ questions:
schema:
type: string
- variable: hostNetwork
label: "Provide access to node network namespace for the workload"
group: "Networking"
schema:
type: boolean
default: false
- variable: hostPortsList
label: "Specify host ports for the workload"
description: "Only use host ports if scaling of a workload is not required"
schema:
show_if: [["updateStrategy", "=", "Recreate"]]
type: list
items:
- variable: hostPortConfiguration
label: "Host Port Configuration"
schema:
type: dict
attrs:
- variable: containerPort
label: "Container Port"
schema:
type: string
required: true
- variable: hostPort
label: "Host Port"
schema:
type: string
required: true
- variable: portForwardingList
label: "Specify Node ports to forward to workload"
group: "Networking"

View File

@ -53,11 +53,15 @@ livenessProbe:
Container Ports
*/}}
{{- define "containerPorts" }}
{{- if .Values.portForwardingList }}
{{- if or .Values.portForwardingList .Values.hostPortsList }}
ports:
{{- range $index, $config := .Values.portForwardingList }}
- containerPort: {{ $config.containerPort }}
{{- end }}
{{- range $index, $config := .Values.hostPortsList }}
- containerPort: {{ $config.containerPort }}
hostPort: {{ $config.hostPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -51,6 +51,7 @@ Pod specification
*/}}
{{- define "podSepc" }}
restartPolicy: {{ template "restartPolicy" . }}
hostNetwork: {{ .Values.hostNetwork }}
containers:
- name: {{ .Chart.Name }}
{{- include "volumeMountsConfiguration" . | indent 2}}

View File

@ -13,6 +13,7 @@ spec:
targetPort: {{ $config.containerPort }}
protocol: {{ $config.protocol }}
nodePort: {{ $config.nodePort }}
name: ix-{{ $.Release.Name }}-{{ $config.nodePort }}-{{ $index }}
{{- end }}
selector:
{{- include "ix-chart.selectorLabels" . | nindent 4 }}