Skip to content

Commit

Permalink
Add service.setAppProtocol: fix problem with Istio
Browse files Browse the repository at this point in the history
  • Loading branch information
matrix-root committed Nov 29, 2021
1 parent a26fafb commit b1a1de7
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/centrifugo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: centrifugo
description: Centrifugo is a scalable real-time messaging server in language-agnostic way
version: 7.2.0
version: 7.2.1
appVersion: 3.1.0
home: https://centrifugal.dev
icon: https://centrifugal.dev/img/favicon.png
Expand Down
3 changes: 3 additions & 0 deletions charts/centrifugo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,20 @@ The following table lists the configurable parameters of the Centrifugo chart an
| `service.clusterIP` | service clusterIP IP | `nil` |
| `service.port` | service port | `8000` |
| `service.nodePort` | K8s service node port | `nil` |
| `service.appProtocol` | Set appProtocol field for port - it could be useful for manually setting protocols for Istio | `nil` |
| `service.useSeparateInternalService` | Use separate service for internal endpoints. It could be useful for configuring same port number for all services. | `false` |
| `service.useSeparateGrpcService` | Use separate service for GRPC endpoints. It could be useful for configuring same port number for all services. | `false` |
| `service.useSeparateUniGrpcService` | Use separate service for GRPC uni stream. It could be useful for configuring same port number for all services. | `false` |
| `internalService.type` | internal (for API, Prometheus metrics, admin web interface, health checks) port service type | `ClusterIP` |
| `internalService.clusterIP` | internal (for API, Prometheus metrics, admin web interface, health checks) service clusterIP IP | `nil` |
| `internalService.port` | internal (for API, Prometheus metrics, admin web interface, health checks) service port | `9000` |
| `internalService.nodePort` | internal (for API, Prometheus metrics, admin web interface, health checks) K8s service node port | `nil` |
| `internalService.appProtocol` | Set appProtocol field for port | `nil` |
| `grpcService.type` | GRPC API port service type | `ClusterIP` |
| `grpcService.clusterIP` | GRPC API service clusterIP IP | `nil` |
| `grpcService.port` | GRPC API service port | `10000` |
| `grpcService.nodePort` | GRPC API K8s service node port | `nil` |
| `grpcService.appProtocol` | Set appProtocol field for port | `nil` |
| `env` | Additional environment variables to be passed to Centrifugo container. | `nil` |
| `config` | Centrifugo configuration, will be transformed into config.json file | `{"admin":true,"engine":"memory","namespaces":[],"v3_use_offset":true}` |
| `existingSecret` | Name of existing secret to use for secret's parameters. The secret has to contain the keys below | `nil` |
Expand Down
3 changes: 3 additions & 0 deletions charts/centrifugo/templates/service-grpc-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
- port: {{ .Values.grpcService.port }}
targetPort: grpc
protocol: TCP
{{- if .Values.grpcService.appProtocol }}
appProtocol: {{ .Values.grpcService.appProtocol }}
{{- end }}
name: grpc
{{- if (and (eq .Values.grpcService.type "NodePort") (not (empty .Values.grpcService.nodePort))) }}
nodePort: {{ .Values.grpcService.nodePort }}
Expand Down
3 changes: 3 additions & 0 deletions charts/centrifugo/templates/service-internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
- port: {{ .Values.internalService.port }}
targetPort: internal
protocol: TCP
{{- if .Values.internalService.appProtocol }}
appProtocol: {{ .Values.internalService.appProtocol }}
{{- end }}
name: internal
{{- if (and (eq .Values.internalService.type "NodePort") (not (empty .Values.internalService.nodePort))) }}
nodePort: {{ .Values.internalService.nodePort }}
Expand Down
3 changes: 3 additions & 0 deletions charts/centrifugo/templates/service-uni-grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
- port: {{ .Values.uniGrpcService.port }}
targetPort: uni-grpc
protocol: TCP
{{- if .Values.uniGrpcService.appProtocol }}
appProtocol: {{ .Values.uniGrpcService.appProtocol }}
{{- end }}
name: uni-grpc
{{- if (and (eq .Values.uniGrpcService.type "NodePort") (not (empty .Values.uniGrpcService.nodePort))) }}
nodePort: {{ .Values.uniGrpcService.nodePort }}
Expand Down
12 changes: 12 additions & 0 deletions charts/centrifugo/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
- port: {{ .Values.service.port }}
targetPort: external
protocol: TCP
{{- if .Values.service.appProtocol }}
appProtocol: {{ .Values.service.appProtocol }}
{{- end }}
name: external
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{ .Values.service.nodePort }}
Expand All @@ -23,6 +26,9 @@ spec:
- port: {{ .Values.internalService.port }}
targetPort: internal
protocol: TCP
{{- if .Values.internalService.appProtocol }}
appProtocol: {{ .Values.internalService.appProtocol }}
{{- end }}
name: internal
{{- if (and (eq .Values.internalService.type "NodePort") (not (empty .Values.internalService.nodePort))) }}
nodePort: {{ .Values.internalService.nodePort }}
Expand All @@ -32,6 +38,9 @@ spec:
- port: {{ .Values.grpcService.port }}
targetPort: grpc
protocol: TCP
{{- if .Values.grpcService.appProtocol }}
appProtocol: {{ .Values.grpcService.appProtocol }}
{{- end }}
name: grpc
{{- if (and (eq .Values.grpcService.type "NodePort") (not (empty .Values.grpcService.nodePort))) }}
nodePort: {{ .Values.grpcService.nodePort }}
Expand All @@ -41,6 +50,9 @@ spec:
- port: {{ .Values.uniGrpcService.port }}
targetPort: uni-grpc
protocol: TCP
{{- if .Values.uniGrpcService.appProtocol }}
appProtocol: {{ .Values.uniGrpcService.appProtocol }}
{{- end }}
name: uni-grpc
{{- if (and (eq .Values.uniGrpcService.type "NodePort") (not (empty .Values.uniGrpcService.nodePort))) }}
nodePort: {{ .Values.uniGrpcService.nodePort }}
Expand Down
9 changes: 9 additions & 0 deletions charts/centrifugo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ service:
##
annotations: {}
##
## Specify custom appProtocol for a service port.
appProtocol: ""
##
## Use separate service for internal endpoints. It could be useful for configuring same port number for all services.
useSeparateInternalService: false
## Use separate service for GRPC API endpoints. It could be useful for configuring same port number for all services.
Expand All @@ -53,6 +56,8 @@ internalService:
# prometheus.io/scrape: "true"
# prometheus.io/path: "/metrics"
# prometheus.io/port: "9000"
## Specify custom appProtocol for a service port.
appProtocol: ""

grpcService:
port: 10000
Expand All @@ -61,6 +66,8 @@ grpcService:
# Static NodePort, if set.
# nodePort: 30102
annotations: {}
## Specify custom appProtocol for a service port.
appProtocol: ""

uniGrpcService:
port: 11000
Expand All @@ -69,6 +76,8 @@ uniGrpcService:
# Static NodePort, if set.
# nodePort: 30103
annotations: {}
## Specify custom appProtocol for a service port.
appProtocol: ""

ingress:
enabled: false
Expand Down

0 comments on commit b1a1de7

Please sign in to comment.