Skip to content

Commit

Permalink
feat: Support optional hostPort binding (#167)
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Morton <[email protected]>

Signed-off-by: Kyle Morton <[email protected]>
Co-authored-by: Kyle Morton <[email protected]>
  • Loading branch information
drkfmorton and Kyle Morton authored Dec 12, 2022
1 parent 13d9bfd commit 719a913
Show file tree
Hide file tree
Showing 31 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.externalmqtttrigger}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.externalmqtttrigger}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.httpexport}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.httpexport}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: EDGEX_PROFILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.metricsinfluxdb}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.metricsinfluxdb}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.mqttexport}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.mqttexport}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.rfidllrpinventory}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.rfidllrpinventory}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.appsample}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.appsample}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.appservice.rules}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.appservice.rules}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
args: ["agent", "-ui", "-bootstrap", "-server", "-client", "0.0.0.0"]
ports:
- containerPort: {{.Values.edgex.port.consul}}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.consul}}
hostIP: {{.Values.edgex.hostPortExternalBind}}
{{- end}}
{{- if .Values.edgex.security.enabled }}
env:
- name: EDGEX_USER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.core.command}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.core.command}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.core.data}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.core.data}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.bacnet}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.bacnet}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.gpio}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.gpio}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.modbus}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.modbus}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.mqtt}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.mqtt}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.onvifcamera}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.onvifcamera}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.rest}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.rest}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.rfidllrp}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.rfidllrp}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.snmp}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.snmp}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.usbcamera}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.usbcamera}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.device.virtual}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.device.virtual}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.ekuiper}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.ekuiper}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
# - name: KUIPER__BASIC__DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.core.metadata}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.core.metadata}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.modbussimulator}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.modbussimulator}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
securityContext:
allowPrivilegeEscalation: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.mqttbroker}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.mqttbroker}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
securityContext:
allowPrivilegeEscalation: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.natsserver}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.natsserver}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
securityContext:
allowPrivilegeEscalation: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.support.notifications}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.support.notifications}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
env:
- name: SERVICE_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.support.scheduler}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.support.scheduler}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ spec:
ports:
- containerPort: {{.Values.edgex.port.system}}
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.system}}
hostIP: {{.Values.edgex.hostPortInternalBind}}
{{- end}}
{{- end}}
envFrom:
- configMapRef:
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/templates/edgex-ui/edgex-ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ spec:
imagePullPolicy: {{.Values.edgex.image.ui.pullPolicy}}
ports:
- containerPort: {{.Values.edgex.port.ui}}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: {{.Values.edgex.port.ui}}
hostIP: {{.Values.edgex.hostPortExternalBind}}
{{- end}}
env:
- name: EDGEX_SECURITY_SECRET_STORE
{{- if .Values.edgex.security.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ spec:
ports:
- containerPort: 8200
{{- if not .Values.edgex.security.enabled }}
{{- if .Values.edgex.features.enableHostPort}}
hostPort: 8200
hostIP: 0.0.0.0
{{- end}}
{{- end}}
env:
- name: VAULT_ADDR
Expand Down
1 change: 1 addition & 0 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -580,3 +580,4 @@ edgex:
mqttBrokerAddress: ""
# Writable pipeline functions HTTP export parameter URL
httpExportURL: ""
enableHostPort: false

0 comments on commit 719a913

Please sign in to comment.