Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support user specified annotation for service name resolution override #111

Merged
merged 5 commits into from
Aug 24, 2023
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
17 changes: 9 additions & 8 deletions credentials-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Parameters

## Global parameters
| Key | Description | Default |
|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `global.spire.serverServiceName` | If deployed with SPIRE, this key specifies SPIRE-server's service name. You should use either this **OR** `spire.serverAddress` (not both). | |
| `global.allowGetAllResources` | If defined overrides `allowGetAllResources`. | | | `false` |
| `global.commonAnnotations` | Annotations to add to all deployed objects | {} |
| `global.commonLabels` | Labels to add to all deployed objects | {} |
| `global.podAnnotations` | Annotations to add to all deployed pods | {} |
| `global.podLabels` | Labels to add to all deployed pods | {} |
| Key | Description | Default |
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `global.spire.serverServiceName` | If deployed with SPIRE, this key specifies SPIRE-server's service name. You should use either this **OR** `spire.serverAddress` (not both). | |
| `global.allowGetAllResources` | If defined overrides `allowGetAllResources`. | | | `false` |
| `global.commonAnnotations` | Annotations to add to all deployed objects | {} |
| `global.commonLabels` | Labels to add to all deployed objects | {} |
| `global.podAnnotations` | Annotations to add to all deployed pods | {} |
| `global.podLabels` | Labels to add to all deployed pods | {} |
| `global.serviceNameOverrideAnnotationName` | Which annotation to use (in the [service name resolution algorithm](https://docs.otterize.com/reference/service-identities#kubernetes-service-identity-resolution)) for setting a pod's service name, if not the default. Use this if you already have annotations on your pods that provide the correct service name. | `intents.otterize.com/service-name` |


## SPIRE parameters
Expand Down
4 changes: 4 additions & 0 deletions credentials-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ spec:
name: intents-operator-otterize-cloud-client-secret
key: otterize-cloud-client-secret
{{ end }}
{{ if .Values.global.serviceNameOverrideAnnotationName }}
- name: OTTERIZE_SERVICE_NAME_OVERRIDE_ANNOTATION
value: {{ .Values.global.serviceNameOverrideAnnotationName | quote }}
{{ end }}
{{ if .Values.global.otterizeCloud.apiExtraCAPEMSecret }}
- name: OTTERIZE_API_EXTRA_CA_PEM
value: {{ template "otterize.operator.apiExtraCAPEM" }}
Expand Down
4 changes: 4 additions & 0 deletions credentials-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ global:
commonLabels: {}
# Annotations to add to all deployed objects
commonAnnotations: {}

# Specify an annotation name that by setting it, one can override otterize's service name resolution.
serviceNameOverrideAnnotationName: intents.otterize.com/service-name

kubebuilder_rbac_proxy:
image: otterize/kubebuilder-kube-rbac-proxy
tag: v0.11.0
Expand Down
17 changes: 9 additions & 8 deletions intents-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Parameters

## Global parameters
| Key | Description | Default |
|-------------------------------|----------------------------------------------------------------------|---------|
| `global.allowGetAllResources` | If defined overrides `allowGetAllResources`. | |
| `global.telemetry.enabled` | If set to `false`, anonymous telemetries collection will be disabled | `true` |
| Key | Description | Default |
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `global.allowGetAllResources` | If defined overrides `allowGetAllResources`. | |
| `global.telemetry.enabled` | If set to `false`, anonymous telemetries collection will be disabled | `true` |
| `global.commonAnnotations` | Annotations to add to all deployed objects | {} |
| `global.commonLabels` | Labels to add to all deployed objects | {} |
| `global.podAnnotations` | Annotations to add to all deployed pods | {} |
| `global.podLabels` | Labels to add to all deployed pods | {} |
| `global.serviceNameOverrideAnnotationName` | Which annotation to use (in the [service name resolution algorithm](https://docs.otterize.com/reference/service-identities#kubernetes-service-identity-resolution)) for setting a pod's service name, if not the default. Use this if you already have annotations on your pods that provide the correct service name. | `intents.otterize.com/service-name` |

## Operator parameters
| Key | Description | Default |
Expand Down Expand Up @@ -42,10 +47,6 @@
| `global.otterizeCloud.credentials.secretKeyRef.secretKey` | If specified, the key for the clientSecret in a pre-created Kubernetes Secret to be used instead of creating a secret with the value of clientSecret. | `(none)` |
| `global.otterizeCloud.apiAddress` | Overrides Otterize Cloud default API address. | `(none)` |
| `global.otterizeCloud.apiExtraCAPEMSecret` | The name of a secret containing a single `CA.pem` file for an extra root CA used to connect to Otterize Cloud. The secret should be placed in the same namespace as the Otterize deployment. | `(none)` |
| `global.commonAnnotations` | Annotations to add to all deployed objects | {} |
| `global.commonLabels` | Labels to add to all deployed objects | {} |
| `global.podAnnotations` | Annotations to add to all deployed pods | {} |
| `global.podLabels` | Labels to add to all deployed pods | {} |


## Common parameters
Expand Down
4 changes: 4 additions & 0 deletions intents-operator/templates/intents-operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ spec:
- name: OTTERIZE_API_EXTRA_CA_PEM
value: {{ template "otterize.operator.apiExtraCAPEM" }}
{{ end }}
{{ if .Values.global.serviceNameOverrideAnnotationName }}
- name: OTTERIZE_SERVICE_NAME_OVERRIDE_ANNOTATION
value: {{ .Values.global.serviceNameOverrideAnnotationName | quote }}
{{ end }}
volumeMounts:
- mountPath: /controller_manager_config.yaml
name: manager-config
Expand Down
4 changes: 4 additions & 0 deletions intents-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ global:
commonLabels: {}
# Annotations to add to all deployed objects
commonAnnotations: {}

# Specify an annotation name that by setting it, one can override otterize's service name resolution.
serviceNameOverrideAnnotationName: intents.otterize.com/service-name

kubebuilder_rbac_proxy:
image: otterize/kubebuilder-kube-rbac-proxy
tag: v0.11.0
Expand Down
17 changes: 9 additions & 8 deletions network-mapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@
| `global.otterizeCloud.apiExtraCAPEMSecret` | The name of a secret containing a single `CA.pem` file for an extra root CA used to connect to Otterize Cloud. The secret should be placed in the same namespace as the Otterize deployment. | `(none)` |

## Global parameters
| Key | Description | Default |
|-------------------------------|----------------------------------------------------------------------|---------|
| `global.allowGetAllResources` | If defined overrides `allowGetAllResources`. | |
| `global.telemetry.enabled` | If set to `false`, anonymous telemetries collection will be disabled | `true` |
| `global.commonAnnotations` | Annotations to add to all deployed objects | {} |
| `global.commonLabels` | Labels to add to all deployed objects | {} |
| `global.podAnnotations` | Annotations to add to all deployed pods | {} |
| `global.podLabels` | Labels to add to all deployed pods | {} |
| Key | Description | Default |
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `global.allowGetAllResources` | If defined overrides `allowGetAllResources`. | |
| `global.telemetry.enabled` | If set to `false`, anonymous telemetries collection will be disabled | `true` |
| `global.commonAnnotations` | Annotations to add to all deployed objects | {} |
| `global.commonLabels` | Labels to add to all deployed objects | {} |
| `global.podAnnotations` | Annotations to add to all deployed pods | {} |
| `global.podLabels` | Labels to add to all deployed pods | {} |
| `global.serviceNameOverrideAnnotationName` | Which annotation to use (in the [service name resolution algorithm](https://docs.otterize.com/reference/service-identities#kubernetes-service-identity-resolution)) for setting a pod's service name, if not the default. Use this if you already have annotations on your pods that provide the correct service name. | `intents.otterize.com/service-name` |


## Common parameters
Expand Down
4 changes: 4 additions & 0 deletions network-mapper/templates/istio-watcher-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,9 @@ spec:
value: http://{{ template "otterize.mapper.fullName" . }}:9090/query
- name: OTTERIZE_DEBUG
value: {{ .Values.debug | quote }}
{{ if .Values.global.serviceNameOverrideAnnotationName }}
- name: OTTERIZE_SERVICE_NAME_OVERRIDE_ANNOTATION
value: {{ .Values.global.serviceNameOverrideAnnotationName | quote }}
{{ end }}
serviceAccountName: {{ template "otterize.istiowatcher.fullName" . }}
{{ end }}
4 changes: 4 additions & 0 deletions network-mapper/templates/kafka-watcher-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,9 @@ spec:
- name: OTTERIZE_KAFKA_SERVERS
value: {{ join " " .Values.kafkawatcher.kafkaServers }}
{{ end }}
{{ if .Values.global.serviceNameOverrideAnnotationName }}
- name: OTTERIZE_SERVICE_NAME_OVERRIDE_ANNOTATION
value: {{ .Values.global.serviceNameOverrideAnnotationName | quote }}
{{ end }}
serviceAccountName: {{ template "otterize.kafkawatcher.fullName" . }}
{{ end }}
4 changes: 4 additions & 0 deletions network-mapper/templates/mapper-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ spec:
- name: OTTERIZE_API_ADDRESS
value: "{{ .Values.global.otterizeCloud.apiAddress }}"
{{ end }}
{{ if .Values.global.serviceNameOverrideAnnotationName }}
- name: OTTERIZE_SERVICE_NAME_OVERRIDE_ANNOTATION
value: {{ .Values.global.serviceNameOverrideAnnotationName | quote }}
{{ end }}
{{ if .Values.global.otterizeCloud.credentials.clientId }}
- name: OTTERIZE_CLIENT_ID
value: "{{ .Values.global.otterizeCloud.credentials.clientId }}"
Expand Down
Loading
Loading