Skip to content

Commit

Permalink
spotless apply
Browse files Browse the repository at this point in the history
  • Loading branch information
bennsimon committed Nov 9, 2022
1 parent 3c4262e commit b6b664f
Show file tree
Hide file tree
Showing 13 changed files with 228 additions and 20 deletions.
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v2
name: fhir-access-proxy
description: |
Expand Down
56 changes: 36 additions & 20 deletions charts/fhir-access-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# FHIR Access Proxy

[FHIR Access Proxy](../../README.md) is a simple access-control proxy that sits in front of FHIR store and server and controls access to FHIR resources.
[FHIR Access Proxy](../../README.md) is a simple access-control proxy that sits
in front of FHIR store and server and controls access to FHIR resources.

## TL;DR

Expand All @@ -11,12 +12,14 @@ helm install fhir-access-proxy fhir-access-proxy/opensrp-fhir-access-proxy

## Introduction

This chart bootstraps [fhir access proxy](../../README.md) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
This chart bootstraps [fhir access proxy](../../README.md) deployment on a
[Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh)
package manager.

## Prerequisites

* Kubernetes 1.12+
* Helm 3.1.0
- Kubernetes 1.12+
- Helm 3.1.0

## Installing the Chart

Expand All @@ -35,16 +38,18 @@ To uninstall/delete the `fhir-access-proxy` deployment:
helm delete fhir-access-proxy
```

The command removes all the Kubernetes components associated with the chart and deletes the release.
The command removes all the Kubernetes components associated with the chart and
deletes the release.

## Parameters

The following table lists the configurable parameters of the fhir access proxy chart and their default values.
The following table lists the configurable parameters of the fhir access proxy
chart and their default values.

## Common Parameters

| Parameter | Description | Default |
|----------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `replicaCount` | | `1` |
| `image.repository` | | `"opensrp/fhir-access-proxy"` |
| `image.pullPolicy` | | `"IfNotPresent"` |
Expand Down Expand Up @@ -74,9 +79,9 @@ The following table lists the configurable parameters of the fhir access proxy c
| `tolerations` | | `[]` |
| `affinity` | | `{}` |
| `recreatePodsWhenConfigMapChange` | | `true` |
| `livenessProbe.httpGet.path` | | `"/"` |
| `livenessProbe.httpGet.path` | | `"/.well-known/smart-configuration"` |
| `livenessProbe.httpGet.port` | | `"http"` |
| `readinessProbe.httpGet.path` | | `"/"` |
| `readinessProbe.httpGet.path` | | `"/.well-known/smart-configuration"` |
| `readinessProbe.httpGet.port` | | `"http"` |
| `initContainers` | | `null` |
| `volumes` | | `null` |
Expand All @@ -94,11 +99,15 @@ The following table lists the configurable parameters of the fhir access proxy c

To update config file on the pod with new changes one has to do the following:

(Will be showcasing an example of overriding the [hapi\_page\_url\_allowed\_queries.json](../../resources/hapi\_page\_url\_allowed\_queries.json) file).
(Will be showcasing an example of overriding the
[hapi_page_url_allowed_queries.json](../../resources/hapi_page_url_allowed_queries.json)
file).

1. Create a configmap entry, like below:
* The `.Values.configMaps.name` should be unique per entry.
* Ensure indentation of the content is okay.

- The `.Values.configMaps.name` should be unique per entry.
- Ensure indentation of the content is okay.

```yaml
configMaps:
- name: hapi_page_url_allowed_queries.json
Expand All @@ -119,18 +128,25 @@ To update config file on the pod with new changes one has to do the following:
```
2. Create a configmap volume type:
* The name of the configMap resemble the ConfigMap manifest metadata.name i.e. `fhir-access-proxy` but we obtain the generated name from the function `'{{ include "fhir-access-proxy.fullname" . }}'` using tpl function.
- The name of the configMap resemble the ConfigMap manifest metadata.name
i.e. `fhir-access-proxy` but we obtain the generated name from the
function `'{{ include "fhir-access-proxy.fullname" . }}'` using tpl
function.

```yaml
volumes:
- name: hapi-page-url-allowed-queries
configMap:
name: '{{ include "fhir-access-proxy.fullname" . }}'
- name: hapi-page-url-allowed-queries
configMap:
name: '{{ include "fhir-access-proxy.fullname" . }}'
```

3. Mount the Configmap volume:
* mountPath is the location of the file in the pod.
* name is the name of the volume in point 2 above.
* subPath is the name of the configMap used in point 1 above.

- mountPath is the location of the file in the pod.
- name is the name of the volume in point 2 above.
- subPath is the name of the configMap used in point 1 above.

```yaml
volumeMounts:
- mountPath: /app/resources/hapi_page_url_allowed_queries.json
Expand All @@ -139,7 +155,7 @@ To update config file on the pod with new changes one has to do the following:
```

4. Deploy.
* To confirm it has picked the new changes you can check the file by:
- To confirm it has picked the new changes you can check the file by:
```shell
kubectl exec -it <pod-name> -- cat resources/hapi_page_url_allowed_queries.json
```
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{ $scope := .}}
apiVersion: v1
kind: ConfigMap
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{- if .Values.ingress.enabled -}}
{{- $fullName := include "fhir-access-proxy.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{- if .Values.pdb.enabled }}
{{- if semverCompare "<1.21-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: "policy/v1beta1"
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v1
kind: Service
metadata:
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v1
kind: Pod
metadata:
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/templates/vpa.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

{{- if .Values.vpa.enabled }}
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
Expand Down
16 changes: 16 additions & 0 deletions charts/fhir-access-proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Default values for fhir-access-proxy.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
Expand Down
16 changes: 16 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2021-2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: main
Expand Down

0 comments on commit b6b664f

Please sign in to comment.