mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-19 04:06:27 +00:00
Add JWT test to helm chart
This commit is contained in:
@@ -27,11 +27,11 @@ build-container:
|
||||
docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) .
|
||||
|
||||
test-container:
|
||||
@docker rm -f podinfo || true
|
||||
@docker run -dp 9898:9898 --name=podinfo $(DOCKER_IMAGE_NAME):$(VERSION)
|
||||
@docker ps
|
||||
@TOKEN=$$(curl -sd 'test' localhost:9898/token) && \
|
||||
JWT=$$(echo $$TOKEN | jq -r .token) && \
|
||||
curl -H "Authorization: Bearer $${JWT}" localhost:9898/token/validate | grep test
|
||||
@TOKEN=$$(curl -sd 'test' localhost:9898/token | jq -r .token) && \
|
||||
curl -sH "Authorization: Bearer $${TOKEN}" localhost:9898/token/validate | grep test
|
||||
|
||||
push-container:
|
||||
docker push $(DOCKER_IMAGE_NAME):$(VERSION)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# podinfo
|
||||
|
||||
[](https://travis-ci.org/stefanprodan/podinfo)
|
||||
[](https://circleci.com/gh/stefanprodan/podinfo)
|
||||
[](https://hub.docker.com/r/stefanprodan/podinfo)
|
||||
|
||||
Podinfo is a tiny web application made with Go
|
||||
@@ -57,9 +57,12 @@ helm repo add sp https://stefanprodan.github.io/podinfo
|
||||
|
||||
helm upgrade --install --wait frontend \
|
||||
--namespace test \
|
||||
--set replicaCount=2 \
|
||||
--set backend=http://backend-podinfo:9898/echo \
|
||||
sp/podinfo
|
||||
|
||||
helm test frontend --cleanup
|
||||
|
||||
helm upgrade --install --wait backend \
|
||||
--namespace test \
|
||||
--set hpa.enabled=true \
|
||||
|
||||
@@ -58,7 +58,7 @@ spec:
|
||||
- check
|
||||
- http
|
||||
- localhost:{{ .Values.service.containerPort }}/healthz
|
||||
initialDelaySeconds: 5
|
||||
initialDelaySeconds: 1
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
@@ -67,7 +67,7 @@ spec:
|
||||
- check
|
||||
- http
|
||||
- localhost:{{ .Values.service.containerPort }}/readyz
|
||||
initialDelaySeconds: 5
|
||||
initialDelaySeconds: 1
|
||||
timeoutSeconds: 5
|
||||
volumeMounts:
|
||||
- name: data
|
||||
|
||||
+6
-4
@@ -1,7 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: {{ template "podinfo.fullname" . }}-storage-test-{{ randAlphaNum 5 | lower }}
|
||||
name: {{ template "podinfo.fullname" . }}-jwt-test-{{ randAlphaNum 5 | lower }}
|
||||
labels:
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
@@ -13,7 +13,7 @@ spec:
|
||||
containers:
|
||||
- name: tools
|
||||
image: giantswarm/tiny-tools
|
||||
command: ["/bin/sh", "/scripts/ping.sh"]
|
||||
command: ["/bin/sh", "/scripts/test.sh"]
|
||||
env:
|
||||
- name: PODINFO_SVC
|
||||
value: {{ template "podinfo.fullname" . }}:{{ .Values.service.externalPort }}
|
||||
@@ -36,6 +36,8 @@ metadata:
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
app: {{ template "podinfo.name" . }}
|
||||
data:
|
||||
ping.sh: |
|
||||
test.sh: |
|
||||
#!/bin/sh
|
||||
curl -sS ${PODINFO_SVC}/store/$(curl -sSd 'test' ${PODINFO_SVC}/store | jq -r .hash) |grep test
|
||||
echo "testing ${PODINFO_SVC}/token"
|
||||
TOKEN=$(curl -sd 'test' ${PODINFO_SVC}/token | jq -r .token) && \
|
||||
curl -H "Authorization: Bearer ${TOKEN}" ${PODINFO_SVC}/token/validate | grep test
|
||||
Reference in New Issue
Block a user