Skip to content

Commit

Permalink
Backport of First cluster grpc service should be NodePort for the sec…
Browse files Browse the repository at this point in the history
…ond cluster to connect into release/1.15.x (#16653)

* backport of commit 9dc24ff

* backport of commit 2fa4ae4

* backport of commit 7cccb2e

* backport of commit 1442c12

---------

Co-authored-by: Vipin John Wilson <37441623+vjwilson1987@users.noreply.github.com>
  • Loading branch information
hc-github-team-consul-core and vjwilson1987 authored Mar 16, 2023
1 parent 89ce3ba commit 11f14d9
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ global:
gossipEncryption:
secretName: consul-gossip-encryption-key
secretKey: key
server:
exposeService:
enabled: true
type: NodePort
nodePort:
## all are random nodePorts and you can set your own
http: 30010
https: 30011
serf: 30012
rpc: 30013
grpc: 30014
ui:
service:
type: NodePort
Expand All @@ -65,6 +76,8 @@ The UI's service type is set to be `NodePort`.
This is needed to connect to servers from another cluster without using the pod IPs of the servers,
which are likely going to change.

Other services are exposed as `NodePort` services and configured with random port numbers. In this example, the `grpc` port is set to `30014`, which enables services to discover Consul servers using gRPC when connecting from another cluster.

To deploy, first generate the Gossip encryption key and save it as a Kubernetes secret.

```shell-session
Expand Down Expand Up @@ -123,6 +136,8 @@ externalServers:
hosts: ["10.0.0.4"]
# The node port of the UI's NodePort service or the load balancer port.
httpsPort: 31557
# Matches the gRPC port of the Consul servers in the first cluster.
grpcPort: 30014
tlsServerName: server.dc1.consul
# The address of the kube API server of this Kubernetes cluster
k8sAuthMethodHost: https://kubernetes.example.com:443
Expand All @@ -147,6 +162,8 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
cluster1-consul-ui NodePort 10.0.240.80 <none> 443:31557/TCP 40h
```

The `grpcPort: 30014` configuration refers to the gRPC port number specified in the `NodePort` configuration in the first cluster.

Set the `externalServer.tlsServerName` to `server.dc1.consul`. This the DNS SAN
(Subject Alternative Name) that is present in the Consul server's certificate.
This is required because the connection to the Consul servers uses the node IP,
Expand Down

0 comments on commit 11f14d9

Please sign in to comment.