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

Updates to local setup scripts and introduce new local setup scripts for non-gardener use cases #852

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

unmarshall
Copy link
Contributor

What this PR does / why we need it:
Creates separate local setup scripts for gardener and non-gardener use cases.
There are now 4 scripts that are made available:
For gardener specific setup/restore following scripts have been introduced:

./hack/gardener_local_setup.sh -h                                                                                                        git:script

    Usage: gardener_local_setup.sh [Options]
    Options:
      -d | --seed                       <seed-cluster-name>                 (Required) Name of the Gardener Seed Cluster
      -t | --shoot                      <shoot-cluster-name>                (Required) Name of the Gardener Shoot Cluster
      -p | --project                    <project-name>                      (Required) Name of the Gardener Project
      -i | --provider                   <provider-name>                     (Required) Infrastructure provider name. Supported providers (gcp|aws|azure|vsphere|openstack|alicloud|metal|equinix-metal)
      -l | --landscape                  <landscape-name>                    (Optional) Name of the landscape. Defaults to dev
      -k | --kubeconfig-path            <relative-kubeconfig-path>          (Optional) Relative path to the <PROJECT-DIR> where kubeconfigs will be downloaded. Path should not start with '/'. Default: <PROJECT-DIR>/dev/kube-configs
      -m | --mcm-provider-project-path  <absolute-mcm-provider-project-dir> (Optional) MCM Provider project directory. If not provided then it assumes that both mcm and mcm-provider projects are under the same parent directory
      -e | --kubeconfig-expiry-seconds  <expiry-duration-in-seconds>        (Optional) Common expiry durations in seconds for control and target KubeConfigs. Default: 3600 seconds
./hack/gardener_local_restore.sh -h                                                                                                      git:script

    Usage: gardener_local_restore.sh [Options]
    Options:
      -t | --shoot                      <shoot-cluster-name>                (Required) Name of the Gardener Shoot Cluster
      -p | --project                    <project-name>                      (Required) Name of the Gardener Project
      -l | --landscape                  <landscape-name>                    (Optional) Name of the landscape. Defaults to dev
      -i | --provider                   <provider-name>                     (Required) Infrastructure provider name. Supported providers (gcp|aws|azure|vsphere|openstack|alicloud|metal|equinix-metal)
      -k | --kubeconfig-path            <relative-kubeconfig-path>          (Optional) Relative path to the <PROJECT-DIR> where kubeconfigs will be downloaded. Path should not start with '/'. Default: <PROJECT-DIR>/dev/kube-configs
      -m | --mcm-provider-project-path  <absolute-mcm-provider-project-dir> (Optional) MCM Provider project directory. If not provided then it assumes that both mcm and mcm-provider projects are under the same parent directory

Makefile targets have the following changes:

> make gardener-setup
> make gardener-restore
> make gardener-local-mcm-up

For non-gardener use cases the following scripts have been introduced:

./hack/non_gardener_local_setup.sh -h                                                                                                    git:script

    Usage: non_gardener_local_setup.sh [Options]
    Options:
      -n | --namespace                  <namespace>                         (Required) This is the namespace where MCM pods are deployed.
      -c | --control-kubeconfig-path    <control-kubeconfig-path>           (Required) Kubeconfig file path which points to the control-plane of cluster where MCM is running.
      -t | --target-kubeconfig-path     <target-kubeconfig-path>            (Required) Kubeconfig file path which points to control plane of the cluster where nodes are created.
      -i | --provider                   <provider-name>                     (Required) Infrastructure provider name. Supported providers (gcp|aws|azure|vsphere|openstack|alicloud|metal|equinix-metal)
      -m | --mcm-provider-project-path  <absolute-mcm-provider-project-dir> (Optional) MCM Provider project directory. If not provided then it assumes that both mcm and mcm-provider projects are under the same parent directory
./hack/non_gardener_local_restore.sh -h                                                                                                  git:script

    Usage: non_gardener_local_restore.sh [Options]
    Options:
      -n | --namespace                  <namespace>                         (Required) This is the namespace where MCM pods are deployed.
      -c | --control-kubeconfig-path    <control-kubeconfig-path>           (Required) Kubeconfig file path which points to the control-plane of cluster where MCM is running.
      -i | --provider                   <provider-name>                     (Required) Infrastructure provider name. Supported providers (gcp|aws|azure|vsphere|openstack|alicloud|metal|equinix-metal)
      -m | --mcm-provider-project-path  <absolute-mcm-provider-project-dir> (Optional) MCM Provider project directory. If not provided then it assumes that both mcm and mcm-provider projects are under the same parent directory

Makefile targets have the following changes:

> make non-gardener-setup
> make non-gardener-restore
> make non-gardener-local-mcm-up

Which issue(s) this PR fixes:
Fixes Part of #846

Special notes for your reviewer:

Release note:

Makefile targets have changed: Introduced gardener-setup, gardener-restore, gardener-local-mcm-up, non-gardener-setup, non-gardener-restore,  non-gardener-local-mcm-up. Users can also directly use the scripts which are used by these makefile targets.

@unmarshall unmarshall requested a review from a team as a code owner September 19, 2023 08:35
@gardener-robot gardener-robot added needs/review Needs review size/l Size of pull request is large (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Sep 19, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 19, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 19, 2023
@himanshu-kun himanshu-kun self-assigned this Sep 19, 2023
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review needs/second-opinion Needs second review by someone else labels Sep 21, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 21, 2023
@elankath
Copy link
Contributor

elankath commented Sep 21, 2023

Is the development/local_setup.md already updated showing how to use these scripts ?

Copy link
Contributor

@elankath elankath left a comment

Choose a reason for hiding this comment

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

Please update development/local_setup.md if possible. Need to roll this out to new joinees. If you don't have time, I can do this.

Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

could you also remove hack/admin-kube-config-request.json

Makefile Show resolved Hide resolved
@unmarshall
Copy link
Contributor Author

unmarshall commented Sep 22, 2023

could you also remove hack/admin-kube-config-request.json

This file gets removed when you can the gardener_restore.sh script

  echo "Removing generated admin kube config json..."
  rm -f "${SCRIPT_DIR}"/admin-kube-config-request.json

But i can also remove it once the kube configs have been downloaded successfully.
I have also removed the file as it was accidentally checked in.

@unmarshall
Copy link
Contributor Author

Is the development/local_setup.md already updated showing how to use these scripts ?

I have updated the local_setup.md now. PTAL.

@gardener-robot gardener-robot added needs/second-opinion Needs second review by someone else and removed reviewed/lgtm Has approval for merging labels Sep 22, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 22, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 22, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 22, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 22, 2023
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

working well for me now
Thanks for the changes @unmarshall !

@himanshu-kun
Copy link
Contributor

/needs second-opinion
waiting till @elankath re-reviews

@himanshu-kun himanshu-kun added this to the 2023-Q3 milestone Sep 22, 2023
Copy link
Contributor

@elankath elankath left a comment

Choose a reason for hiding this comment

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

Thanks for writing doc. We need to clean the IT setup to avoid the symbolic link. let the path to MCM repo be given in the new .env file. This can be taken up later, not now.

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/second-opinion Needs second review by someone else labels Sep 22, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 22, 2023
@himanshu-kun himanshu-kun merged commit 5f5a727 into gardener:master Sep 22, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Sep 22, 2023
@unmarshall unmarshall deleted the script branch September 25, 2023 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/l Size of pull request is large (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants