From ec902324605dfb7395c3c3ea158f394cf0f659a9 Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Tue, 13 Aug 2024 11:23:17 -0700 Subject: [PATCH 1/2] update package-dir -> package Signed-off-by: Nima Kaviani --- crossplane-integrations/README.md | 6 +++--- local-backup/README.md | 4 ++-- localstack-integration/README.md | 4 ++-- ref-implementation/README.md | 2 +- ref-implementation/codespaces.md | 2 +- terraform-integrations/README.md | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crossplane-integrations/README.md b/crossplane-integrations/README.md index 4d1e182..796635a 100755 --- a/crossplane-integrations/README.md +++ b/crossplane-integrations/README.md @@ -7,8 +7,8 @@ Please use the below command to deploy an IDP reference implementation with an A ```bash idpbuilder create \ --use-path-routing \ - --package-dir https://github.com/cnoe-io/stacks//ref-implementation \ - --package-dir https://github.com/cnoe-io/stacks//crossplane-integrations + --package https://github.com/cnoe-io/stacks//ref-implementation \ + --package https://github.com/cnoe-io/stacks//crossplane-integrations ``` ## What is installed? @@ -30,7 +30,7 @@ Once you click the create button, you will have a very similar setup as the basi The only difference is we now have a resource for a S3 Bucket which is managed by Crossplane. Note that Bucket is **not** created because Crossplane doesn't have necessary credentials to do so. -If you'd like it to actually create a bucket, update [the credentials secret file](crossplane-providers/provider-secret.yaml), then run `idpbuilder create --package-dir examples/ref-implementation`. +If you'd like it to actually create a bucket, update [the credentials secret file](crossplane-providers/provider-secret.yaml), then run `idpbuilder create --package examples/ref-implementation`. In this example, we used Crossplane to provision resources, but you can use other cloud resource management tools such as Terraform instead. diff --git a/local-backup/README.md b/local-backup/README.md index 8a08dfc..5b1de27 100644 --- a/local-backup/README.md +++ b/local-backup/README.md @@ -34,7 +34,7 @@ Once you've made the change, run this command from the root of this repository. # example: mkdir /Users/my-name/backup mkdir -idpbuilder create --kind-config examples/local-backup/kind.yaml --package-dir examples/local-backup/ +idpbuilder create --kind-config examples/local-backup/kind.yaml --package examples/local-backup/ ``` This command: @@ -119,7 +119,7 @@ kind delete clusters localdev && docker system prune -f Once it is destroyed, create it again. ```bash -idpbuilder create --kind-config examples/local-backup/kind.yaml --package-dir examples/local-backup/ +idpbuilder create --kind-config examples/local-backup/kind.yaml --package examples/local-backup/ ``` Make sure everything looks good: diff --git a/localstack-integration/README.md b/localstack-integration/README.md index 0f53185..e24a947 100644 --- a/localstack-integration/README.md +++ b/localstack-integration/README.md @@ -5,8 +5,8 @@ Please use the below command to deploy an IDP reference implementation with an A ```bash idpbuilder create \ --use-path-routing \ - --package-dir https://github.com/cnoe-io/stacks//ref-implementation \ - --package-dir https://github.com/cnoe-io/stacks//localstack-integration + --package https://github.com/cnoe-io/stacks//ref-implementation \ + --package https://github.com/cnoe-io/stacks//localstack-integration ``` As you see above, this add-on to `idpbuilder` has a dependency on the [reference implementation](../ref-implementation/). This command primarily does the following: diff --git a/ref-implementation/README.md b/ref-implementation/README.md index 8f4705e..af75225 100644 --- a/ref-implementation/README.md +++ b/ref-implementation/README.md @@ -27,7 +27,7 @@ and be configured with the new host and port. you can use the [replace.sh](repla ```bash idpbuilder create --use-path-routing \ - --package-dir https://github.com/cnoe-io/stacks//ref-implementation + --package https://github.com/cnoe-io/stacks//ref-implementation ``` This will take ~6 minutes for everything to come up. To track the progress, you can go to the [ArgoCD UI](https://cnoe.localtest.me:8443/argocd/applications). diff --git a/ref-implementation/codespaces.md b/ref-implementation/codespaces.md index 06857ec..cb743a8 100644 --- a/ref-implementation/codespaces.md +++ b/ref-implementation/codespaces.md @@ -44,7 +44,7 @@ Now you are ready to run idpbuilder with reference implementation. ```bash idpbuilder create --protocol http \ --host ${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} \ - --port 8080 --use-path-routing --package-dir examples/ref-implementation + --port 8080 --use-path-routing --package examples/ref-implementation ``` Once idpbuilder finishes bootstrapping, you should have port 8080 forward in the port tab within Codespaces. diff --git a/terraform-integrations/README.md b/terraform-integrations/README.md index 864b5ae..ce8f561 100644 --- a/terraform-integrations/README.md +++ b/terraform-integrations/README.md @@ -7,8 +7,8 @@ Please use the below command to deploy an IDP reference implementation with an A ```bash idpbuilder create \ --use-path-routing \ - --package-dir https://github.com/cnoe-io/stacks//ref-implementation \ - --package-dir https://github.com/cnoe-io/stacks//terraform-integrations + --package https://github.com/cnoe-io/stacks//ref-implementation \ + --package https://github.com/cnoe-io/stacks//terraform-integrations ``` As you see above, this add-on to `idpbuilder` has a dependency to the [reference implementation](../ref-implementation/). This command primarily does the following: From a5f5e8cc1daf7c0a907d2156386d5882cf158e85 Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Thu, 15 Aug 2024 16:16:41 -0700 Subject: [PATCH 2/2] clarify the use of examples/ directory Signed-off-by: Nima Kaviani --- crossplane-integrations/README.md | 2 +- local-backup/README.md | 10 +++++----- ref-implementation/README.md | 5 ----- ref-implementation/codespaces.md | 6 ++++-- .../external-secrets/generate-manifests.sh | 6 +++--- ref-implementation/replace.sh | 14 +++++++------- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/crossplane-integrations/README.md b/crossplane-integrations/README.md index 796635a..86dc284 100755 --- a/crossplane-integrations/README.md +++ b/crossplane-integrations/README.md @@ -30,7 +30,7 @@ Once you click the create button, you will have a very similar setup as the basi The only difference is we now have a resource for a S3 Bucket which is managed by Crossplane. Note that Bucket is **not** created because Crossplane doesn't have necessary credentials to do so. -If you'd like it to actually create a bucket, update [the credentials secret file](crossplane-providers/provider-secret.yaml), then run `idpbuilder create --package examples/ref-implementation`. +If you'd like it to actually create a bucket, update [the credentials secret file](crossplane-providers/provider-secret.yaml), then run `idpbuilder create --package https://github.com/cnoe-io/stacks//ref-implementation`. In this example, we used Crossplane to provision resources, but you can use other cloud resource management tools such as Terraform instead. diff --git a/local-backup/README.md b/local-backup/README.md index 5b1de27..193c27f 100644 --- a/local-backup/README.md +++ b/local-backup/README.md @@ -1,7 +1,7 @@ # Local Backup with Velero and Minio This example creates a configuration that allows you to back up Kubernetes objects -to your laptop (or wherever you are running idpbuilder from). +to your laptop (or wherever you are running idpbuilder from). It assumes that idpBuilder is on the path and that you have cloned this repository. In short, it: 1. Creates a [MinIO](https://min.io/) installation that mounts a local directory. @@ -34,7 +34,7 @@ Once you've made the change, run this command from the root of this repository. # example: mkdir /Users/my-name/backup mkdir -idpbuilder create --kind-config examples/local-backup/kind.yaml --package examples/local-backup/ +idpbuilder create --kind-config local-backup/kind.yaml --package local-backup/ ``` This command: @@ -81,7 +81,7 @@ kubectl apply -f https://raw.githubusercontent.com/vmware-tanzu/velero/main/exam Once they are created and running, create a backup. ```bash -kubectl apply -f examples/local-backup/demo/backup.yaml +kubectl apply -f local-backup/demo/backup.yaml ``` This command is equivalent to this Velero command: `velero backup create nginx-backup --selector app=nginx` @@ -119,7 +119,7 @@ kind delete clusters localdev && docker system prune -f Once it is destroyed, create it again. ```bash -idpbuilder create --kind-config examples/local-backup/kind.yaml --package examples/local-backup/ +idpbuilder create --kind-config local-backup/kind.yaml --package local-backup/ ``` Make sure everything looks good: @@ -153,7 +153,7 @@ nginx-backup 1m Target this backup to restore objects. ```bash -kubectl apply -f examples/local-backup/demo/restore.yaml +kubectl apply -f local-backup/demo/restore.yaml ``` This command is equivalent to `velero restore create --from-backup nginx-backup`. diff --git a/ref-implementation/README.md b/ref-implementation/README.md index af75225..7c42689 100644 --- a/ref-implementation/README.md +++ b/ref-implementation/README.md @@ -43,11 +43,6 @@ This will take ~6 minutes for everything to come up. To track the progress, you If you don't want to install a package above, you can remove the ArgoCD Application file corresponding to the package you want to remove. For example, if you want to remove Spark Operator, you can delete [this file](./spark-operator.yaml). -```bash -# remove spark operator from this installation. -rm examples/ref-implementation/spark-operator.yaml -``` - The only package that cannot be removed this way is Keycloak because other packages rely on it. diff --git a/ref-implementation/codespaces.md b/ref-implementation/codespaces.md index cb743a8..ba49bbb 100644 --- a/ref-implementation/codespaces.md +++ b/ref-implementation/codespaces.md @@ -30,9 +30,11 @@ Codespaces assigns random hostname to your specific instance. You need to make s Instance host name is available as an environment variable (`CODESPACE_NAME`). Let's use it to setup our host names. Run the following commands to update host name and ports. Port is set to 443 because this is the port used by the browser to access your instance. +Clone the [stacks](https://github.com/cnoe-io/stacks) repo. + ```bash -cd examples/ref-implementation +cd ref-implementation ./replace.sh ${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} 443 @@ -44,7 +46,7 @@ Now you are ready to run idpbuilder with reference implementation. ```bash idpbuilder create --protocol http \ --host ${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} \ - --port 8080 --use-path-routing --package examples/ref-implementation + --port 8080 --use-path-routing --package ref-implementation ``` Once idpbuilder finishes bootstrapping, you should have port 8080 forward in the port tab within Codespaces. diff --git a/ref-implementation/external-secrets/generate-manifests.sh b/ref-implementation/external-secrets/generate-manifests.sh index 1a26292..64f2f2e 100755 --- a/ref-implementation/external-secrets/generate-manifests.sh +++ b/ref-implementation/external-secrets/generate-manifests.sh @@ -4,9 +4,9 @@ set -e INSTALL_YAML="manifests/install.yaml" CHART_VERSION="0.9.11" -echo "# EXTERNAL SECRETS INSTALL RESOURCES" > ${INSTALL_YAML} -echo "# This file is auto-generated with 'examples/ref-impelmentation/external-secrets/generate-manifests.sh'" >> ${INSTALL_YAML} +echo "# EXTERNAL SECRETS INSTALL RESOURCES" >${INSTALL_YAML} +echo "# This file is auto-generated with 'ref-impelmentation/external-secrets/generate-manifests.sh'" >>${INSTALL_YAML} helm repo add external-secrets --force-update https://charts.external-secrets.io helm repo update -helm template --namespace external-secrets external-secrets external-secrets/external-secrets -f values.yaml --version ${CHART_VERSION} >> ${INSTALL_YAML} +helm template --namespace external-secrets external-secrets external-secrets/external-secrets -f values.yaml --version ${CHART_VERSION} >>${INSTALL_YAML} diff --git a/ref-implementation/replace.sh b/ref-implementation/replace.sh index 365a0c9..e1834e1 100755 --- a/ref-implementation/replace.sh +++ b/ref-implementation/replace.sh @@ -5,8 +5,8 @@ set -e # Check if the new port number is provided as an argument if [ "$#" -ne 2 ]; then - echo "Usage: NEW_HOST NEW_PORT" - exit 1 + echo "Usage: NEW_HOST NEW_PORT" + exit 1 fi # Assign the first script argument to NEW_PORT @@ -16,8 +16,8 @@ NEW_PORT="$2" # Base directory to start from, "." means the current directory CURRENT_DIR=$(echo "${PWD##*/}") if [[ ${CURRENT_DIR} != "ref-implementation" ]]; then - echo "please run this script from the examples/ref-implementation directory" - exit 10 + echo "please run this script from the ref-implementation directory" + exit 10 fi BASE_DIRECTORY="." @@ -28,9 +28,9 @@ find "$BASE_DIRECTORY" -type f -name "*.yaml" -exec sed -i "s/cnoe\.localtest\.m # Remove hostname-port configuration if the new port is 443. Browsers strip 443 but keycloak still expects 443 in url. if [[ ${NEW_PORT} == "443" ]]; then - sed -i "/hostname-port/d" keycloak/manifests/install.yaml - sed -i "/hostname-admin/d" keycloak/manifests/install.yaml - sed -i '0,/:443/{s/:443//}' argo-workflows/manifests/dev/patches/cm-argo-workflows.yaml + sed -i "/hostname-port/d" keycloak/manifests/install.yaml + sed -i "/hostname-admin/d" keycloak/manifests/install.yaml + sed -i '0,/:443/{s/:443//}' argo-workflows/manifests/dev/patches/cm-argo-workflows.yaml fi echo "Replacement complete."