Commit f96e6d05 authored by ismail's avatar ismail
Browse files

Helm: added persistance storage for pcaps


Signed-off-by: default avatarismail <mohammed.ismail@openairinterface.org>
parent db6a881c
......@@ -32,8 +32,12 @@ spec:
- name: tcpdump
image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
command:
- /bin/sleep
- infinity
- /bin/sh
- -c
- /usr/sbin/tcpdump -i net1 -w /pcap/oai-amf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: amf
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
......@@ -262,6 +266,10 @@ spec:
key: operatorKey
# command: ["/bin/bash","-c"]
# args: ["/openair-amf/bin/entrypoint.sh; /openair-amf/bin/oai_amf -c /openair-amf/etc/amf.conf -o"]
volumes:
- name: cn5g-pv
persistentVolumeClaim:
claimName: cn5g-pvc
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
......
......@@ -28,8 +28,12 @@ spec:
- name: tcpdump
image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
command:
- /bin/sleep
- infinity
- /bin/sh
- -c
- /usr/sbin/tcpdump -i net1 -w /pcap/oai-nrf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: nrf
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
......@@ -73,6 +77,10 @@ spec:
configMapKeyRef:
name: {{ .Chart.Name }}-configmap
key: nrfApiVersion
volumes:
- name: cn5g-pv
persistentVolumeClaim:
claimName: cn5g-pvc
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
......
{{- if .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cn5g-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: managed-nfs-storage
resources:
requests:
storage: 1Gi
{{- end }}
\ No newline at end of file
......@@ -62,7 +62,7 @@ config:
persistence:
# make it true for the first time when you want to create persistance volume
# and then false
enabled: false
enabled: true
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
......
......@@ -28,8 +28,12 @@ spec:
- name: tcpdump
image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
command:
- /bin/sleep
- infinity
- /bin/sh
- -c
- /usr/sbin/tcpdump -i net1 -w /pcap/oai-smf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: smf
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
......@@ -151,6 +155,10 @@ spec:
#command:
# - /bin/sleep
# - infinity
volumes:
- name: cn5g-pv
persistentVolumeClaim:
claimName: cn5g-pvc
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
......
......@@ -74,7 +74,12 @@ config:
nrfPort : "80"
nrfApiVersion: "v1"
upfIpv4Address: "192.168.18.179"
persistence:
# make it true for the first time when you want to create persistance volume
# and then false
enabled: false
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
......
......@@ -34,8 +34,12 @@ spec:
- name: tcpdump
image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
command:
- /bin/sleep
- infinity
- /bin/sh
- -c
- /usr/sbin/tcpdump -i any -w /pcap/oai-spgwu_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
volumeMounts:
- mountPath: "/pcap"
name: cn5g-pv
- name: spgwu
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
......@@ -112,9 +116,9 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
volumes:
- name: {{ .Chart.Name }}-{{ .Values.namespace }}-pv
persistentVolumeClaim:
claimName: {{ .Chart.Name }}-{{ .Values.namespace }}-pvc
- name: cn5g-pv
persistentVolumeClaim:
claimName: cn5g-pvc
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
......
......@@ -232,13 +232,11 @@ pipeline {
}
}
}
dir('ci-scripts') {
try {
sh "python3 helmDeploy.py --mode=GetLogs --remoteIPAdd=${params.remote_IPAddress} --remoteUserName=${remote_Username} --remotePassword=${remote_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
} catch (Exception e) {
echo "Unable to get the 5gcn components pod logs"
}
}
try {
sh "python3 ci-scripts/helmDeploy.py --mode=GetLogs --remoteIPAdd=${params.remote_IPAddress} --remoteUserName=${remote_Username} --remotePassword=${remote_Password} --OCUserName=${OC_Username} --OCPassword=${OC_Password} --OCProjectName=${OC_ProjectName} --imageTags=${imageTags}"
} catch (Exception e) {
echo "Unable to get the 5gcn components pod logs"
}
}
}
}
......
......@@ -37,6 +37,7 @@ import os
import re
import time
import sys
import subprocess
logging.basicConfig(
level=logging.DEBUG,
......@@ -264,8 +265,8 @@ class ClusterDeploy:
# copying the pcaps
lssh = subprocess.Popen(f'ls /nfs/prov-vols | grep {self.OCProjectName}-cn5g-pvc',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf-8').stdout.readlines()
pStorage = str(lssh[0]).strip()
lssh = subprocess.Popen(f'mkdir -p ../archives/pcap',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
lssh = subprocess.Popen(f'cp /nfs/prov-vols/{pStorage}/* ../archives/pcap/',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
lssh = subprocess.Popen(f'mkdir -p archives/pcap',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
lssh = subprocess.Popen(f'cp /nfs/prov-vols/{pStorage}/* archives/pcap/',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
# copy the pods logs
mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment