diff --git a/openstack-helm-ced30abead0bddb528d0c5fb7c1627dd8f1e22ba.tar.gz b/openstack-helm-ced30abead0bddb528d0c5fb7c1627dd8f1e22ba.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4e618e3ccfadcfc7bb7ee542300119bf5fb58125 Binary files /dev/null and b/openstack-helm-ced30abead0bddb528d0c5fb7c1627dd8f1e22ba.tar.gz differ diff --git a/openstack-helm.sh b/openstack-helm.sh new file mode 100644 index 0000000000000000000000000000000000000000..eed3e7870917ecc00956d92ae1fe5d51def2c6ab --- /dev/null +++ b/openstack-helm.sh @@ -0,0 +1,130 @@ +#!/bin/bash + +set -e + +OPENSTACK_HELM='/usr/share/openstack-helm/openstack-helm' +OPENSTACK_HELM_INFRA='/usr/share/openstack-helm/openstack-helm-infra' + +function menu { + echo "Welcome to OpenStack-Helm installation program for openEuler. I will guide you through the installation. " + echo "Please refer to https://docs.openstack.org/openstack-helm/latest/ to get more information about OpenStack-Helm. " + echo "We recommend doing this on a new bare metal or virtual OS installation. " + + while :; do + echo -e "\n" + echo "Now you have the following options: " + echo "i: Start automated installation" + echo "c: Check if all pods in Kubernetes are working" + echo "e: Exit" + + read -p "Your choice? [i/c/e]: " x + case $x in + [Ii]* ) install;; + [Ee]* ) exit 0;; + [Cc]* ) check;; + * ) echo "Input invalid.";; + esac + done +} + +function install { + while :; do + echo -e "\n" + echo "There are two storage backends available for OpenStack-Helm: NFS and CEPH. Which storage backend would you like to use? " + echo "n: NFS storage backend" + echo "c: CEPH storage backend" + echo "b: Go back to parent menu" + + read -p "Your choice? [n/c/b]: " x + case $x in + [Nn]* ) install_nfs;; + [Cc]* ) install_ceph;; + [Bb]* ) menu;; + * ) echo "Input invalid.";; + esac + done +} + +function install_nfs { + cd $OPENSTACK_HELM + echo "I will start installing OpenStack-Helm with NFS as storage backend to your system. Please press ENTER to continue. " + read -p "" + + set -x + + ./tools/deployment/developer/common/010-deploy-k8s.sh + ./tools/deployment/developer/common/020-setup-client.sh + ./tools/deployment/developer/common/030-ingress.sh + ./tools/deployment/developer/nfs/040-nfs-provisioner.sh + ./tools/deployment/developer/nfs/050-mariadb.sh + ./tools/deployment/developer/nfs/060-rabbitmq.sh + ./tools/deployment/developer/nfs/070-memcached.sh + ./tools/deployment/developer/nfs/080-keystone.sh + ./tools/deployment/developer/nfs/090-heat.sh + ./tools/deployment/developer/nfs/100-horizon.sh + ./tools/deployment/developer/nfs/120-glance.sh + ./tools/deployment/developer/nfs/140-openvswitch.sh + ./tools/deployment/developer/nfs/150-libvirt.sh + ./tools/deployment/developer/nfs/160-compute-kit.sh + ./tools/deployment/developer/nfs/170-setup-gateway.sh + + set +x + + echo "Installation complete!" +} + + +function install_ceph { + cd $OPENSTACK_HELM + echo "I will start installing OpenStack-Helm with CEPH as storage backend to your system. Please press ENTER to continue. " + read -p "" + + set -x + + ./tools/deployment/developer/common/010-deploy-k8s.sh + ./tools/deployment/developer/common/020-setup-client.sh + ./tools/deployment/developer/common/030-ingress.sh + ./tools/deployment/developer/ceph/040-ceph.sh + ./tools/deployment/developer/ceph/050-mariadb.sh + ./tools/deployment/developer/ceph/060-rabbitmq.sh + ./tools/deployment/developer/ceph/070-memcached.sh + ./tools/deployment/developer/ceph/080-keystone.sh + ./tools/deployment/developer/ceph/090-heat.sh + ./tools/deployment/developer/ceph/100-horizon.sh + ./tools/deployment/developer/ceph/120-glance.sh + ./tools/deployment/developer/ceph/140-openvswitch.sh + ./tools/deployment/developer/ceph/150-libvirt.sh + ./tools/deployment/developer/ceph/160-compute-kit.sh + ./tools/deployment/developer/ceph/170-setup-gateway.sh + + set +x + + echo "Installation complete!" +} + +function check { + echo "Showing pods that are NOT running or completed: " + echo "STAUTS NAME NAMESPACE" + kubectl get pods -A -o json | jq -r \ + '.items[] | .status.phase + " " + .metadata.name + " " + .metadata.namespace' | grep -v \ + -e "Running" -e "Succeeded" +} + +if [ ! -f /etc/os-release ]; then + echo "Cannot determine current distribution. " + exit 1 +fi + +. /etc/os-release +HOST_OS=${HOST_OS:="${ID}"} +if [ ! "$ID" == "openEuler" ]; then + echo "This installation program is for openEuler only. " + exit 1 +fi + +if [ ! -d $OPENSTACK_HELM ] || [ ! -d $OPENSTACK_HELM_INFRA ]; then + echo "Source file not ready, please reinstall the RPM package. " + exit 1 +fi + +menu \ No newline at end of file diff --git a/openstack-helm.spec b/openstack-helm.spec new file mode 100644 index 0000000000000000000000000000000000000000..158efade51812d1bf0ad10517e7942dc9d09f469 --- /dev/null +++ b/openstack-helm.spec @@ -0,0 +1,35 @@ +Name: openstack-helm +Version: ced30abead0bddb528d0c5fb7c1627dd8f1e22ba +Release: 0 +Summary: The goal of OpenStack-Helm is to enable deployment, maintenance, and upgrading of loosely coupled OpenStack services and their dependencies individually or as part of complex environments. + +License: ASL 2.0 +URL: https://opendev.org/openstack/openstack-helm +Source0: openstack-helm-%{version}.tar.gz + +Source1: openstack-helm.sh + +BuildArch: noarch + +Requires: openstack-helm + +%description +The goal of OpenStack-Helm is to enable deployment, maintenance, and upgrading of loosely coupled OpenStack services and their dependencies individually or as part of complex environments. + +%prep +%setup -q -n openstack-helm-%{version} + +%build + +%install +install -d -m755 %{buildroot}%{_datadir}/openstack-helm +install -D -m755 %{SOURCE1} %{buildroot}%{_bindir}/openstack-helm +cp -vr %{_builddir}/openstack-helm-%{version} %{buildroot}%{_datadir}/openstack-helm/openstack-helm + +%files +%{_datadir}/openstack-helm/openstack-helm +%{_bindir}/openstack-helm + +%changelog +* Tue Aug 30 2022 Yinuo Deng - ced30abead0bddb528d0c5fb7c1627dd8f1e22ba-0 +- Initial version \ No newline at end of file