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

refactor(OP SCIM Bridge Chart): refactor Helm chart + use upstream Redis chart + add doc #5

Closed
wants to merge 9 commits into from
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,79 @@
# op-scim-helm

![Version: 1.6.1](https://img.shields.io/badge/Version-1.6.1-informational?style=flat-square) ![AppVersion: v1.6.0](https://img.shields.io/badge/AppVersion-v1.6.0-informational?style=flat-square)

This repo defines the helm chart for the 1Password SCIM Bridge application.

We intend to use this as a repository that can be referenced in our various kubernetes marketplace solutions. It may also be used outside of that context with an appropriate deployment script.


The 1Password SCIM bridge

**Homepage:** <https://support.1password.com/scim>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| 1Password Platform Integrations Team | support+business@1password.com | |

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | redis | 12.0.0 |

## Install

Add Helm repository:

```shell
helm repo add 1password https://raw.githubusercontent.com/1password/op-scim-helm/main
helm repo update
```

Install SCIM Helm chart:

```shell
helm install my-release 1password/op-scim-bridge
```

## Uninstall

```shel
helm remove my-release
```

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Pod affinity for SCIM pods |
| fullnameOverride | string | `""` | Override the full name, see helpers for more information |
| image.pullPolicy | string | `"IfNotPresent"` | SCIM image pull policy |
| image.repository | string | `"1password/scim"` | SCIM image repository |
| image.tag | string | `"v1.6.0"` | SCIM image tag, overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | Credentials secrets to use to pull the image |
| ingress.annotations | object | `{}` | Additionnal annotations for the Ingress |
| ingress.enabled | bool | `false` | Enable or not Ingress |
| ingress.hosts[0].host | string | `"scim.example.com"` | |
| ingress.hosts[0].paths[0] | string | `"/"` | |
| ingress.tls | list | `[{"hosts":["scim.example.com"],"secretName":"scim-example-com-tls"}]` | TLS configuration for the ingress |
| nameOverride | string | `""` | Name to override resources names |
| nodeSelector | object | `{}` | Node selector for SCIM pods |
| podAnnotations | object | `{}` | Additionnal annotations on SCIM pods |
| podSecurityContext | object | `{}` | |
| redis | object | `{"cluster":{"enabled":false},"enabled":true,"image":{"pullPolicy":"IfNotPresent","registry":"docker.io","repository":"bitnami/redis","tag":"6.0.9-debian-10-r13"},"usePassword":false}` | Redis configuration, check [the upstream configuration](https://github.com/bitnami/charts/blob/master/bitnami/redis) |
| replicaCount | int | `1` | |
| resources | object | `{}` | Resources requests/limits for the SCIM pods |
| scim.sessionFile | string | `"scimsession"` | Session file for SCIM application |
| scim.userHome | string | `"/home/scimuser"` | User home directoy for SCIM application |
| scim.userID | int | `999` | Default user ID for SCIM application |
| scim.userName | string | `"scimuser"` | User name for SCIM application |
| securityContext | object | `{}` | |
| service.type | string | `"LoadBalancer"` | Service type, depends if you use an ingress controller or not |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| storageClassName | string | `"do-block-storage"` | Storage class for the SCIM PVC |
| tolerations | list | `[]` | Pod toleration for SCIM pods |
44 changes: 35 additions & 9 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ entries:
op-scim:
- apiVersion: v2
appVersion: v1.6.0
created: "2020-09-24T17:44:28.061054-07:00"
created: "2020-11-17T12:31:35.21885+01:00"
description: The 1Password SCIM bridge
digest: e16b559646084894a837ba84dddadace1671bf5ebedcb76d11454c725fc023fd
home: https://support.1password.com/scim
Expand All @@ -19,11 +19,11 @@ entries:
name: 1Password Platform Integrations Team
name: op-scim
urls:
- op-scim-1.6.0.tgz
- https://raw.githubusercontent.com/PayFit/op-scim-helm/main/op-scim-1.6.0.tgz
version: 1.6.0
- apiVersion: v2
appVersion: v1.5.0
created: "2020-09-24T17:44:28.059986-07:00"
created: "2020-11-17T12:31:35.218607+01:00"
description: The 1Password SCIM bridge
digest: 3f8fb2bcfb655bcaa77376a6a31791dc23e74bce259c051d226448dd72ca43cc
home: https://support.1password.com/scim
Expand All @@ -39,11 +39,11 @@ entries:
name: 1Password Platform Integrations Team
name: op-scim
urls:
- op-scim-1.5.0.tgz
- https://raw.githubusercontent.com/PayFit/op-scim-helm/main/op-scim-1.5.0.tgz
version: 1.5.0
- apiVersion: v2
appVersion: v1.4.4
created: "2020-09-24T17:44:28.059671-07:00"
created: "2020-11-17T12:31:35.218354+01:00"
description: The 1Password SCIM bridge
digest: 121e462663cf8f502f393ec16cd72af96444c7472d226156166b719fdf0d963f
home: https://support.1password.com/scim
Expand All @@ -59,11 +59,11 @@ entries:
name: 1Password Platform Integrations Team
name: op-scim
urls:
- op-scim-1.4.4.tgz
- https://raw.githubusercontent.com/PayFit/op-scim-helm/main/op-scim-1.4.4.tgz
version: 1.4.4
- apiVersion: v2
appVersion: v1.4.3
created: "2020-09-24T17:44:28.059007-07:00"
created: "2020-11-17T12:31:35.217965+01:00"
description: The 1Password SCIM bridge
digest: 90c47a74ec4c95ab4bb76d3e97d7687ecd0a13b37b277f5b2ecb417d9d51c198
home: https://support.1password.com/scim
Expand All @@ -79,6 +79,32 @@ entries:
name: 1Password Platform Integrations Team
name: op-scim
urls:
- op-scim-1.4.3.tgz
- https://raw.githubusercontent.com/PayFit/op-scim-helm/main/op-scim-1.4.3.tgz
version: 1.4.3
generated: "2020-09-24T17:44:28.058343-07:00"
op-scim-bridge:
- apiVersion: v2
appVersion: v1.6.0
created: "2020-11-17T12:31:35.222395+01:00"
dependencies:
- condition: redis.enabled
name: redis
repository: https://charts.bitnami.com/bitnami
version: 12.0.0
description: The 1Password SCIM bridge
digest: 20c1a89b028fbae8e6b24e5ad5c792596a4d9e9214dc80357905e699340958bb
home: https://support.1password.com/scim
icon: https://1password.com/img/logo-v1.svg
keywords:
- azure active directory
- okta
- provisioning
- SCIM
- 1Password
maintainers:
- email: support+business@1password.com
name: 1Password Platform Integrations Team
name: op-scim-bridge
urls:
- https://raw.githubusercontent.com/PayFit/op-scim-helm/main/op-scim-bridge-1.6.1.tgz
version: 1.6.1
generated: "2020-11-17T12:31:35.217506+01:00"
Binary file added op-scim-bridge-1.6.1.tgz
Binary file not shown.
12 changes: 8 additions & 4 deletions op-scim-bridge/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: op-scim
version: 1.6.0
name: op-scim-bridge
version: 1.6.1
description: The 1Password SCIM bridge
keywords:
- "azure active directory"
Expand All @@ -9,9 +9,13 @@ keywords:
- "SCIM"
- "1Password"
home: https://support.1password.com/scim
maintainers: # (optional)
maintainers:
- name: 1Password Platform Integrations Team
email: support+business@1password.com
icon: https://1password.com/img/logo-v1.svg
appVersion: v1.6.0

dependencies:
- name: redis
version: 12.0.0
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
21 changes: 21 additions & 0 deletions op-scim-bridge/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "op-scim-bridge.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "op-scim-bridge.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "op-scim-bridge.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "op-scim-bridge.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}
64 changes: 64 additions & 0 deletions op-scim-bridge/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "op-scim-bridge.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "op-scim-bridge.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "op-scim-bridge.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "op-scim-bridge.labels" -}}
helm.sh/chart: {{ include "op-scim-bridge.chart" . }}
app.kubernetes.io/application: {{ include "op-scim-bridge.fullname" . }}
{{ include "op-scim-bridge.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "op-scim-bridge.selectorLabels" -}}
app.kubernetes.io/name: {{ include "op-scim-bridge.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "op-scim-bridge.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "op-scim-bridge.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
78 changes: 78 additions & 0 deletions op-scim-bridge/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "op-scim-bridge.fullname" . }}
labels:
app.kubernetes.io/component: op-scim-bridge
{{- include "op-scim-bridge.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "op-scim-bridge.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/component: op-scim-bridge
{{- include "op-scim-bridge.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "op-scim-bridge.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: {{ .Chart.Name }}-scimuser-home-permissions
image: alpine:3.12
command:
- "/bin/sh"
- "-c"
args:
- "mkdir -p {{ .Values.scim.userHome }} && chown -R {{ .Values.scim.userID }} {{ .Values.scim.userHome }}"
volumeMounts:
- mountPath: "/home"
name: {{ .Chart.Name }}-scimsession
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- "/op-scim/op-scim"
args:
- "--redis-host={{ .Release.Name }}-redis-master"
- "--session={{ .Values.scim.userHome }}/{{ .Values.scim.sessionFile }}"
- "--port=8080"
ports:
- name: http-app
containerPort: 8080
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: {{ .Chart.Name }}-scimsession
mountPath: "/home"
readOnly: false
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: {{ .Chart.Name }}-scimsession
persistentVolumeClaim:
claimName: {{ .Chart.Name }}-scimsession
41 changes: 41 additions & 0 deletions op-scim-bridge/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "op-scim-bridge.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "op-scim-bridge.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: 443
{{- end }}
{{- end }}
{{- end }}
Loading