-
Notifications
You must be signed in to change notification settings - Fork 362
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
Support ClickHouse deployment with Persistent Volume #3608
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
24 changes: 24 additions & 0 deletions
24
build/yamls/flow-visibility/patches/chmonitor/chMonitor.yml
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,24 @@ | ||
- op: add | ||
path: /spec/templates/podTemplates/0/spec/containers/- | ||
value: | ||
name: clickhouse-monitor | ||
image: flow-visibility-clickhouse-monitor | ||
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: STORAGE_SIZE_VALUE |
3 changes: 0 additions & 3 deletions
3
build/yamls/flow-visibility/patches/e2e/imagePullPolicyClickhouse.yml
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
- op: add | ||
path: /spec/templates/podTemplates/0/spec/containers/0/imagePullPolicy | ||
value: IfNotPresent | ||
- op: add | ||
path: /spec/templates/podTemplates/0/spec/containers/1/imagePullPolicy | ||
value: IfNotPresent |
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,28 @@ | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: clickhouse-storage | ||
provisioner: kubernetes.io/no-provisioner | ||
volumeBindingMode: WaitForFirstConsumer | ||
reclaimPolicy: Retain | ||
allowVolumeExpansion: True | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: clickhouse-pv | ||
spec: | ||
storageClassName: clickhouse-storage | ||
capacity: | ||
storage: STORAGE_SIZE | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
local: | ||
path: LOCAL_PATH | ||
nodeAffinity: | ||
required: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: antrea.io/clickhouse-data-node | ||
operator: Exists |
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 @@ | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: clickhouse-storage | ||
provisioner: kubernetes.io/no-provisioner | ||
volumeBindingMode: WaitForFirstConsumer | ||
reclaimPolicy: Retain | ||
allowVolumeExpansion: True | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: clickhouse-pv | ||
spec: | ||
storageClassName: clickhouse-storage | ||
capacity: | ||
storage: STORAGE_SIZE | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
nfs: | ||
path: NFS_SERVER_PATH | ||
server: NFS_SERVER_ADDRESS |
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,14 @@ | ||
- op: add | ||
path: /spec/defaults/templates/dataVolumeClaimTemplate | ||
value: clickhouse-storage-template | ||
- op: add | ||
path: /spec/templates/volumeClaimTemplates | ||
value: | ||
- name: clickhouse-storage-template | ||
spec: | ||
storageClassName: STORAGECLASS_NAME | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: STORAGE_SIZE |
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,12 @@ | ||
- op: add | ||
path: /spec/templates/podTemplates/0/spec/volumes/- | ||
value: | ||
name: clickhouse-storage-volume | ||
emptyDir: | ||
medium: Memory | ||
sizeLimit: STORAGE_SIZE | ||
- op: add | ||
path: /spec/templates/podTemplates/0/spec/containers/0/volumeMounts/- | ||
value: | ||
name: clickhouse-storage-volume | ||
mountPath: /var/lib/clickhouse |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change independent from the rest of this PR (PersistentVolume support)? If yes, could it go into a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is inspired by the PV support. This change allows us to generate a manifest without the ClickHouse monitor. We suppose this may happen when user have a large enough PV storage. In that case, the monitor won't be triggered as the throughput bottleneck would be in the flow aggregator side instead of the ClickHouse storage space side. But overall it make sense to me to put it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part has been removed from this PR now. Hope it is more clear now. Thanks!
Updated, the file is added back to allow customized storage size. But the optional monitor is still not added in this PR.