Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'integration' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
john-a-fletcher committed Oct 22, 2021
2 parents 4419ddf + 43ae9d8 commit f55922b
Show file tree
Hide file tree
Showing 12 changed files with 581 additions and 37 deletions.
37 changes: 26 additions & 11 deletions k8_cortx_cloud/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,33 @@ Shared glusterFS folder on the worker nodes and inside the Pod containers is loc
###########################################################
# Replacing a dummy container with real CORTX container #
###########################################################
See the following example from CORTX Data helm chart, replace the image and
command section hightlighted with "<<===" with the relevant CORTX container
commands required for the entrypoint. An "args" section also can
be added to provide additional arguments.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The Helm charts work with both "dummy" and "CORTX ALL" containers.
If image is centos:7 helm runs in "dummy" mode any other name runs "CORTX ALL" mode

{- if eq $.Values.cortxdata.image "centos:7" }} # DO NOT CHANGE
command: ["/bin/sleep", "3650d"] # DO NOT CHANGE
{{- else }} # DO NOT CHANGE
command: ["/bin/sleep", "3650d"] #<<=========================== REPLACE THIS WITH THE CORTX ENTRY POINT
{{- end }} # DO NOT CHANGE
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

See the following example from CORTX Data helm chart, replace the command section
hightlighted with "<<===" with the relevant CORTX container commands required for
the entrypoint. An "args" section also can be added to provide additional arguments.

./k8_cortx_cloud/cortx-cloud-helm-pkg/cortx-data/templates/cortx-data-pod.yaml

containers:
- name: cortx-s3-server
- name: cortx-s3-haproxy
image: {{ .Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
command: ["/bin/sleep", "3650d"] <<===
{- if eq $.Values.cortxdata.image "centos:7" }} # DO NOT CHANGE
command: ["/bin/sleep", "3650d"] # DO NOT CHANGE
{{- else }} # DO NOT CHANGE
command: ["/bin/sleep", "3650d"] #<<=========================== REPLACE THIS WITH THE CORTX ENTRY POINT
{{- end }} # DO NOT CHANGE
volumeDevices:
{{- range .Files.Lines .Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down Expand Up @@ -90,13 +105,13 @@ The images can be changed by modifying the solution.yaml file section solution.i
solution:
namespace: default
images:
cortxcontrolprov: centos:7
cortxcontrol: centos:7
cortxdataprov: centos:7
cortxdata: centos:7
cortxcontrolprov: ghcr.io/seagate/cortx-all:2.0.0-latest-custom-ci
cortxcontrol: ghcr.io/seagate/cortx-all:2.0.0-latest-custom-ci
cortxdataprov: ghcr.io/seagate/cortx-all:2.0.0-latest-custom-ci
cortxdata: ghcr.io/seagate/cortx-all:2.0.0-latest-custom-ci
openldap: ghcr.io/seagate/symas-openldap:standalone
consul: hashicorp/consul:1.10.0
kafka: bitnami/kafka:3.0.0-debian-10-r7
zookeeper: zookeeper:3.7.0-debian-10-r182
zookeeper: bitnami/zookeeper:3.7.0-debian-10-r182
gluster: docker.io/gluster/gluster-centos:latest
rancher: rancher/local-path-provisioner:v0.0.20
1 change: 1 addition & 0 deletions k8_cortx_cloud/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION v0.0.9
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ spec:
imagePullPolicy: IfNotPresent
command:
- /bin/sh
{{- if eq .Values.cortxcontrolprov.image "centos:7" }}
args:
- -c
- sleep $(shuf -i 5-10 -n 1)s
{{- else }}
args:
- -c
- /opt/seagate/cortx/provisioner/bin/cortx_deploy -f /etc/cortx/solution -c yaml:///etc/cortx/cluster.conf ;
{{- end }}
volumeMounts:
- name: {{ .Values.cortxcontrolprov.cfgmap.volmountname }}
mountPath: {{ .Values.cortxcontrolprov.cfgmap.mountpath }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,42 @@ spec:
- name: cortx-free-space-monitor
image: {{ .Values.cortxcontrol.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxcontrol.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command: ["/bin/sleep", "3650d"]
{{- end }}
volumeMounts:
- name: {{ .Values.cortxcontrol.cfgmap.volmountname }}
mountPath: {{ .Values.cortxcontrol.cfgmap.mountpath }}
- name: {{ .Values.cortxcontrol.sslcfgmap.volmountname }}
mountPath: {{ .Values.cortxcontrol.sslcfgmap.mountpath }}
- name: {{ .Values.cortxcontrol.machineid.volmountname }}
mountPath: {{ .Values.cortxcontrol.machineid.mountpath }}
- name: {{ .Values.cortxgluster.pv.name }}
mountPath: {{ .Values.cortxgluster.pv.mountpath }}
- name: local-path-pv
mountPath: {{ .Values.cortxcontrol.localpathpvc.mountpath }}
{{- range .Files.Lines .Values.cortxcontrol.secretinfo }}
- name: {{ printf "%s" . }}
mountPath: /etc/cortx/solution/secret
readOnly: true
{{- end }}
env:
- name: UDS_CLOUD_CONTAINER_NAME
value: {{ .Values.cortxcontrol.name }}
- name: cortx-fsm-motr
image: {{ .Values.cortxcontrol.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxcontrol.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/motr/bin/motr_setup start --services fsm --config yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeMounts:
- name: {{ .Values.cortxcontrol.cfgmap.volmountname }}
mountPath: {{ .Values.cortxcontrol.cfgmap.mountpath }}
Expand All @@ -64,7 +99,15 @@ spec:
- name: cortx-bg-producer
image: {{ .Values.cortxcontrol.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxcontrol.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/s3/bin/s3_start --service s3bgproducer -c yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeMounts:
- name: {{ .Values.cortxcontrol.cfgmap.volmountname }}
mountPath: {{ .Values.cortxcontrol.cfgmap.mountpath }}
Expand All @@ -87,7 +130,15 @@ spec:
- name: cortx-csm-agent
image: {{ .Values.cortxcontrol.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxcontrol.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /usr/bin/csm_agent start -c yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeMounts:
- name: {{ .Values.cortxcontrol.cfgmap.volmountname }}
mountPath: {{ .Values.cortxcontrol.cfgmap.mountpath }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ spec:
imagePullPolicy: IfNotPresent
command:
- /bin/sh
{{- if eq .Values.cortxdataprov.image "centos:7" }}
args:
- -c
- sleep $(shuf -i 5-10 -n 1)s
{{- else }}
args:
- -c
- /opt/seagate/cortx/provisioner/bin/cortx_deploy -f /etc/cortx/solution -c yaml:///etc/cortx/cluster.conf ;
{{- end }}
volumeDevices:
{{- range .Files.Lines .Values.cortxdataprov.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ spec:
- name: cortx-s3-haproxy
image: {{ .Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/s3/bin/s3_start --service haproxy -c yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeDevices:
{{- range .Files.Lines .Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down Expand Up @@ -83,7 +91,15 @@ spec:
- name: cortx-s3-auth-server
image: {{ .Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/s3/bin/s3_start --service s3authserver -c yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeDevices:
{{- range .Files.Lines .Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down Expand Up @@ -117,8 +133,15 @@ spec:
value: {{ $.Values.cortxdata.name }}
- name: S3_INDEX
value: {{ printf "%d" (add 1 $i) | quote }}
command: ["/bin/sh", "-c"]
args: ["echo $S3_INDEX > /root/testing; /bin/sleep 3650d"]
{{- if eq $.Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/s3/bin/s3_start --service s3server --index $S3_INDEX -c yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeMounts:
- name: {{ $.Values.cortxdata.cfgmap.volmountname }}
mountPath: {{ $.Values.cortxdata.cfgmap.mountpath }}
Expand All @@ -141,7 +164,15 @@ spec:
- name: cortx-motr-hax
image: {{ .Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/hare/bin/hare_setup start --config yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeDevices:
{{- range .Files.Lines .Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down Expand Up @@ -170,7 +201,11 @@ spec:
- name: {{ printf "cortx-motr-client-%03d" (add 1 $i) }}
image: {{ $.Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
{{- if eq $.Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command: ["/bin/sleep", "3650d"]
{{- end }}
volumeDevices:
{{- range $.Files.Lines $.Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down Expand Up @@ -199,7 +234,15 @@ spec:
- name: cortx-motr-confd
image: {{ .Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/motr/bin/motr_setup start --services confd --config yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeDevices:
{{- range .Files.Lines .Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down Expand Up @@ -228,7 +271,20 @@ spec:
- name: {{ printf "cortx-motr-ios-%03d" (add 1 $i) }}
image: {{ $.Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
env:
- name: UDS_CLOUD_CONTAINER_NAME
value: {{ $.Values.cortxdata.name }}
- name: IO_INDEX
value: {{ printf "%d" (add 1 $i) | quote }}
{{- if eq $.Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/motr/bin/motr_setup start --services ioservice --idx $IO_INDEX --config yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeDevices:
{{- range $.Files.Lines $.Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand All @@ -250,16 +306,21 @@ spec:
mountPath: /etc/cortx/solution/secret
readOnly: true
{{- end }}
env:
- name: UDS_CLOUD_CONTAINER_NAME
value: {{ $.Values.cortxdata.name }}
ports:
- containerPort: {{ printf "%d" (add $i $.Values.cortxdata.motr.startportnum) }}
{{- end }}
- name: cortx-s3-bg-consumer
image: {{ .Values.cortxdata.image }}
imagePullPolicy: IfNotPresent
{{- if eq .Values.cortxdata.image "centos:7" }}
command: ["/bin/sleep", "3650d"]
{{- else }}
command:
- /bin/sh
args:
- -c
- /opt/seagate/cortx/s3/bin/s3_start --service s3bgconsumer -c yaml:///etc/cortx/cluster.conf;
{{- end }}
volumeDevices:
{{- range .Files.Lines .Values.cortxdata.mountblkinfo }}
- name: {{ printf "cortx-data-%s-pv-%s" ( base .) $nodename }}
Expand Down
5 changes: 4 additions & 1 deletion k8_cortx_cloud/deploy-cortx-cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ helm repo add hashicorp https://helm.releases.hashicorp.com
if [[ $storage_class == "local-path" ]]
then
printf "Install Rancher Local Path Provisioner"
rancher_prov_path="$(pwd)/cortx-cloud-3rd-party-pkg/rancher-provisioner"
rancher_prov_path="$(pwd)/cortx-cloud-3rd-party-pkg/auto-gen-rancher-provisioner"
# Clean up auto gen Rancher Provisioner folder in case it still exists and was not
# clearned up previously by the destroy-cortx-cloud script.
rm -rf $rancher_prov_path
mkdir -p $rancher_prov_path
rancher_prov_file="$rancher_prov_path/local-path-storage.yaml"
cp $(pwd)/cortx-cloud-3rd-party-pkg/templates/local-path-storage-template.yaml $rancher_prov_file
Expand Down
8 changes: 4 additions & 4 deletions k8_cortx_cloud/destroy-cortx-cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ printf "########################################################\n"
printf "# Delete CORTX GlusterFS \n"
printf "########################################################\n"
gluster_vol="myvol"
gluster_folder="/etc/gluster"
pod_ctr_mount_path="/mnt/fs-local-volume/$gluster_folder"

# Build Gluster endpoint array
gluster_ep_array=[]
Expand All @@ -137,7 +135,9 @@ do
printf "Stop and delete GlusterFS volume: $gluster_node_name \n"
printf "=================================================================================\n"
kubectl exec --namespace=$namespace -i $gluster_node_name -- bash -c \
'rm -rf /etc/gluster/* /etc/gluster/.glusterfs/'
'rm -rf /etc/gluster/* /etc/gluster/.glusterfs/'
kubectl exec --namespace=$namespace -i $gluster_node_name -- bash -c \
'mkdir -p /etc/gluster/var/log/cortx'
if [[ "$count" == 0 ]]; then
first_gluster_node_name=$gluster_node_name
echo y | kubectl exec --namespace=$namespace -i $gluster_node_name -- gluster volume stop $gluster_vol
Expand Down Expand Up @@ -260,7 +260,7 @@ printf "# Delete Consul #\n"
printf "########################################################\n"
helm delete consul

rancher_prov_path="$(pwd)/cortx-cloud-3rd-party-pkg/rancher-provisioner"
rancher_prov_path="$(pwd)/cortx-cloud-3rd-party-pkg/auto-gen-rancher-provisioner"
rancher_prov_file="$rancher_prov_path/local-path-storage.yaml"
kubectl delete -f $rancher_prov_file
rm -rf $rancher_prov_path
Expand Down
16 changes: 9 additions & 7 deletions k8_cortx_cloud/prereq-deploy-cortx-cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ sysctl -w vm.max_map_count=30000000;
printf "####################################################\n"
printf "# Prep for CORTX deployment \n"
printf "####################################################\n"

if [[ $(findmnt -m $fs_mount_path) ]];then
echo "$fs_mount_path already mounted..."
else
mkdir -p $fs_mount_path
echo y | mkfs.ext4 $disk
mount -t ext4 $disk $fs_mount_path
fi

# Prep for Rancher Local Path Provisioner deployment
echo "Create folder '$fs_mount_path/local-path-provisioner'"
mkdir -p $fs_mount_path/local-path-provisioner
Expand All @@ -128,13 +137,6 @@ while true; do
sleep 1s
done

if [[ $(findmnt -m $fs_mount_path) ]];then
echo "$fs_mount_path already mounted..."
else
echo y | mkfs.ext4 $disk
mount -t ext4 $disk $fs_mount_path
fi

# Prep for GlusterFS deployment
yum install glusterfs-fuse -y
mkdir -p $fs_mount_path/etc/gluster
Expand Down
Loading

0 comments on commit f55922b

Please sign in to comment.