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

update readme to support running fusion on local k8s cluster #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
28 changes: 28 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,34 @@ aks_<cluster>_<release>_upgrade_fusion.sh

If you're not running on managed K8s platform such as GKE, AKS, or EKS, you can use Helm to install the Fusion chart to an existing Kubernetes cluster.

For eample, you can run local https://kind.sigs.k8s.io/docs/user/quick-start/[`kind`^] k8s cluster on mac with the following commands.
mllu marked this conversation as resolved.
Show resolved Hide resolved

(To install Fusion locally, you should have a node with at least 12GB of memory, 100GB of disk and 4 CPU cores. The recommended setup is 16GB (or more) of memory and 8+ CPU cores.)
```
# assume you have brew installed, if not, please refer to https://brew.sh
brew install kind
kind create cluster
```

Then run the https://github.com/lucidworks/fusion-cloud-native/blob/master/setup_f5_k8s.sh.sh[`setup_f5_k8s.sh`^] script to install Fusion 5.x into local k8s cluster.
```
mllu marked this conversation as resolved.
Show resolved Hide resolved
./setup_f5_gke.sh -c <cluster_name> -r <release> -n <namespace> --helm-chart fusion-5.0.3-2.tgz
mllu marked this conversation as resolved.
Show resolved Hide resolved
```

Make sure all the pods are healthy and running by watching the cluster rollout using: `kubectl get pods --watch`

Hit ctrl-c once all the pods are running.

Run the following commands to access Fusion locally on http://localhost:6764
```
kubectl port-forward svc/proxy 6764:6764
```

To delete the local cluster, simply run
```
kind delete cluster
```

[[helm-only]]
=== Use Helm v3 to Install Fusion

Expand Down
Binary file added fusion-5.0.3-2.tgz
Binary file not shown.
18 changes: 17 additions & 1 deletion setup_f5_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ FORCE=0
CUSTOM_MY_VALUES=()
MY_VALUES=()
DRY_RUN=""
HELM_CHART=""
SOLR_REPLICAS=1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOLR_REPLICAS is a variable used below without default value, default to 1 here, let me know if it's intended to not have default value

SOLR_DISK_GB=50
NODE_POOL=""

Expand All @@ -40,6 +42,7 @@ function print_usage() {
echo -e " defaults to 'install' which installs Prometheus and Grafana from the stable Helm repo,"
echo -e " 'provided' enables pod annotations on Fusion services to work with Prometheus but does not install anything\n"
echo -e " --version Fusion Helm Chart version; defaults to the latest release from Lucidworks, such as ${CHART_VERSION}\n"
echo -e " --helm-chart Custom fusion helm chart to install to k8s cluster\n"
mllu marked this conversation as resolved.
Show resolved Hide resolved
echo -e " --values Custom values file containing config overrides; defaults to gke_<cluster>_<namespace>_fusion_values.yaml"
echo -e " (can be specified multiple times to add additional yaml files, see example-values/*.yaml)\n"
echo -e " --upgrade Perform a Helm upgrade on an existing Fusion installation\n"
Expand Down Expand Up @@ -116,6 +119,14 @@ if [ $# -gt 0 ]; then
CHART_VERSION="$2"
shift 2
;;
--helm-chart)
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
print_usage "$SCRIPT_CMD" "Missing value for the --node-pool parameter!"
exit 1
fi
HELM_CHART="$2"
shift 2
;;
--values)
if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
print_usage "$SCRIPT_CMD" "Missing value for the --values parameter!"
Expand Down Expand Up @@ -491,7 +502,12 @@ if [ "$is_helm_v3" != "" ]; then
kubectl create namespace "${NAMESPACE}"
fi
# looks like Helm V3 doesn't like the -n parameter for the release name anymore
helm install "${RELEASE}" ${lw_helm_repo}/fusion --timeout=240s --namespace "${NAMESPACE}" ${VALUES_STRING} --version "${CHART_VERSION}"
if [ "${HELM_CHART}" == "" ]; then
helm install "${RELEASE}" ${lw_helm_repo}/fusion --timeout=240s --namespace "${NAMESPACE}" ${VALUES_STRING} --version "${CHART_VERSION}"
else
# only support helm3 for local k8s cluster
helm install "${RELEASE}" "${HELM_CHART}" --timeout=240s --namespace "${NAMESPACE}" ${VALUES_STRING} --version "${CHART_VERSION}"
fi
else
helm install ${lw_helm_repo}/fusion --timeout 240 --namespace "${NAMESPACE}" -n "${RELEASE}" ${VALUES_STRING} --version "${CHART_VERSION}"
fi
Expand Down