Skip to content

Commit 8a20426

Browse files
committed
add example yaml files how to deploy bridge in a k8s/OCP environment
1 parent 3f9211e commit 8a20426

File tree

6 files changed

+230
-0
lines changed

6 files changed

+230
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: grafana-bridge-deployment
6+
serviceAccount: "ibm-spectrum-scale-core-operator"
7+
8+
spec:
9+
replicas: 2
10+
selector:
11+
matchLabels:
12+
app: grafana-bridge
13+
template:
14+
metadata:
15+
labels:
16+
app: grafana-bridge
17+
spec:
18+
affinity:
19+
podAntiAffinity:
20+
requiredDuringSchedulingIgnoredDuringExecution:
21+
- labelSelector:
22+
matchExpressions:
23+
- key: app
24+
operator: In
25+
values:
26+
- grafana-bridge
27+
topologyKey: "kubernetes.io/hostname"
28+
podAffinity:
29+
requiredDuringSchedulingIgnoredDuringExecution:
30+
- labelSelector:
31+
matchExpressions:
32+
- key: app
33+
operator: In
34+
values:
35+
- scale-pmcollector
36+
topologyKey: "kubernetes.io/hostname"
37+
nodeAffinity:
38+
requiredDuringSchedulingIgnoredDuringExecution:
39+
nodeSelectorTerms:
40+
- matchExpressions:
41+
- key: node-role.kubernetes.io/master
42+
operator: DoesNotExist
43+
- key: kubernetes.io/arch
44+
operator: In
45+
values:
46+
- amd64
47+
- ppc64le
48+
- s390x
49+
- key: kubernetes.io/os
50+
operator: In
51+
values: [ linux ]
52+
containers:
53+
- name: grafana-bridge
54+
image: <bridge image location/bridge image name:tag>
55+
env:
56+
- name: SERVER
57+
value: $(IBM_SPECTRUM_SCALE_PERF_QUERY_SERVICE_HOST)
58+
- name: KEYPATH
59+
value: /opt/registry/certs
60+
- name: PORT
61+
value: "8443"
62+
imagePullPolicy: Always
63+
ports:
64+
- name: http
65+
containerPort: 4242
66+
- name: https
67+
containerPort: 8443
68+
volumeMounts:
69+
- name: logfiles
70+
mountPath: /opt/IBM/bridge/logs
71+
- name: config
72+
mountPath: /opt/IBM/zimon/
73+
readOnly: true
74+
optional: true
75+
- name: secret-volume
76+
mountPath: /opt/registry/certs
77+
initContainers:
78+
- name: init-scale-perf-query-service
79+
image: busybox:1.28
80+
command: ['sh', '-c', "until nslookup ibm-spectrum-scale-perf-query.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for ibm-spectrum-scale-perf-query service; sleep 2; done"]
81+
imagePullSecrets:
82+
- name: spectrumscale-registrykey
83+
volumes:
84+
- name: logfiles
85+
emptyDir: {}
86+
- name: secret-volume
87+
secret:
88+
secretName: grafana-bridge-secret
89+
- name: config
90+
projected:
91+
sources:
92+
- configMap:
93+
name: ibm-spectrum-scale-pmsensors-config
94+
items:
95+
- key: "ZIMonSensors.cfg"
96+
path: "ZIMonSensors.cfg"
97+
- configMap:
98+
name: ibm-spectrum-scale-pmcollector
99+
items:
100+
- key: "ZIMonCollector.cfg"
101+
path: "ZIMonCollector.cfg"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: grafana-bridge
6+
namespace: <namespace-name of the CNSS project>
7+
labels:
8+
app: grafana-bridge
9+
spec:
10+
ports:
11+
- port: 4242
12+
name: http
13+
- port: 8443
14+
name: https
15+
selector:
16+
app: grafana-bridge
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
creationTimestamp: null
6+
name: grafana-bridge
7+
rules:
8+
- apiGroups:
9+
- ""
10+
resources:
11+
- pods
12+
- pods/exec
13+
- pods/log
14+
- services
15+
- endpoints
16+
- persistentvolumeclaims
17+
- events
18+
- configmaps
19+
- secrets
20+
verbs:
21+
- '*'
22+
- apiGroups:
23+
- apps
24+
resources:
25+
- deployments
26+
- daemonsets
27+
- replicasets
28+
- statefulsets
29+
verbs:
30+
- '*'
31+
- apiGroups:
32+
- monitoring.coreos.com
33+
resources:
34+
- servicemonitors
35+
verbs:
36+
- get
37+
- create
38+
- apiGroups:
39+
- apps
40+
resourceNames:
41+
- grafana-bridge
42+
resources:
43+
- deployments/finalizers
44+
verbs:
45+
- update
46+
- apiGroups:
47+
- ibm.com
48+
resources:
49+
- '*'
50+
verbs:
51+
- '*'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
kind: RoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: grafana-bridge
6+
subjects:
7+
- kind: ServiceAccount
8+
name: ibm-spectrum-scale-core-operator
9+
roleRef:
10+
kind: Role
11+
name: grafana-bridge
12+
apiGroup: rbac.authorization.k8s.io
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: integreatly.org/v1alpha1
2+
kind: GrafanaDataSource
3+
metadata:
4+
name: bridge-grafanadatasource
5+
namespace: my-grafana
6+
spec:
7+
datasources:
8+
- access: proxy
9+
editable: true
10+
isDefault: true
11+
jsonData:
12+
httpHeaderName1: 'Authorization'
13+
timeInterval: 5s
14+
tlsSkipVerify: true
15+
tlsAuth: true
16+
name: grafana-bridge
17+
type: opentsdb
18+
secureJsonData:
19+
tlsClientCert: 'TLS cert ${TLS_CERT}'
20+
tlsClientKey: 'TLS key ${TLS_KEY}'
21+
httpHeaderValue1: 'Bearer ${BEARER_TOKEN}'
22+
url: 'https://grafana-bridge.spectrum-scale-ns.svc.cluster.local:8443'
23+
version: 1
24+
name: grafana-bridge-datasource.yaml
25+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: integreatly.org/v1alpha1
2+
kind: Grafana
3+
metadata:
4+
name: grafana-for-cnss
5+
namespace: my-grafana
6+
spec:
7+
ingress:
8+
enabled: true
9+
config:
10+
auth:
11+
disable_signout_menu: true
12+
auth.anonymous:
13+
enabled: true
14+
log:
15+
level: warn
16+
mode: console
17+
security:
18+
admin_password: secret
19+
admin_user: root
20+
dashboardLabelSelector:
21+
- matchExpressions:
22+
- key: app
23+
operator: In
24+
values:
25+
- grafana

0 commit comments

Comments
 (0)