Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Introduce a parameter to set annotations for the external service #164

Merged
merged 4 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/accessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,18 @@ Cassandra nodes. There are the following options:
the native transport port on the nodes
- EXTERNAL_RPC_PORT="9160" The external port that is forwarded to the rpc port
on the nodes
- EXTERNAL_SERVICE_ANNOTATIONS Annotations that are added to the external
service. E.g., this can be used to configure ExternalDNS access

:warning: The external service definition will at the moment not be deleted if
you set EXTERNAL_NATIVE_TRANSPORT and EXTERNAL_RPC to "false". If you need to
remove external access, you have to remove the external service manually.

### ExternalDNS annotations

The EXTERNAL_SERVICE_ANNOTATIONS parameter can be used to set up ExternalDNS
access when the external service is enabled. For example, one can set

```
EXTERNAL_SERVICE_ANNOTATIONS={"external-dns.alpha.kubernetes.io/hostname": "cassandra.example.org"}
```
1 change: 1 addition & 0 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Allow access to the Cassandra Cluster from outside Kubernetes.
| **EXTERNAL_RPC** | This exposes the Cassandra cluster via an external service so it can be accessed from outside the Kubernetes cluster. Works only if START_RPC is true. | False |
| **EXTERNAL_NATIVE_TRANSPORT_PORT** | The external port to use for Cassandra native transport protocol. | 9042 |
| **EXTERNAL_RPC_PORT** | The external port to use for Cassandra rpc protocol. | 9160 |
| **EXTERNAL_SERVICE_ANNOTATIONS** | Custom annotations for the external service. | |

## <a name="metrics"></a> Metrics Export

Expand Down
8 changes: 8 additions & 0 deletions operator/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ parameters:
default: "9160"
group: external

- name: EXTERNAL_SERVICE_ANNOTATIONS
displayName: "External service annotations"
hint: "Key-Value Pairs of annotations."
type: map
description: "Custom annotations for the external service."
default:
group: external

- name: BOOTSTRAP_TIMEOUT
displayName: "Bootstrap Timeout"
type: string
Expand Down
2 changes: 2 additions & 0 deletions operator/templates/external-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: Service
metadata:
name: {{ .Name }}-svc-external
namespace: {{ .Namespace }}
annotations:
{{ toYaml .Params.EXTERNAL_SERVICE_ANNOTATIONS }}
spec:
type: LoadBalancer
externalTrafficPolicy: Local
Expand Down
8 changes: 8 additions & 0 deletions templates/operator/params.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ parameters:
default: "9160"
group: external

- name: EXTERNAL_SERVICE_ANNOTATIONS
displayName: "External service annotations"
hint: "Key-Value Pairs of annotations."
type: map
description: "Custom annotations for the external service."
default:
group: external

- name: BOOTSTRAP_TIMEOUT
displayName: "Bootstrap Timeout"
type: string
Expand Down