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

Helm install script #27

Closed

Conversation

Fortune-Ndlovu
Copy link

@Fortune-Ndlovu Fortune-Ndlovu commented Jun 18, 2024

Issue: RHIDP-2706 - script CLI helm installation for OCP

Continued from RHIDP-2614 re: redhat-developer/red-hat-developers-documentation-rhdh#287

Instead of giving people 20 steps to iterate though, AND having the same steps captured by QE when doing install validation tests, we should instead:

  • I create a script that can handle both install paths
  • Link to that from the docs
  • Reuse it in testing

The script does the following:

  • detect if oc is installed; fail if not found and report error to user with call to action re: installing it
  • detect if user is logged into a cluster and fail if not with call to action (oc command to log in)
  • if cluster router base can be detected, use that value to update the helm chart installation; if not, fail and request user pass in commandline flag as cluster router base could not be detected (can test this failure case with dev sandbox; can test passing case with clusterbot)

The script is stored in https://github.com/redhat-developer/rhdh-chart/ using a similar documentation/script approach to

Checklist

  • Chart version bumped in Chart.yaml according to semver.
  • Variables are documented in the values.yaml and added to the README.md. The pre-commit utility can be used to generate the necessary content. Use pre-commit run -a to apply changes.
  • JSON Schema template updated and re-generated the raw schema via pre-commit hook.
  • List tests pass for Chart using the Chart Testing tool and the ct lint command.

Fortune Ndlovu added 4 commits June 18, 2024 06:21
…ing a combination of commands get route or get ingress followed by grep to search for a line containing console or default and then awk to extract the desired field from that line, I went with more direct approach with -o=jsonpath option to extract the host value directly from the JSON output of the get route or get ingress command.
… available, and examples of usage all using the usage function, this helps keep docs information centralized reducing cognitive load.
@openshift-ci openshift-ci bot requested review from nickboldt and tumido June 18, 2024 20:17
@coreydaley
Copy link
Member

The name of the script install-helm.sh makes it sound like it installs the Helm executable. I think it should just be named install.sh.

Copy link
Member

@coreydaley coreydaley left a comment

Choose a reason for hiding this comment

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

Off to a good start! I made some suggestions.

scripts/install-helm.sh Outdated Show resolved Hide resolved
scripts/install-helm.sh Outdated Show resolved Hide resolved
scripts/install-helm.sh Outdated Show resolved Hide resolved
scripts/install-helm.sh Outdated Show resolved Hide resolved
scripts/install-helm.sh Outdated Show resolved Hide resolved
Fortune Ndlovu added 3 commits June 19, 2024 12:16
Included logic to validate the --cli parameter.
Retained the automatic detection of CLI if --cli is not provided.
Updated usage instructions to reflect the new --cli option.
Fortune Ndlovu added 2 commits June 19, 2024 14:54
…suring that the script exists early if the necessary components are not available. This prevents unnecessary execution of other parts of the script.
…to specify a custom release name or generate one automatically.
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
@nickboldt
Copy link
Member

Apologies but I've just realized two things:

a) this issue was only about helm CLI installs on OCP, and
b) we already have doc for aks and eks helm cli installs:

https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.1/html-single/administration_guide_for_red_hat_developer_hub/index#proc-rhdh-deploy-eks-using-helm_admin-rhdh and
https://docs.redhat.com/en/documentation/red_hat_developer_hub/1.1/html-single/administration_guide_for_red_hat_developer_hub/index#proc-rhdh-deploy-aks-using-helm_admin-rhdh

so perhaps we can make this script simpler and just handle the OCP install case. Keep It Super Simple, as they say.

@Fortune-Ndlovu
Copy link
Author

cc @rm3l

for review, please

@Fortune-Ndlovu Fortune-Ndlovu requested a review from rm3l July 16, 2024 10:35
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
…action for the user so they know where to get oc or helm to install it.
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.md Outdated Show resolved Hide resolved
scripts/install.sh Outdated Show resolved Hide resolved
…de it if it does. And removing the md file because the instructions are present in the usage function of the script.
Copy link

sonarcloud bot commented Jul 22, 2024

Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

LGTM. Tested on Dev Sandbox and ClusterBot.

@rm3l rm3l added the lgtm label Jul 22, 2024
@Fortune-Ndlovu Fortune-Ndlovu closed this by deleting the head repository Aug 1, 2024
@nickboldt
Copy link
Member

PR abandoned, because https://issues.redhat.com/browse/RHIDP-2706 was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants