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

Feature/Replace Rancher API calls by kubectl calls #2

Merged
merged 10 commits into from
Sep 9, 2024
Merged

Conversation

oleg-vorobiov-suse
Copy link
Contributor

reduced the number of API calls
removed the need for API automation token
everything that is possible is done via kubectl commands

scripts/rancher/manager-lifecycle.sh Outdated Show resolved Hide resolved
@@ -55,33 +55,3 @@ rancher_update_password() {
}' \
"$rancherUrl/v3/users?action=changepassword"
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we keep this method?

Rancher API is still needed sometimes and we may need it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I think we'll still need it... I'm now in a place where I probably need to do a hard refresh of the partner-charts repo before someone accesses it, to ensure that the newest versions are listed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will put it back in there, and at the same time I want to try to use kubernetes CRDs approach as much as possible

# name
# version (Kubernetes)
# Examples:
# rancher_create_customcluster rancher.random_string.geek xxxxx demo 'v1.27.16+rke2r1'
# rancher_create_customcluster demo 'v1.27.16+rke2r1'
#######################################
rancher_create_customcluster() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to be validated manually (as the CI pipeline is not possible for the moment)

Copy link
Collaborator

@devpro devpro Sep 5, 2024

Choose a reason for hiding this comment

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

I duplicated Rancher Playground track, called "Rancher Playground PR review", and started it.

Got the error:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will check on this in a few

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
Its alive

Copy link
Contributor Author

@oleg-vorobiov-suse oleg-vorobiov-suse Sep 5, 2024

Choose a reason for hiding this comment

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

I also updated the variables in a main script to get the latest k8s and Rancher

# defines variables
K3S_VERSION='v1.30'
CERTMANAGER_VERSION='v1.13.0'
LETSENCRYPT_EMAIL_ADDRESS='[email protected]'
RANCHER_REPOSITORY='latest'
RANCHER_VERSION='2.9.1'
RANCHER_DOMAIN="rancher.${HOSTNAME}.${_SANDBOX_ID}.instruqt.io"
RANCHER_REPLICAS='1'
ADMIN_PASSWORD='Sus3R@ncherR0x'
INGRESS_CLASSNAME='traefik'
DOWNSTREAM_CLUSTER_NAME='demo'
RKE2_K8S_VERSION='v1.27.16+rke2r1'

scripts/rancher/cluster-actions.sh Outdated Show resolved Hide resolved
scripts/rancher/cluster-actions.sh Outdated Show resolved Hide resolved
@devpro devpro changed the title code reduction Feature/Replace Rancher API calls by kubectl calls Sep 5, 2024
@devpro devpro merged commit 4545d7a into develop Sep 9, 2024
3 checks passed
@devpro devpro deleted the less-api-calls branch September 9, 2024 09:28
devpro added a commit that referenced this pull request Sep 9, 2024
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