From bb680288f76e111eb20264cbf41cf5ec0348ebed Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Sat, 9 Oct 2021 00:39:09 +0530 Subject: [PATCH 1/4] chore(install): replace docker with cri Signed-off-by: Rajesh Rajendran --- scripts/helm/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helm/install.sh b/scripts/helm/install.sh index 881d98808..529d08a8c 100755 --- a/scripts/helm/install.sh +++ b/scripts/helm/install.sh @@ -31,7 +31,7 @@ which docker &> /dev/null || { # response {"data":{"valid": TRUE|FALSE, "expiration": expiration date in ms}} # Installing k3s -curl -sL https://get.k3s.io | sudo K3S_KUBECONFIG_MODE="644" INSTALL_K3S_VERSION='v1.19.5+k3s2' INSTALL_K3S_EXEC="--no-deploy=traefik --docker" sh - +curl -sL https://get.k3s.io | sudo K3S_KUBECONFIG_MODE="644" INSTALL_K3S_VERSION='v1.19.5+k3s2' INSTALL_K3S_EXEC="--no-deploy=traefik" sh - mkdir ~/.kube sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config sudo chown $(whoami) ~/.kube/config From 26fc34edef28fcf22368f9e7050e061ace5e19d4 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Sat, 9 Oct 2021 11:14:48 +0530 Subject: [PATCH 2/4] feat(kubernetes): use host volume if nfs not explicitly specified. Note: Can't scale sink/storage more than one pod, and one machine --- .../helm/app/openreplay/templates/deployment.yaml | 12 ++++++++++++ scripts/helm/app/openreplay/templates/pvc.yaml | 2 +- scripts/helm/app/sink.yaml | 3 ++- scripts/helm/app/storage.yaml | 3 ++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/helm/app/openreplay/templates/deployment.yaml b/scripts/helm/app/openreplay/templates/deployment.yaml index a2259a852..187025b74 100644 --- a/scripts/helm/app/openreplay/templates/deployment.yaml +++ b/scripts/helm/app/openreplay/templates/deployment.yaml @@ -47,6 +47,17 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} {{- if .Values.pvc }} + {{- if eq .Values.pvc.name "hostPath" }} + volumeMounts: + - mountPath: {{ .Values.pvc.mountPath }} + name: {{ .Values.pvc.name }} + volumes: + - name: mydir + hostPath: + # Ensure the file directory is created. + path: {{ .Values.pvc.hostMountPath }} + type: DirectoryOrCreate + {{- else }} volumeMounts: - name: {{ .Values.pvc.name }} mountPath: {{ .Values.pvc.mountPath }} @@ -55,6 +66,7 @@ spec: persistentVolumeClaim: claimName: {{ .Values.pvc.volumeName }} {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/scripts/helm/app/openreplay/templates/pvc.yaml b/scripts/helm/app/openreplay/templates/pvc.yaml index 2180024e6..fc02fa6c3 100644 --- a/scripts/helm/app/openreplay/templates/pvc.yaml +++ b/scripts/helm/app/openreplay/templates/pvc.yaml @@ -1,5 +1,5 @@ {{- if .Values.pvc }} -{{- if .Values.pvc.create }} +{{- if and (.Values.pvc.create) (ne .Values.pvc.name "hostPath") }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/scripts/helm/app/sink.yaml b/scripts/helm/app/sink.yaml index 51113fdd0..8d6239d3e 100644 --- a/scripts/helm/app/sink.yaml +++ b/scripts/helm/app/sink.yaml @@ -23,10 +23,11 @@ resources: pvc: create: true - name: nfs + name: hostPath storageClassName: nfs volumeName: nfs mountPath: /mnt/efs + hostMountPath: /openreplay/storage/nfs storageSize: 5Gi env: diff --git a/scripts/helm/app/storage.yaml b/scripts/helm/app/storage.yaml index 39cca7f6b..ef839210e 100644 --- a/scripts/helm/app/storage.yaml +++ b/scripts/helm/app/storage.yaml @@ -24,10 +24,11 @@ resources: pvc: # PVC Created from filesink.yaml create: false - name: nfs + name: hostPath storageClassName: nfs volumeName: nfs mountPath: /mnt/efs + hostMountPath: /openreplay/storage/nfs storageSize: 5Gi env: From 8b60e52b655538e95bcaa9e60d8710c30862b1a4 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Sat, 9 Oct 2021 11:33:38 +0530 Subject: [PATCH 3/4] feat(kubernetes): remove nfs-server-provisioner Signed-off-by: Rajesh Rajendran --- scripts/helm/roles/openreplay/defaults/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helm/roles/openreplay/defaults/main.yaml b/scripts/helm/roles/openreplay/defaults/main.yaml index bcd303672..e706891fb 100644 --- a/scripts/helm/roles/openreplay/defaults/main.yaml +++ b/scripts/helm/roles/openreplay/defaults/main.yaml @@ -4,6 +4,6 @@ db_name: "" app_name: "" db_list: - "minio" - - "nfs-server-provisioner" - "postgresql" - "redis" + # - "nfs-server-provisioner" From 7026249fb8606f3da03b3696dba2aa7199f67ca0 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Tue, 19 Oct 2021 00:38:55 +0530 Subject: [PATCH 4/4] chore(helm): use static mount name --- scripts/helm/app/openreplay/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/helm/app/openreplay/templates/deployment.yaml b/scripts/helm/app/openreplay/templates/deployment.yaml index 187025b74..e578b4bea 100644 --- a/scripts/helm/app/openreplay/templates/deployment.yaml +++ b/scripts/helm/app/openreplay/templates/deployment.yaml @@ -50,16 +50,16 @@ spec: {{- if eq .Values.pvc.name "hostPath" }} volumeMounts: - mountPath: {{ .Values.pvc.mountPath }} - name: {{ .Values.pvc.name }} + name: datadir volumes: - - name: mydir + - name: datadir hostPath: # Ensure the file directory is created. path: {{ .Values.pvc.hostMountPath }} type: DirectoryOrCreate {{- else }} volumeMounts: - - name: {{ .Values.pvc.name }} + - name: datadir mountPath: {{ .Values.pvc.mountPath }} volumes: - name: {{ .Values.pvc.name }}