-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Helm support for Theia with ClickHouse PV
Signed-off-by: Yanjun Zhou <[email protected]>
- Loading branch information
Showing
52 changed files
with
939 additions
and
361 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 |
---|---|---|
|
@@ -136,3 +136,12 @@ jobs: | |
run: | | ||
sudo npm install -g [email protected] | ||
make markdownlint | ||
- name: Checking whether autogenerated Helm chart documentation is up-to-date | ||
working-directory: build/charts/ | ||
run: | | ||
make helm-docs | ||
DIFF=$(git diff .) | ||
if [ -n "$DIFF" ]; then | ||
echo "The Helm chart documentation is out-of-date; please run 'make helm-docs' in 'build/charts/' and commit the changes" | ||
exit 1 | ||
fi |
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,6 @@ | ||
USERID := $(shell id -u) | ||
GRPID := $(shell id -g) | ||
|
||
.PHONY: helm-docs | ||
helm-docs: | ||
docker run --rm --volume "$(CURDIR):/helm-docs" --user=$(USERID):$(GRPID) jnorwood/helm-docs:v1.7.0 |
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,19 @@ | ||
apiVersion: v2 | ||
name: theia | ||
type: application | ||
displayName: Theia | ||
home: https://antrea.io/ | ||
version: 0.1.0-dev | ||
appVersion: 0.1.0-dev | ||
kubeVersion: ">= 1.16.0-0" | ||
icon: https://raw.githubusercontent.com/antrea-io/antrea/main/docs/assets/logo/antrea_logo.svg | ||
description: Antrea Network Flow Visibility | ||
keywords: | ||
- Kubernetes | ||
- CNCF | ||
- Networking | ||
- CNI | ||
- Security | ||
- Flow visibility | ||
sources: | ||
- https://github.com/antrea-io/theia |
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,46 @@ | ||
# theia | ||
|
||
![Version: 0.1.0-dev](https://img.shields.io/badge/Version-0.1.0--dev-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0-dev](https://img.shields.io/badge/AppVersion-0.1.0--dev-informational?style=flat-square) | ||
|
||
Antrea Network Flow Visibility | ||
|
||
**Homepage:** <https://antrea.io/> | ||
|
||
## Source Code | ||
|
||
* <https://github.com/antrea-io/theia> | ||
|
||
## Requirements | ||
|
||
Kubernetes: `>= 1.16.0-0` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| clickhouse.image | object | `{"pullPolicy":"IfNotPresent","repository":"projects.registry.vmware.com/antrea/theia-clickhouse-server","tag":"21.11"}` | Container image to use for the ClickHouse. | | ||
| clickhouse.monitor.deletePercentage | float | `0.5` | The percentage of records in ClickHouse that will be deleted when the storage grows above threshold. Vary from 0 to 1. | | ||
| clickhouse.monitor.enable | bool | `true` | Determine whether to run a monitor to periodically check the ClickHouse memory usage and clean data. | | ||
| clickhouse.monitor.image | object | `{"pullPolicy":"IfNotPresent","repository":"projects.registry.vmware.com/antrea/theia-clickhouse-monitor","tag":"latest"}` | Container image to use for the ClickHouse Monitor. | | ||
| clickhouse.monitor.threshold | float | `0.5` | The storage percentage at which the monitor starts to delete old records. Vary from 0 to 1. | | ||
| clickhouse.persistentVolume.affinity | object | `{"required":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"antrea.io/clickhouse-data-node","operator":"Exists"}]}]}}` | Affinity for the Local Persistent Volume. Required when Persistent Volumes is enable and the provisioner is "Local". | | ||
| clickhouse.persistentVolume.enable | bool | `false` | Enable deploying the ClickHouse with Persistent Volumes. | | ||
| clickhouse.persistentVolume.localPath | string | `"/data"` | The local path. Required when Persistent Volumes is enable and the provisioner is "Local". | | ||
| clickhouse.persistentVolume.nfsHost | string | `""` | The NFS server hostname or IP address. Required when Persistent Volumes is enable the provisioner is "NFS". | | ||
| clickhouse.persistentVolume.nfsPath | string | `""` | The path exported on the NFS server. Required when Persistent Volumes is enable the provisioner is "NFS". | | ||
| clickhouse.persistentVolume.provisioner | string | `"Local"` | Persistent Volume Provisioner. Required if Persistent Volumes is enable. It must be one of "StorageClass", "Local", "NFS". | | ||
| clickhouse.persistentVolume.storageClass | string | `""` | The StorageClass used to dynamically provision the Persistent Volume. Required when Persistent Volumes is enable the provisioner is "StorageClass". | | ||
| clickhouse.port.http | int | `8123` | HTTP port number for the ClickHouse service. | | ||
| clickhouse.port.tcp | int | `9000` | TCP port number for the ClickHouse service. | | ||
| clickhouse.secret.password | string | `"clickhouse_operator_password"` | ClickHouse password. It will be stored in a secret. | | ||
| clickhouse.secret.username | string | `"clickhouse_operator"` | ClickHouse username. It will be stored in a secret. | | ||
| clickhouse.storageSize | string | `"8Gi"` | ClickHouse storage size. Can be a plain integer or as a fixed-point number using one of these quantity suffixes: E, P, T, G, M, K. Or the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. | | ||
| clickhouse.ttl | int | `3600` | Time to live in seconds for data in the ClickHouse. | | ||
| grafana.image | object | `{"pullPolicy":"IfNotPresent","repository":"projects.registry.vmware.com/antrea/theia-grafana","tag":"8.3.3"}` | Container image to use for the Grafana. | | ||
| grafana.secret.password | string | `"admin"` | Grafana password. It will be stored in a secret. | | ||
| grafana.secret.username | string | `"admin"` | Grafana username. It will be stored in a secret. | | ||
| grafana.service.tcpPort | int | `3000` | TCP port number for the Grafana service. | | ||
| grafana.service.type | string | `"NodePort"` | The type of service exposes Grafana. It must be one of NodePort or LoadBalancer. | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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 @@ | ||
The Theia has been successfully installed. |
Empty file.
100 changes: 100 additions & 0 deletions
100
build/charts/theia/templates/clickhouse/clickhouseinstallation.yaml
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,100 @@ | ||
apiVersion: "clickhouse.altinity.com/v1" | ||
kind: "ClickHouseInstallation" | ||
metadata: | ||
name: clickhouse | ||
labels: | ||
app: clickhouse | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
configuration: | ||
users: | ||
{{ .Values.clickhouse.secret.username }}/k8s_secret_password: {{ .Release.Namespace }}/clickhouse-secret/password | ||
{{ .Values.clickhouse.secret.username }}/networks/ip: "::/0" | ||
clusters: | ||
- name: "clickhouse" | ||
layout: | ||
shardsCount: 1 | ||
replicasCount: 1 | ||
defaults: | ||
templates: | ||
podTemplate: pod-template | ||
serviceTemplate: service-template | ||
{{- if .Values.clickhouse.persistentVolume.enable }} | ||
dataVolumeClaimTemplate: clickhouse-storage-template | ||
{{- end }} | ||
templates: | ||
serviceTemplates: | ||
- name: service-template | ||
spec: | ||
ports: | ||
- name: http | ||
port: {{ .Values.clickhouse.port.http }} | ||
- name: tcp | ||
port: {{ .Values.clickhouse.port.tcp }} | ||
podTemplates: | ||
- name: pod-template | ||
spec: | ||
containers: | ||
- name: clickhouse | ||
image: {{ .Values.clickhouse.image.repository }}:{{ .Values.clickhouse.image.tag }} | ||
imagePullPolicy: {{ .Values.clickhouse.image.pullPolicy }} | ||
volumeMounts: | ||
- name: clickhouse-configmap-volume | ||
mountPath: /docker-entrypoint-initdb.d | ||
{{- if not .Values.clickhouse.persistentVolume.enable }} | ||
- name: clickhouse-storage-volume | ||
mountPath: /var/lib/clickhouse | ||
{{- end }} | ||
{{- if .Values.clickhouse.monitor.enable}} | ||
- name: clickhouse-monitor | ||
image: {{ .Values.clickhouse.monitor.image.repository }}:{{ .Values.clickhouse.monitor.image.tag }} | ||
imagePullPolicy: {{ .Values.clickhouse.monitor.image.pullPolicy }} | ||
env: | ||
- name: CLICKHOUSE_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: clickhouse-secret | ||
key: username | ||
- name: CLICKHOUSE_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: clickhouse-secret | ||
key: password | ||
- name: DB_URL | ||
value: "tcp://localhost:9000" | ||
- name: TABLE_NAME | ||
value: "default.flows" | ||
- name: MV_NAMES | ||
value: "default.flows_pod_view default.flows_node_view default.flows_policy_view" | ||
- name: STORAGE_SIZE | ||
value: {{ .Values.clickhouse.storageSize | quote }} | ||
- name: THRESHOLD | ||
value: {{ .Values.clickhouse.monitor.threshold | quote }} | ||
- name: DELETE_PERCENTAGE | ||
value: {{ .Values.clickhouse.monitor.deletePercentage | quote }} | ||
{{- end}} | ||
volumes: | ||
- name: clickhouse-configmap-volume | ||
configMap: | ||
name: clickhouse-mounted-configmap | ||
{{- if not .Values.clickhouse.persistentVolume.enable }} | ||
- name: clickhouse-storage-volume | ||
emptyDir: | ||
medium: Memory | ||
sizeLimit: {{ .Values.clickhouse.storageSize }} | ||
{{- end }} | ||
{{- if .Values.clickhouse.persistentVolume.enable }} | ||
volumeClaimTemplates: | ||
- name: clickhouse-storage-template | ||
spec: | ||
{{- if eq .Values.clickhouse.persistentVolume.provisioner "StorageClass"}} | ||
storageClassName: {{ .Values.clickhouse.persistentVolume.storageClass}} | ||
{{- else }} | ||
storageClassName: clickhouse-storage | ||
{{- end }} | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ .Values.clickhouse.storageSize }} | ||
{{- end }} |
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,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: clickhouse-mounted-configmap | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
create_table.sh: |- | ||
{{ tpl (.Files.Get "provisioning/datasources/create_table.sh") . | indent 4}} |
19 changes: 19 additions & 0 deletions
19
build/charts/theia/templates/clickhouse/local-persistentvolume.yaml
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,19 @@ | ||
{{- if and (.Values.clickhouse.persistentVolume.enable) (eq (.Values.clickhouse.persistentVolume.provisioner) "Local") }} | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: clickhouse-pv | ||
spec: | ||
storageClassName: clickhouse-storage | ||
capacity: | ||
storage: {{ .Values.clickhouse.storageSize }} | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
local: | ||
path: {{ .Values.clickhouse.persistentVolume.localPath }} | ||
{{- with .Values.clickhouse.persistentVolume.affinity }} | ||
nodeAffinity: | ||
{{- toYaml . | trim | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
16 changes: 16 additions & 0 deletions
16
build/charts/theia/templates/clickhouse/nfs-persistentvolume.yaml
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,16 @@ | ||
{{- if and (.Values.clickhouse.persistentVolume.enable) (eq (.Values.clickhouse.persistentVolume.provisioner) "NFS") }} | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: clickhouse-pv | ||
spec: | ||
storageClassName: clickhouse-storage | ||
capacity: | ||
storage: {{ .Values.clickhouse.storageSize }} | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
nfs: | ||
path: {{ .Values.clickhouse.persistentVolume.nfsPath }} | ||
server: {{ .Values.clickhouse.persistentVolume.nfsHost }} | ||
{{- end }} |
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,9 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: clickhouse-secret | ||
namespace: {{ .Release.Namespace }} | ||
type: Opaque | ||
stringData: | ||
username: {{ .Values.clickhouse.secret.username }} | ||
password: {{ .Values.clickhouse.secret.password }} |
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,10 @@ | ||
{{- if and (.Values.clickhouse.persistentVolume.enable) (not (eq (.Values.clickhouse.persistentVolume.provisioner) "StorageClass")) }} | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: clickhouse-storage | ||
provisioner: kubernetes.io/no-provisioner | ||
volumeBindingMode: WaitForFirstConsumer | ||
reclaimPolicy: Retain | ||
allowVolumeExpansion: True | ||
{{- end }} |
7 changes: 7 additions & 0 deletions
7
build/charts/theia/templates/grafana/dashboard-configmap.yaml
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,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: grafana-dashboard-config | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
{{ (.Files.Glob "provisioning/dashboards/*.json").AsConfig | indent 2}} |
8 changes: 8 additions & 0 deletions
8
build/charts/theia/templates/grafana/dashboard-provider-configmap.yaml
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,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: grafana-dashboard-provider | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
dashboard_provider.yaml: |- | ||
{{ .Files.Get "provisioning/dashboards/dashboard_provider.yaml" | indent 4}} |
8 changes: 8 additions & 0 deletions
8
build/charts/theia/templates/grafana/datasource-provider-configmap.yaml
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,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: grafana-datasource-provider | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
datasource_provider.yaml: |- | ||
{{ tpl (.Files.Get "provisioning/datasources/datasource_provider.yaml") . | indent 4}} |
Oops, something went wrong.