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

Quickstart Setup: inline scripts and some UX improvements #532

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

jasonmadigan
Copy link
Member

@jasonmadigan jasonmadigan commented Apr 10, 2024

  • Inline functions pulled in previously from the MGC repo via cURL
  • Improve CLI UX
    • New messaging throughout, with colours / emoji
    • Summary messages for beginning of script "what is about to happen, what you'll get at the end"
    • Summary of what's been setup at the end of the script
  • Various typos, and text with unclarity fixed up
  • Added more links to output.

Sample output:

INFO: 📘 Welcome to the Kuadrant Quick Start setup process
INFO: This script will guide you through setting up a local Kubernetes cluster with the following components:
INFO:   - Docker or Podman (Container Runtime)
INFO:   - kind (Kubernetes IN Docker)
INFO:   - Kuadrant and its dependencies, including:
INFO:       * Gateway API
INFO:       * Istio
INFO:       * Cert-Manager
INFO:       * MetalLB
INFO:   - Optional DNS provider setup for Kuadrant's DNSPolicy API
INFO: Please ensure you have an internet connection and local admin access to perform installations.
Are you ready to begin? (y/n) y
INFO: Starting the Kuadrant setup process... 🚀
INFO: Checking prerequisites and dependencies... 🛠️
✓ All dependencies are installed.
Do you want to set up a DNS provider for use with Kuadrant's DNSPolicy API? (y/n)
y
INFO: Configuring DNS provider environment variables... 🛰️
INFO: You have chosen to set up a DNS provider, which is required for using Kuadrant's DNSPolicy API.
INFO: Supported DNS providers are AWS Route 53 and Google Cloud DNS.
Please enter 'aws' for AWS Route 53, or 'gcp' for Google Cloud DNS: aws
INFO: You have selected the aws DNS provider.
INFO: Deleting existing Kubernetes cluster if present... 🗑️
enabling experimental podman provider
Deleting cluster "kuadrant-local" ...
Deleted nodes: ["kuadrant-local-control-plane"]
✓ Existing cluster (if present) deleted successfully.
INFO: Creating a new Kubernetes cluster... 🌟
enabling experimental podman provider
Creating cluster "kuadrant-local" ...
 ✓ Ensuring node image (kindest/node:v1.29.2) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹️
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-kuadrant-local"
You can now use your cluster with:

kubectl cluster-info --context kind-kuadrant-local

Have a nice day! 👋
Switched to context "kind-kuadrant-local".
✓ Kubernetes cluster created successfully.
INFO: Creating the necessary Kubernetes namespaces... 📦
namespace/kuadrant-system created
✓ Kubernetes namespaces created successfully.
INFO: Installing Gateway API... 🌉
customresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io created
customresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io created
customresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io created
customresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io created
✓ Gateway API installed successfully.
INFO: Installing Istio as a Gateway API provider... ✈️
INFO: Generating Istio configuration... 🛠️
✓ Istio configuration generated.
customresourcedefinition.apiextensions.k8s.io/istiooperators.install.istio.io created
customresourcedefinition.apiextensions.k8s.io/istiooperators.install.istio.io condition met
namespace/istio-operator created
namespace/istio-system created
customresourcedefinition.apiextensions.k8s.io/istiooperators.install.istio.io unchanged
serviceaccount/istio-operator created
clusterrole.rbac.authorization.k8s.io/istio-operator created
clusterrolebinding.rbac.authorization.k8s.io/istio-operator created
service/istio-operator created
deployment.apps/istio-operator created
istiooperator.install.istio.io/istiocontrolplane created
deployment.apps/istio-operator condition met
✓ Istio installed successfully.
INFO: Installing cert-manager... 🛡️
namespace/cert-manager created
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created
serviceaccount/cert-manager created
serviceaccount/cert-manager-cainjector created
serviceaccount/cert-manager-webhook created
role.rbac.authorization.k8s.io/cert-manager-webhook:dynamic-serving created
role.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created
role.rbac.authorization.k8s.io/cert-manager:leaderelection created
clusterrole.rbac.authorization.k8s.io/cert-manager-cainjector created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-approve:cert-manager-io created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-certificates created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-certificatesigningrequests created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-challenges created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-issuers created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-orders created
clusterrole.rbac.authorization.k8s.io/cert-manager-edit created
clusterrole.rbac.authorization.k8s.io/cert-manager-view created
clusterrole.rbac.authorization.k8s.io/cert-manager-webhook:subjectaccessreviews created
rolebinding.rbac.authorization.k8s.io/cert-manager-webhook:dynamic-serving created
rolebinding.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created
rolebinding.rbac.authorization.k8s.io/cert-manager:leaderelection created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-cainjector created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-approve:cert-manager-io created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-certificates created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-certificatesigningrequests created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-challenges created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-issuers created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-orders created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-webhook:subjectaccessreviews created
configmap/cert-manager-webhook created
service/cert-manager created
service/cert-manager-webhook created
deployment.apps/cert-manager created
deployment.apps/cert-manager-cainjector created
deployment.apps/cert-manager-webhook created
mutatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created
validatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created
INFO: Waiting for cert-manager deployments to be ready
deployment.apps/cert-manager condition met
deployment.apps/cert-manager-cainjector condition met
deployment.apps/cert-manager-webhook condition met
✓ cert-manager installed successfully.
INFO: Installing MetalLB... 🏗️
I0410 22:32:31.138698   25018 log.go:194] well-defined vars that were never replaced: SERVICE_NAME,SERVICE_NAMESPACE
namespace/metallb-system created
customresourcedefinition.apiextensions.k8s.io/addresspools.metallb.io created
customresourcedefinition.apiextensions.k8s.io/bfdprofiles.metallb.io created
customresourcedefinition.apiextensions.k8s.io/bgpadvertisements.metallb.io created
customresourcedefinition.apiextensions.k8s.io/bgppeers.metallb.io created
customresourcedefinition.apiextensions.k8s.io/communities.metallb.io created
customresourcedefinition.apiextensions.k8s.io/ipaddresspools.metallb.io created
customresourcedefinition.apiextensions.k8s.io/l2advertisements.metallb.io created
serviceaccount/controller created
serviceaccount/speaker created
role.rbac.authorization.k8s.io/controller created
role.rbac.authorization.k8s.io/pod-lister created
clusterrole.rbac.authorization.k8s.io/metallb-system:controller created
clusterrole.rbac.authorization.k8s.io/metallb-system:speaker created
rolebinding.rbac.authorization.k8s.io/controller created
rolebinding.rbac.authorization.k8s.io/pod-lister created
clusterrolebinding.rbac.authorization.k8s.io/metallb-system:controller created
clusterrolebinding.rbac.authorization.k8s.io/metallb-system:speaker created
secret/webhook-server-cert created
service/webhook-service created
deployment.apps/controller created
daemonset.apps/speaker created
validatingwebhookconfiguration.admissionregistration.k8s.io/metallb-webhook-configuration created
deployment.apps/controller condition met
pod/controller-67d9f4b5bc-c6ckn condition met
pod/speaker-2s6rj condition met
INFO: Generating IP address pool for MetalLB...
ipaddresspool.metallb.io/kuadrant-local created
l2advertisement.metallb.io/empty created
✓ MetalLB installed and IP address pool generated successfully.
INFO: Installing Kuadrant in kuadrant-local...
namespace/kuadrant-system serverside-applied
customresourcedefinition.apiextensions.k8s.io/authconfigs.authorino.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/authorinos.operator.authorino.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/authpolicies.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/dnshealthcheckprobes.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/dnspolicies.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/dnsrecords.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/kuadrants.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/limitadors.limitador.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/managedzones.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/ratelimitpolicies.kuadrant.io serverside-applied
customresourcedefinition.apiextensions.k8s.io/tlspolicies.kuadrant.io serverside-applied
serviceaccount/authorino-operator serverside-applied
serviceaccount/dns-operator-controller-manager serverside-applied
serviceaccount/kuadrant-operator-controller-manager serverside-applied
serviceaccount/limitador-operator-controller-manager serverside-applied
role.rbac.authorization.k8s.io/authorino-operator-leader-election serverside-applied
role.rbac.authorization.k8s.io/dns-operator-leader-election-role serverside-applied
role.rbac.authorization.k8s.io/kuadrant-operator-leader-election-role serverside-applied
role.rbac.authorization.k8s.io/limitador-operator-leader-election-role serverside-applied
clusterrole.rbac.authorization.k8s.io/authorino-authconfig-editor-role serverside-applied
clusterrole.rbac.authorization.k8s.io/authorino-authconfig-viewer-role serverside-applied
clusterrole.rbac.authorization.k8s.io/authorino-manager-k8s-auth-role serverside-applied
clusterrole.rbac.authorization.k8s.io/authorino-manager-role serverside-applied
clusterrole.rbac.authorization.k8s.io/authorino-operator-manager serverside-applied
clusterrole.rbac.authorization.k8s.io/authorino-webhooks-manager-role serverside-applied
clusterrole.rbac.authorization.k8s.io/dns-operator-manager-role serverside-applied
clusterrole.rbac.authorization.k8s.io/dns-operator-metrics-reader serverside-applied
clusterrole.rbac.authorization.k8s.io/dns-operator-proxy-role serverside-applied
clusterrole.rbac.authorization.k8s.io/kuadrant-operator-manager-role serverside-applied
clusterrole.rbac.authorization.k8s.io/limitador-operator-manager-role serverside-applied
rolebinding.rbac.authorization.k8s.io/authorino-operator-leader-election serverside-applied
rolebinding.rbac.authorization.k8s.io/authorino-webhooks-manager serverside-applied
rolebinding.rbac.authorization.k8s.io/dns-operator-leader-election-rolebinding serverside-applied
rolebinding.rbac.authorization.k8s.io/kuadrant-operator-leader-election-rolebinding serverside-applied
rolebinding.rbac.authorization.k8s.io/limitador-operator-leader-election-rolebinding serverside-applied
clusterrolebinding.rbac.authorization.k8s.io/authorino-operator-manager serverside-applied
clusterrolebinding.rbac.authorization.k8s.io/dns-operator-manager-rolebinding serverside-applied
clusterrolebinding.rbac.authorization.k8s.io/dns-operator-proxy-rolebinding serverside-applied
clusterrolebinding.rbac.authorization.k8s.io/kuadrant-operator-manager-rolebinding serverside-applied
clusterrolebinding.rbac.authorization.k8s.io/limitador-operator-manager-rolebinding serverside-applied
configmap/limitador-operator-manager-config serverside-applied
configmap/manager-config serverside-applied
service/authorino-webhooks serverside-applied
service/dns-operator-controller-manager-metrics-service serverside-applied
service/kuadrant-operator-controller-manager-metrics-service serverside-applied
service/limitador-operator-controller-manager-metrics-service serverside-applied
deployment.apps/authorino-operator serverside-applied
deployment.apps/authorino-webhooks serverside-applied
deployment.apps/dns-operator-controller-manager serverside-applied
deployment.apps/kuadrant-operator-controller-manager serverside-applied
deployment.apps/limitador-operator-controller-manager serverside-applied
certificate.cert-manager.io/authorino-webhook-server-cert serverside-applied
issuer.cert-manager.io/authorino-webhooks-ca serverside-applied
INFO: Kuadrant installation applied, configuring ManagedZone if DNS provider is set...
INFO: Deploying Kuadrant sample configuration...
kuadrant.kuadrant.io/kuadrant-sample created
✓ Kuadrant sample configuration deployed.
INFO: ✨🌟 Setup Complete! Your Kuadrant Quick Start environment has been successfully created. 🌟✨
INFO: Here's what has been configured:
INFO:   - Kubernetes cluster with name 'kuadrant-local'
INFO:   - a Kuadrant namespace 'kuadrant-system'
INFO:   - Gateway API
INFO:   - Istio installed without Sail as a Gateway API provider
INFO:   - cert-manager
INFO:   - MetalLB with configured IP address pool
INFO:   - Kuadrant components and a sample configuration
INFO:   - DNS provider set to 'aws'
INFO: Next steps:
INFO:   - Explore your new Kuadrant environment using 'kubectl get all -n kuadrant-system'.
INFO:   - Head over to the Kuadrant quick start guide for further instructions on how to use Kuadrant with this environment:
INFO:     🔗 https://docs.kuadrant.io/kuadrant-operator/doc/user-guides/secure-protect-connect/

INFO: Thank you for using Kuadrant! If you have any questions or feedback, please reach out to our community.
INFO: 🔗 https://github.com/Kuadrant/
Screenshot 2024-04-10 at 22 38 50

Testing

Run locally:

bash hack/quickstart-setup.sh

Or via curl pipe:

curl "https://raw.githubusercontent.com/jasonmadigan/kuadrant-operator/inline-quickstart-scripts/hack/quickstart-setup.sh" | bash

@jasonmadigan jasonmadigan requested a review from a team as a code owner April 10, 2024 21:31
@jasonmadigan
Copy link
Member Author

@david-martin @R-Lawton FYI

@ehearneRedHat
Copy link
Contributor

@jasonmadigan I chose aws as provider and have exported variables for aws before setup:

  • KUADRANT_ZONE_ROOT_DOMAIN
  • KUADRANT_AWS_DNS_PUBLIC_ZONE_ID
  • KUADRANT_AWS_ACCESS_KEY_ID
  • KUADRANT_AWS_SECRET_ACCESS_KEY
  • KUADRANT_AWS_REGION

However, I run into this issue that is not seen in your screenshot where it asks for my credentials. Is there something I am missing?

Screenshot from 2024-04-11 11-23-03

@jasonmadigan
Copy link
Member Author

@ehearneRedHat env-vars look right to me. They're definitely there in your shell (i.e. via env)?

@ehearneRedHat
Copy link
Contributor

@jasonmadigan Yes, I am seeing them there when running env in my shell.

I used the export command to create the variables - would that make a difference ?

@david-martin
Copy link
Contributor

@jasonmadigan
/lgtm
/approve

All working nicely locally.

env vars:

KUADRANT_ZONE_ROOT_DOMAIN=dm.hcpapps.net
KUADRANT_AWS_REGION=eu-west-1
KUADRANT_AWS_DNS_PUBLIC_ZONE_ID=whatever
KUADRANT_REF=release-v0.6.2
KUADRANT_AWS_ACCESS_KEY_ID=something
KUADRANT_AWS_SECRET_ACCESS_KEY=yup
ISTIO_INSTALL_SAIL=true
MGC_LOCAL_QUICKSTART_SCRIPTS_MODE=true

Is MGC_LOCAL_QUICKSTART_SCRIPTS_MODE=true still needed or does it matter?
Same q for KUADRANT_REF

@jasonmadigan
Copy link
Member Author

@jasonmadigan Yes, I am seeing them there when running env in my shell.

I used the export command to create the variables - would that make a difference ?

That should be OK yeah, assuming you've exported them in something like your .bashrc (or .zshrc if using zsh etc)

@jasonmadigan
Copy link
Member Author

@jasonmadigan /lgtm /approve

All working nicely locally.

env vars:

KUADRANT_ZONE_ROOT_DOMAIN=dm.hcpapps.net
KUADRANT_AWS_REGION=eu-west-1
KUADRANT_AWS_DNS_PUBLIC_ZONE_ID=whatever
KUADRANT_REF=release-v0.6.2
KUADRANT_AWS_ACCESS_KEY_ID=something
KUADRANT_AWS_SECRET_ACCESS_KEY=yup
ISTIO_INSTALL_SAIL=true
MGC_LOCAL_QUICKSTART_SCRIPTS_MODE=true

Is MGC_LOCAL_QUICKSTART_SCRIPTS_MODE=true still needed or does it matter? Same q for KUADRANT_REF

Yes MGC_LOCAL_QUICKSTART_SCRIPTS_MODE can be removed now. KUADRANT_REF not used anymore either

@ehearneRedHat
Copy link
Contributor

@jasonmadigan Yes, I am seeing them there when running env in my shell.
I used the export command to create the variables - would that make a difference ?

That should be OK yeah, assuming you've exported them in something like your .bashrc (or .zshrc if using zsh etc)

I just have them exported in the window itself, not within a file. I must be missing something...

@jasonmadigan jasonmadigan force-pushed the inline-quickstart-scripts branch 3 times, most recently from 8ef17c9 to 60f86aa Compare April 11, 2024 16:11
@david-martin
Copy link
Contributor

/lgtm
/approve

@jasonmadigan jasonmadigan force-pushed the inline-quickstart-scripts branch 4 times, most recently from fb54211 to ea43bac Compare April 12, 2024 10:58
@jasonmadigan jasonmadigan merged commit 62b9b47 into Kuadrant:main Apr 12, 2024
13 checks passed
@jasonmadigan jasonmadigan deleted the inline-quickstart-scripts branch April 12, 2024 15:48
philbrookes pushed a commit that referenced this pull request Apr 16, 2024
* inlining resources fetched via cURL as part of quickstart-setup, to make things easier to manage

* remove kustomize deps

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

Successfully merging this pull request may close these issues.

4 participants