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

Commit

Permalink
Merge pull request #68 from runejo/main - Add statbank-pxwebapi chart
Browse files Browse the repository at this point in the history
Add statbank-pxwebapi chart
  • Loading branch information
johnksv authored Nov 14, 2023
2 parents 21ae582 + e0f1c30 commit a01470a
Show file tree
Hide file tree
Showing 21 changed files with 818 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrationtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.5.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.5.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
23 changes: 23 additions & 0 deletions charts/statbank-pxwebapi/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
30 changes: 30 additions & 0 deletions charts/statbank-pxwebapi/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v2
name: statbank-pxwebapi
description: "API for queries towards all StatBank Norway’s tables. Output formats are JSON-stat, csv and xlsx."
icon: /~https://avatars.githubusercontent.com/u/148870020
keywords:
- Statbank
- Statistikkbanken
- JSON-stat
home: /~https://github.com/statisticsnorway/statbank-pxwebapi
sources:
# A chart can be either an 'application' or a 'library' chart.
- /~https://github.com/statisticsnorway/dapla-lab-helm-charts-services
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

dependencies:
- name: library-chart
version: 1.0.0
repository: https://statisticsnorway.github.io/dapla-lab-helm-charts-services
85 changes: 85 additions & 0 deletions charts/statbank-pxwebapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# statbank-pxwebapi

![Version: 0.2.23](https://img.shields.io/badge/Version-0.2.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Document datasets in Statistics Norway.

**Homepage:** </~https://github.com/statisticsnorway/statbank-pxwebapi>

## Source Code

* </~https://github.com/statisticsnorway/dapla-lab-helm-charts-services>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://statisticsnorway.github.io/dapla-lab-helm-charts-services | library-chart | 1.0.0 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| dataset.dataset_path | string | `"Undefined"` | |
| environment.group | string | `"users"` | |
| environment.user | string | `"onyxia"` | |
| fullnameOverride | string | `""` | |
| imagePullSecrets | list | `[]` | |
| istio.enabled | bool | `false` | |
| istio.gateways[0] | string | `"istio-namespace/example-gateway"` | |
| istio.hostname | string | `"chart-example.local"` | |
| istio.userHostname | string | `"chart-example-user.local"` | |
| kubernetes.enabled | bool | `false` | |
| kubernetes.role | string | `"view"` | |
| nameOverride | string | `""` | |
| networking.clusterIP | string | `"None"` | |
| networking.service.port | int | `8050` | |
| networking.type | string | `"ClusterIP"` | |
| networking.user.enabled | bool | `false` | |
| nodeSelector | object | `{}` | |
| oidc.configMapName | string | `""` | |
| oidc.enabled | bool | `true` | |
| oidc.tokenExchangeUrl | string | `"https://sso.dapla-dev.ssb.no/realms/ssb/protocol/openid-connect/token"` | |
| persistence.accessMode | string | `"ReadWriteOnce"` | |
| persistence.enabled | bool | `false` | |
| persistence.size | string | `"10Gi"` | |
| podAnnotations | object | `{}` | |
| podLabels."onyxia.app" | string | `"statbank-pxwebapi"` | |
| podSecurityContext.fsGroup | int | `100` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| security.allowlist.enabled | bool | `false` | |
| security.allowlist.ip | string | `"0.0.0.0/0"` | |
| security.networkPolicy.enabled | bool | `false` | |
| security.networkPolicy.from | list | `[]` | |
| security.oauth2.authenticatedEmails | string | `""` | |
| security.oauth2.clientId | string | `"my-client"` | |
| security.oauth2.enabled | bool | `false` | |
| security.oauth2.oidcIssuerUrl | string | `""` | |
| security.oauth2.provider | string | `"keycloak-oidc"` | |
| security.password | string | `"changeme"` | |
| security.serviceEntry.enabled | bool | `true` | |
| security.serviceEntry.hosts[0] | string | `"storage.googleapis.com"` | |
| securityContext | object | `{}` | |
| service.image.pullPolicy | string | `"IfNotPresent"` | |
| service.image.version | string | `""` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| startupProbe.failureThreshold | int | `60` | |
| startupProbe.initialDelaySeconds | int | `10` | |
| startupProbe.periodSeconds | int | `10` | |
| startupProbe.successThreshold | int | `1` | |
| startupProbe.timeoutSeconds | int | `30` | |
| tolerations | list | `[]` | |
| userAttributes.environmentVariableName | string | `"OIDC_TOKEN"` | |
| userAttributes.userAttribute | string | `"access_token"` | |
| userAttributes.value | string | `""` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](/~https://github.com/norwoodj/helm-docs/releases/v1.11.0)
8 changes: 8 additions & 0 deletions charts/statbank-pxwebapi/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if .Values.istio.enabled }}
- You can connect to PxWebApi with your browser on this [link](https://{{ .Values.istio.hostname }})
{{- if .Values.networking.user.enabled }}
- You can connect to your custom port on this [link](https://{{ .Values.istio.userHostname }})
If you don't run your custom service you will get a 502 bad gateway error.
{{- end }}
{{- end }}
- Your access token is **{{ .Values.security.password }}**
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.configMapOAuth2" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/configmap-oidc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.configMapOidc" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/dapla_redirect_url.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.daplaCommonClientRedirectUri" . }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.networkPolicyIngress" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.networkPolicy" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.persistentVolumeClaim" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.roleBinding" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.service" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.serviceAccount" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/serviceentry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.serviceentry" . }}
105 changes: 105 additions & 0 deletions charts/statbank-pxwebapi/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{{- $fullName := include "library-chart.fullname" . -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "library-chart.fullname" . }}
labels:
{{- include "library-chart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
serviceName: {{ include "library-chart.fullname" . }}
selector:
matchLabels:
{{- include "library-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- if .Values.oidc.enabled }}
checksum/oidc: {{ include (print $.Template.BasePath "/configmap-oidc.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "library-chart.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
volumes:
- name: home
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "library-chart.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.security.oauth2.enabled }}
- {{ include "library-chart.oauth2ProxyVolume" . | indent 10 | trim }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "library-chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
subdomain: {{ include "library-chart.fullname" . }}
hostname: statbank-pxwebapi
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.service.image.version }}"
imagePullPolicy: {{ .Values.service.image.pullPolicy }}
port: {{ .Values.networking.service.port }}
env:
- name: KUBERNETES_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: IMAGE_NAME
value: "{{ .Values.service.image.version }}"
- name: PXWEBAPI_DATASET_PATH
value: {{ .Values.dataset.dataset_path }}
- name: PROJECT_USER
value: {{ .Values.environment.user }}
- name: PROJECT_GROUP
value: {{ .Values.environment.group }}
envFrom:
{{- if .Values.oidc.enabled }}
- configMapRef:
name: {{ include "library-chart.configMapNameOidc" . }}
{{- end }}
livenessProbe:
httpGet:
path: /api/v2/navigation
port: {{ .Values.networking.service.port }}
readinessProbe:
httpGet:
path: /api/v2/navigation
port: {{ .Values.networking.service.port }}
startupProbe:
httpGet:
path: /api/v2/navigation
port: {{ .Values.networking.service.port }}
{{- toYaml .Values.startupProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.security.oauth2.enabled }}
- {{ include "library-chart.oauth2ProxyPod" . | indent 10 | trim }}
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.testConnection" . }}
1 change: 1 addition & 0 deletions charts/statbank-pxwebapi/templates/virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.virtualservice" . }}
Loading

0 comments on commit a01470a

Please sign in to comment.