-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add grafana and clickhouse deployment file
This PR is for adding deployment file and custom plugin for Grafana configuration and setup for Clickhouse, which are the UI solution and database solution for flow visibility long term architecture. Signed-off-by: zyiou <[email protected]>
- Loading branch information
Showing
17 changed files
with
14,033 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build, sign and upload grafana sankey plugin | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
build-grafana-sankey-plugin: | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and sign plugin | ||
env: | ||
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY}} | ||
TAG: ${{ github.ref }} | ||
run: | | ||
cd ./plugins/grafana-sankey-plugin | ||
yarn install --pure-lockfile | ||
yarn build | ||
npx @grafana/toolkit plugin:sign --rootUrls http://localhost:3000 | ||
zip grafana-sankey-plugin.zip dist -r | ||
- name: Upload grafana-sankey-plugin zip | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./plugins/grafana-sankey-plugin/grafana-sankey-plugin.zip | ||
asset_name: 'grafana-sankey-plugin.zip' | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
app: flow-visibility | ||
name: flow-visibility | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: flow-visibility | ||
name: flow-visibility | ||
namespace: flow-visibility | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
labels: | ||
app: flow-visibility | ||
name: grafana-role | ||
namespace: flow-visibility | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
app: flow-visibility | ||
name: grafana-role-binding | ||
namespace: flow-visibility | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: grafana-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: grafana | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: grafana-storage | ||
provisioner: kubernetes.io/no-provisioner | ||
volumeBindingMode: WaitForFirstConsumer | ||
reclaimPolicy: Delete | ||
allowVolumeExpansion: True | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: grafana-pvc | ||
namespace: flow-visibility | ||
spec: | ||
storageClassName: grafana-storage | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: grafana-pv | ||
namespace: flow-visibility | ||
spec: | ||
storageClassName: grafana-storage | ||
capacity: | ||
storage: 2Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
hostPath: | ||
path: "/data/grafana" | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: grafana-datasource | ||
namespace: flow-visibility | ||
data: | ||
datasource.yaml: |- | ||
apiVersion: 1 | ||
datasources: | ||
- name: ClickHouse | ||
type: vertamedia-clickhouse-datasource | ||
access: proxy | ||
url: http://clickhouse-clickhouse.flow-visibility.svc:8123 | ||
editable: true | ||
jsonData: | ||
useYandexCloudAuthorization: true | ||
xHeaderUser: clickhouse_operator | ||
xHeaderKey: clickhouse_operator_password | ||
--- | ||
apiVersion: clickhouse.altinity.com/v1 | ||
kind: ClickHouseInstallation | ||
metadata: | ||
name: clickhouse | ||
namespace: flow-visibility | ||
spec: | ||
configuration: | ||
clusters: | ||
- name: clickhouse | ||
layout: | ||
shardsCount: 1 | ||
replicasCount: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: grafana | ||
name: grafana | ||
namespace: flow-visibility | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: grafana | ||
template: | ||
metadata: | ||
labels: | ||
app: grafana | ||
spec: | ||
securityContext: | ||
fsGroup: 472 | ||
supplementalGroups: | ||
- 0 | ||
containers: | ||
- name: grafana | ||
image: grafana/grafana:8.3.3 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: GF_INSTALL_PLUGINS | ||
value: "https://github.com/antrea-io/antrea/releases/download/v1.5.0/grafana-sankey-plugin;antreaflowvisibility-grafana-sankey-plugin,vertamedia-clickhouse-datasource" | ||
ports: | ||
- containerPort: 3000 | ||
name: http-grafana | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /robots.txt | ||
port: 3000 | ||
scheme: HTTP | ||
initialDelaySeconds: 10 | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 2 | ||
livenessProbe: | ||
failureThreshold: 3 | ||
initialDelaySeconds: 30 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: 3000 | ||
timeoutSeconds: 1 | ||
resources: | ||
requests: | ||
cpu: 250m | ||
memory: 750Mi | ||
volumeMounts: | ||
- mountPath: /data | ||
name: grafana-pv | ||
- mountPath: /etc/grafana/provisioning/datasources | ||
name: grafana-datasources | ||
volumes: | ||
- name: grafana-pv | ||
persistentVolumeClaim: | ||
claimName: grafana-pvc | ||
- name: grafana-datasources | ||
configMap: | ||
name: grafana-datasource | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grafana | ||
namespace: flow-visibility | ||
spec: | ||
ports: | ||
- port: 3000 | ||
protocol: TCP | ||
targetPort: http-grafana | ||
selector: | ||
app: grafana | ||
sessionAffinity: None | ||
type: LoadBalancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
...require('@grafana/toolkit/src/config/prettier.plugin.config.json'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## 1.0.0 (Unreleased) | ||
|
||
Initial release. |
Oops, something went wrong.