-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mateusz Urbanek <[email protected]>
- Loading branch information
Showing
12 changed files
with
392 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
checks: | ||
exclude: | ||
- "no-read-only-root-fs" | ||
- "run-as-non-root" | ||
- "unset-cpu-requirements" | ||
- "unset-memory-requirements" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# bitwarden-webhook | ||
|
||
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat) | ||
|
||
A BitWarden Webhook provider for External Secrets Operator | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | Affinity settings for the pods. | | ||
| fullnameOverride | string | `""` | Override for the full name. | | ||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. | | ||
| image.repository | string | `"ghcr.io/charlesthomas/bitwarden-cli"` | Registry and repository for the image. | | ||
| image.tag | string | `"2023.12.1"` | Tag for the image. | | ||
| imagePullSecrets | list | `[]` | Secrets for pulling images. | | ||
| nameOverride | string | `""` | Override for the name. | | ||
| networkPolicy.create | bool | `true` | Specifies whether a network policy should be created. | | ||
| networkPolicy.podSelectors | list | `[{"app.kubernetes.io/instance":"external-secrets","app.kubernetes.io/name":"external-secrets"}]` | Pod selectors for the network policy. | | ||
| nodeSelector | object | `{}` | Node selector for the pods. | | ||
| podAnnotations | object | `{}` | Annotations to be added to the pods. | | ||
| podLabels | object | `{}` | Labels to be added to the pods. | | ||
| podSecurityContext | object | `{}` | | | ||
| replicaCount | int | `1` | Number of replicas for the deployment. | | ||
| resources | object | `{}` | | | ||
| secret.bitwardenHost | string | `""` | Host for Bitwarden. | | ||
| secret.bitwardenPassword | string | `""` | Password for Bitwarden. | | ||
| secret.bitwardenUsername | string | `""` | Username for Bitwarden. | | ||
| secret.create | bool | `true` | Specifies whether a secret should be created. | | ||
| secret.existingSecretName | string | `""` | Name of the existing secret. | | ||
| securityContext | object | `{}` | | | ||
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account. | | ||
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials. | | ||
| 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. | | ||
| tolerations | list | `[]` | Tolerations for the pods. | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "bitwarden-webhook.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 "bitwarden-webhook.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 "bitwarden-webhook.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "bitwarden-webhook.labels" -}} | ||
helm.sh/chart: {{ include "bitwarden-webhook.chart" . }} | ||
{{ include "bitwarden-webhook.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "bitwarden-webhook.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "bitwarden-webhook.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "bitwarden-webhook.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "bitwarden-webhook.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the secret to use | ||
*/}} | ||
{{- define "bitwarden-webhook.secretName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "bitwarden-webhook.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- required ".Values.secret.existingSecretName is required when not creating the secret!" .Values.secret.existingSecretName }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "bitwarden-webhook.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "bitwarden-webhook.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "bitwarden-webhook.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "bitwarden-webhook.labels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "bitwarden-webhook.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
env: | ||
- name: BW_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "bitwarden-webhook.secretName" . }} | ||
key: BW_HOST | ||
- name: BW_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "bitwarden-webhook.secretName" . }} | ||
key: BW_USERNAME | ||
- name: BW_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "bitwarden-webhook.secretName" . }} | ||
key: BW_PASSWORD | ||
ports: | ||
- name: http | ||
containerPort: 8087 | ||
protocol: TCP | ||
livenessProbe: | ||
exec: | ||
command: | ||
- wget | ||
- -q | ||
- http://127.0.0.1:8087/sync?force=true | ||
- --post-data='' | ||
initialDelaySeconds: 20 | ||
failureThreshold: 3 | ||
timeoutSeconds: 1 | ||
periodSeconds: 120 | ||
readinessProbe: | ||
tcpSocket: | ||
port: 8087 | ||
initialDelaySeconds: 20 | ||
failureThreshold: 3 | ||
timeoutSeconds: 1 | ||
periodSeconds: 10 | ||
startupProbe: | ||
tcpSocket: | ||
port: 8087 | ||
initialDelaySeconds: 10 | ||
failureThreshold: 30 | ||
timeoutSeconds: 1 | ||
periodSeconds: 5 | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.networkPolicy.create -}} | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
name: {{ include "bitwarden-webhook.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "bitwarden-webhook.labels" . | nindent 4 }} | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
{{- include "bitwarden-webhook.selectorLabels" . | nindent 6 }} | ||
ingress: | ||
- from: | ||
{{- range $v := .Values.networkPolicy.podSelectors }} | ||
- podSelector: | ||
matchLabels: | ||
{{- $v | toYaml | nindent 12 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.secret.create -}} | ||
{{- $bitwardenHost := .Values.secret.bitwardenHost | required ".Values.secret.bitwardenHost is required." -}} | ||
{{- $bitwardenUsername := .Values.secret.bitwardenUsername | required ".Values.secret.bitwardenUsername is required." -}} | ||
{{- $bitwardenPassword := .Values.secret.bitwardenPassword | required ".Values.secret.bitwardenPassword is required." -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "bitwarden-webhook.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "bitwarden-webhook.labels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
type: Opaque | ||
stringData: | ||
BW_HOST: {{ $bitwardenHost }} | ||
BW_USERNAME: {{ $bitwardenUsername }} | ||
BW_PASSWORD: {{ $bitwardenPassword }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "bitwarden-webhook.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "bitwarden-webhook.labels" . | nindent 4 }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 8087 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "bitwarden-webhook.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "bitwarden-webhook.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "bitwarden-webhook.labels" . | nindent 4 }} | ||
{{- with .Values.serviceAccount.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
automountServiceAccountToken: {{ .Values.serviceAccount.automount }} | ||
{{- end }} |
Oops, something went wrong.