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

chore: add test files for secure json data in kind #1494

Merged
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
43 changes: 43 additions & 0 deletions hack/kind/resources/default/deployment-thanos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: thanos
labels:
app: thanos
spec:
selector:
matchLabels:
app: thanos
template:
metadata:
labels:
app: thanos
spec:
terminationGracePeriodSeconds: 3
containers:
- name: netcat
image: alpine
command:
- sh
- -c
- |
set -eu
echo "Starting pod"
while true; do echo -e 'HTTP/1.1 200 OK\n\n{"asdf":"date"}' | nc -l -p 8080; done
ports:
- containerPort: 8080
name: http
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: thanos
spec:
selector:
app: thanos
ports:
- port: 8080
name: http
protocol: TCP
targetPort: 8080
29 changes: 29 additions & 0 deletions hack/kind/resources/default/grafana-datasource-thanos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: thanos
spec:
datasource:
access: proxy
basicAuth: false
editable: true
isDefault: true
jsonData:
httpHeaderName1: Authorization
timeInterval: 5s
tlsSkipVerify: true
name: Thanos
orgId: 1
secureJsonData:
httpHeaderValue1: Bearer ${token}
type: prometheus
url: http://thanos.default.svc:8080
instanceSelector:
matchLabels:
dashboards: grafana
valuesFrom:
- targetPath: 'secureJsonData.httpHeaderValue1'
valueFrom:
secretKeyRef:
name: grafana-instance-sa-token
key: token
5 changes: 5 additions & 0 deletions hack/kind/resources/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ resources:
- grafana-dashboard.yaml
- grafana-datasource.yaml
- grafana-contactpoint.yaml

- grafana-datasource-thanos.yaml
- secret.yaml
- serviceaccount.yaml
- deployment-thanos.yaml
7 changes: 7 additions & 0 deletions hack/kind/resources/default/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: grafana-instance-sa-token
annotations:
kubernetes.io/service-account.name: grafana-instance-sa
type: kubernetes.io/service-account-token
6 changes: 6 additions & 0 deletions hack/kind/resources/default/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-instance-sa
secrets:
- name: grafana-instance-sa-token