Skip to content
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

Dynamic provisioning (of PVs) #2

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 78 additions & 144 deletions kafka/config/pv.yaml
Original file line number Diff line number Diff line change
@@ -1,135 +1,75 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-kafka-zookeeper-0
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/kafka/kafka-zk-0
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker101
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-kafka-broker-0
spec:
capacity:
storage: 8Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/kafka/kafka-broker-0
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker101
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-kafka-zookeeper-1
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/kafka/kafka-zk-1
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker102
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-kafka-broker-1
spec:
capacity:
storage: 8Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/kafka/kafka-broker-1
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker102
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-kafka-zookeeper-2
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/kafka/kafka-zk-2
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker103
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-kafka-broker-2
spec:
capacity:
storage: 8Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/kafka/kafka-broker-2
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker103
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-kafka-zookeeper-0
# spec:
# capacity:
# storage: 10Gi
# volumeMode: Filesystem
# storageClassName: standard
# accessModes:
# - ReadWriteOnce
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-kafka-broker-0
# spec:
# capacity:
# storage: 8Gi
# volumeMode: Filesystem
# storageClassName: standard
# accessModes:
# - ReadWriteOnce
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-kafka-zookeeper-1
# spec:
# capacity:
# storage: 10Gi
# volumeMode: Filesystem
# storageClassName: standard
# accessModes:
# - ReadWriteOnce
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-kafka-broker-1
# spec:
# capacity:
# storage: 8Gi
# volumeMode: Filesystem
# storageClassName: standard
# accessModes:
# - ReadWriteOnce
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-kafka-zookeeper-2
# spec:
# capacity:
# storage: 10Gi
# volumeMode: Filesystem
# storageClassName: standard
# accessModes:
# - ReadWriteOnce
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-kafka-broker-2
# spec:
# capacity:
# storage: 8Gi
# volumeMode: Filesystem
# storageClassName: standard
# accessModes:
# - ReadWriteOnce
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -142,8 +82,7 @@ spec:
resources:
requests:
storage: 8Gi
storageClassName: local-path
volumeName: data-kafka-broker-0
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -156,8 +95,7 @@ spec:
resources:
requests:
storage: 8Gi
storageClassName: local-path
volumeName: data-kafka-broker-1
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -170,8 +108,7 @@ spec:
resources:
requests:
storage: 8Gi
storageClassName: local-path
volumeName: data-kafka-broker-2
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -184,8 +121,7 @@ spec:
resources:
requests:
storage: 10Gi
storageClassName: local-path
volumeName: data-kafka-zookeeper-0
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -198,8 +134,7 @@ spec:
resources:
requests:
storage: 10Gi
storageClassName: local-path
volumeName: data-kafka-zookeeper-1
storageClassName: longhorn
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -212,5 +147,4 @@ spec:
resources:
requests:
storage: 10Gi
storageClassName: local-path
volumeName: data-kafka-zookeeper-2
storageClassName: longhorn
8 changes: 7 additions & 1 deletion kafka/kafka/charts/zookeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,13 @@ volumePermissions:
## cpu: 3
## memory: 1024Mi
##
resources: {}
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
## Init container' Security Context
## Note: the chown of the data folder is done to containerSecurityContext.runAsUser
## and not the below volumePermissions.containerSecurityContext.runAsUser
Expand Down
8 changes: 7 additions & 1 deletion kafka/kafka/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,13 @@ broker:
## cpu: 3
## memory: 1024Mi
##
resources: {}
resources:
requests:
cpu: 1
memory: 2Gi
limits:
cpu: 1
memory: 2Gi
## Kafka pods' Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
## @param broker.podSecurityContext.enabled Enable security context for the pods
Expand Down
7 changes: 5 additions & 2 deletions metric-server/metric-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ spec:
periodSeconds: 10
resources:
requests:
cpu: 100m
memory: 200Mi
cpu: 1
memory: "2Gi"
limits:
cpu: 1
memory: "2Gi"
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
44 changes: 20 additions & 24 deletions scheduled-client/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-mef-pv
spec:
capacity:
storage: 10Gi
volumeMode: Filesystem
storageClassName: local-path
accessModes:
- ReadWriteOnce
local:
path: /home/ubuntu/volume/tm-gla/mef
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- glaciation-sogei-worker101
---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: data-mef-pv
# spec:
# capacity:
# storage: 10Gi
# volumeMode: Filesystem
# storageClassName: longhorn
# accessModes:
# - ReadWriteOnce
# ---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -30,8 +20,7 @@ spec:
resources:
requests:
storage: 10Gi
storageClassName: local-path
volumeName: data-mef-pv
storageClassName: longhorn
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -51,6 +40,13 @@ spec:
containers:
- name: scheduled-client
image: scheduled-client:latest
resources:
requests:
memory: "2Gi"
cpu: 1
limits:
memory: "2Gi"
cpu: 1
imagePullPolicy: Never
ports:
- containerPort: 8080
Expand Down