Skip to content

Commit

Permalink
switch to hostPort for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jkruke committed Oct 30, 2024
1 parent 5b5fa0f commit a3e0d3b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions operations/helm/charts/alloy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,16 @@ container. The list of available arguments is documented on [alloy run][].

`alloy.extraPorts` allows for configuring specific open ports.

The detained specification of ports can be found at the [Kubernetes Pod documents](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports).
The detained specification of ports for pods and services can be found at the
[Kubernetes Pod documents](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports) and
[Kubernetes Service documents](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec)

Port numbers specified must be 0 < x < 65535.

| ChartPort | KubePort | Description |
|-----------|----------|-------------|
| targetPort | containerPort | Number of port to expose on the pod's IP address. |
| port | port | (Optional) Number of port to expose on the host. Daemonsets taking traffic might find this useful. |
| hostPort | hostPort | Number of port to expose on the host and by the service. This is optional if not using a service. Daemonsets taking traffic might find this useful. |
| name | name | If specified, this must be an `IANA_SVC_NAME` and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.
| protocol | protocol | Must be UDP, TCP, or SCTP. Defaults to "TCP". |
| appProtocol | appProtocol | Hint on application protocol. This is used to expose Alloy externally on OpenShift clusters using "h2c". Optional. No default value. |
Expand Down
6 changes: 4 additions & 2 deletions operations/helm/charts/alloy/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ container. The list of available arguments is documented on [alloy run][].

`alloy.extraPorts` allows for configuring specific open ports.

The detained specification of ports can be found at the [Kubernetes Pod documents](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports).
The detained specification of ports for pods and services can be found at the
[Kubernetes Pod documents](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports) and
[Kubernetes Service documents](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec)

Port numbers specified must be 0 < x < 65535.

| ChartPort | KubePort | Description |
|-----------|----------|-------------|
| targetPort | containerPort | Number of port to expose on the pod's IP address. |
| port | port | (Optional) Number of port to expose on the host. Daemonsets taking traffic might find this useful. |
| hostPort | hostPort | Number of port to expose on the host and by the service. This is optional if not using a service. Daemonsets taking traffic might find this useful. |
| name | name | If specified, this must be an `IANA_SVC_NAME` and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.
| protocol | protocol | Must be UDP, TCP, or SCTP. Defaults to "TCP". |
| appProtocol | appProtocol | Hint on application protocol. This is used to expose Alloy externally on OpenShift clusters using "h2c". Optional. No default value. |
Expand Down
2 changes: 1 addition & 1 deletion operations/helm/charts/alloy/ci/extra-ports-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
alloy:
extraPorts:
- name: jaeger-thrift
port: 14268
hostPort: 14268
targetPort: 14268
protocol: TCP
2 changes: 1 addition & 1 deletion operations/helm/charts/alloy/ci/faro-ingress-values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
alloy:
extraPorts:
- name: "faro"
port: 12347
hostPort: 12347
targetPort: 12347
protocol: "TCP"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
protocol: "TCP"
{{- range $portMap := $values.extraPorts }}
- name: {{ $portMap.name }}
port: {{ $portMap.port }}
port: {{ $portMap.hostPort }}
targetPort: {{ $portMap.targetPort }}
protocol: {{ coalesce $portMap.protocol "TCP" }}
{{- if not (empty $portMap.appProtocol) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
name: http-metrics
{{- range $portMap := $values.extraPorts }}
- containerPort: {{ $portMap.targetPort }}
port: {{ $portMap.port }}
{{- if $portMap.hostPort }}
hostPort: {{ $portMap.hostPort }}
{{- end}}
name: {{ $portMap.name }}
protocol: {{ coalesce $portMap.protocol "TCP" }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion operations/helm/charts/alloy/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
protocol: "TCP"
{{- range $portMap := $values.extraPorts }}
- name: {{ $portMap.name }}
port: {{ $portMap.port }}
port: {{ $portMap.hostPort }}
targetPort: {{ $portMap.targetPort }}
protocol: {{ coalesce $portMap.protocol "TCP" }}
{{- if not (empty $portMap.appProtocol) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ spec:
- containerPort: 12345
name: http-metrics
- containerPort: 14268
hostPort: 14268
name: jaeger-thrift
protocol: TCP
readinessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ spec:
- containerPort: 12345
name: http-metrics
- containerPort: 12347
hostPort: 12347
name: faro
protocol: TCP
readinessProbe:
Expand Down

0 comments on commit a3e0d3b

Please sign in to comment.