Skip to content

Commit

Permalink
chore: add kind test files for testing secureJsonData. (#1494)
Browse files Browse the repository at this point in the history
Co-authored-by: Hubert Stefanski <35736504+HubertStefanski@users.noreply.github.com>
  • Loading branch information
smuda and HVBE committed Apr 16, 2024
1 parent 63dcd88 commit 2ec05c9
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
43 changes: 43 additions & 0 deletions hack/kind/resources/default/deployment-thanos.yaml
@@ -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
@@ -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
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
@@ -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
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: grafana-instance-sa
secrets:
- name: grafana-instance-sa-token

0 comments on commit 2ec05c9

Please sign in to comment.