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

feat: enable https and http liveliness and readyness probes #15

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ jobs:
${{ runner.os }}-go-
- name: Install musl tools
run: sudo apt install unzip musl-tools -y
- name: Install Helm
uses: azure/setup-helm@v4
- name: Install chart unittest
run: |
helm env
helm plugin install https://github.com/helm-unittest/helm-unittest
- name: Run lint
run: make lint
- name: Run tests
run: make test-ci
- name: Run helm test
run: make helm-test
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ test-ci: ## Test the project
prime-test-cluster: mkcert
./hack/prime_test_cluster.sh

helm-test:
@helm unittest --file tests/*.yaml --file 'tests/**/*.yaml' deploy/charts/bitwarden-sdk-server/

helm-test-update:
@helm unittest -u --file tests/*.yaml --file 'tests/**/*.yaml' deploy/charts/bitwarden-sdk-server/

##@ Docker

IMG ?= ghcr.io/external-secrets/bitwarden-sdk-server
Expand Down
6 changes: 4 additions & 2 deletions deploy/charts/bitwarden-sdk-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@ spec:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
{{- if not .Values.image.tls.enabled }}
livenessProbe:
httpGet:
path: /live
port: http
{{- if .Values.image.tls.enabled }}
scheme: HTTPS
{{- end }}
readinessProbe:
httpGet:
path: /ready
port: http
{{- if .Values.image.tls.enabled }}
scheme: HTTPS
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
deployment should match snapshot:
1: |
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/version: 1.16.0
helm.sh/chart: bitwarden-sdk-server-0.1.0
name: bitwarden-sdk-server
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: bitwarden-sdk-server
template:
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: bitwarden-sdk-server
spec:
containers:
- image: ghcr.io/external-secrets/bitwarden-sdk-server:v0.8.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /live
port: http
scheme: HTTPS
name: bitwarden-sdk-server
ports:
- containerPort: 9998
name: http
protocol: TCP
readinessProbe:
httpGet:
path: /ready
port: http
scheme: HTTPS
resources: {}
securityContext: {}
volumeMounts:
- mountPath: /certs
name: bitwarden-tls-certs
securityContext: {}
serviceAccountName: bitwarden-sdk-server
volumes:
- name: bitwarden-tls-certs
secret:
items:
- key: tls.crt
path: cert.pem
- key: tls.key
path: key.pem
- key: ca.crt
path: ca.pem
secretName: bitwarden-tls-certs
9 changes: 9 additions & 0 deletions deploy/charts/bitwarden-sdk-server/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
suite: test deployment
templates:
- deployment.yaml
tests:
- it: deployment should match snapshot
set:
image.tag: v0.8.0
asserts:
- matchSnapshot: {}