Skip to content

Commit

Permalink
Use single keys endpoint for Catalog API (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgopanenko authored Mar 10, 2023
1 parent 772e0ff commit 2aec610
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 78 deletions.
7 changes: 1 addition & 6 deletions charts/catalog-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/search) to learn abo
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| `keys.url` | URL of the Keys service, ex: http://{keys-api}.svc. This URL should be accessible from all the pods within your Kubernetes cluster. **Required** | `""` |
| `keys.requestTimeout` | Timeout for requests to the Keys API | `5s` |
| `keys.tokens.places` | Places API key | `""` |
| `keys.tokens.geocoder` | Geocoder API key | `""` |
| `keys.tokens.suggest` | Suggest API key | `""` |
| `keys.tokens.categories` | Categories API key | `""` |
| `keys.tokens.regions` | Regions API key | `""` |
| `keys.tokens.markers` | Markers API key | `""` |
| `keys.token` | Key Service API key | `""` |

### License settings

Expand Down
43 changes: 2 additions & 41 deletions charts/catalog-api/templates/helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -116,50 +116,11 @@ onprem
value: "{{ required "A valid .Values.keys.url entry required" .Values.keys.url }}"
- name: CATALOG_KEYS_REQUEST_TIMEOUT
value: "{{ .Values.keys.requestTimeout }}"
- name: CATALOG_KEYS_SERVICE_CATALOG_KEY
value: ""
{{- if .Values.keys.tokens.places }}
- name: CATALOG_KEYS_SERVICE_PLACES_KEY
- name: CATALOG_KEYS_SERVICE_KEY
valueFrom:
secretKeyRef:
name: {{ include "catalog.secret.deploys.name" . }}
key: keysServicePlaces
{{- end }}
{{- if .Values.keys.tokens.geocoder }}
- name: CATALOG_KEYS_SERVICE_GEOCODER_KEY
valueFrom:
secretKeyRef:
name: {{ include "catalog.secret.deploys.name" . }}
key: keysServiceGeocoder
{{- end }}
{{- if .Values.keys.tokens.suggest }}
- name: CATALOG_KEYS_SERVICE_SUGGEST_KEY
valueFrom:
secretKeyRef:
name: {{ include "catalog.secret.deploys.name" . }}
key: keysServiceSuggest
{{- end }}
{{- if .Values.keys.tokens.categories }}
- name: CATALOG_KEYS_SERVICE_CATEGORIES_KEY
valueFrom:
secretKeyRef:
name: {{ include "catalog.secret.deploys.name" . }}
key: keysServiceCategories
{{- end }}
{{- if .Values.keys.tokens.regions }}
- name: CATALOG_KEYS_SERVICE_REGIONS_KEY
valueFrom:
secretKeyRef:
name: {{ include "catalog.secret.deploys.name" . }}
key: keysServiceRegions
{{- end }}
{{- if .Values.keys.tokens.markers }}
- name: CATALOG_KEYS_SERVICE_MARKERS_KEY
valueFrom:
secretKeyRef:
name: {{ include "catalog.secret.deploys.name" . }}
key: keysServiceMarkers
{{- end }}
key: keysServiceToken
{{- end }}

{{- define "catalog.env.license" -}}
Expand Down
19 changes: 2 additions & 17 deletions charts/catalog-api/templates/secret-deploys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ metadata:
type: Opaque
data:
apiDbPassword: {{ required "A valid .Values.api.postgres.password entry required" .Values.api.postgres.password | b64enc }}
{{- with .Values.keys.tokens.places }}
keysServicePlaces: {{ . | b64enc }}
{{- end }}
{{- with .Values.keys.tokens.geocoder }}
keysServiceGeocoder: {{ . | b64enc }}
{{- end }}
{{- with .Values.keys.tokens.suggest }}
keysServiceSuggest: {{ . | b64enc }}
{{- end }}
{{- with .Values.keys.tokens.categories }}
keysServiceCategories: {{ . | b64enc }}
{{- end }}
{{- with .Values.keys.tokens.regions }}
keysServiceRegions: {{ . | b64enc }}
{{- end }}
{{- with .Values.keys.tokens.markers }}
keysServiceMarkers: {{ . | b64enc }}
{{- with .Values.keys.token }}
keysServiceToken: {{ . | b64enc }}
{{- end }}
16 changes: 2 additions & 14 deletions charts/catalog-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,12 @@ search:

# @param keys.url URL of the Keys service, ex: http://{keys-api}.svc. This URL should be accessible from all the pods within your Kubernetes cluster. **Required**
# @param keys.requestTimeout Timeout for requests to the Keys API
# @param keys.tokens.places Places API key
# @param keys.tokens.geocoder Geocoder API key
# @param keys.tokens.suggest Suggest API key
# @param keys.tokens.categories Categories API key
# @param keys.tokens.regions Regions API key
# @param keys.tokens.markers Markers API key
# @param keys.token Keys service API key

keys:
url: ''
requestTimeout: 5s
tokens:
places: ''
geocoder: ''
suggest: ''
categories: ''
regions: ''
markers: ''

token: ''

# @section License settings

Expand Down

0 comments on commit 2aec610

Please sign in to comment.