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

[OSASINFRA] Add the rhoso kubeconfig to the shiftstack client pod #2576

Conversation

itzikb-redhat
Copy link
Contributor

@itzikb-redhat itzikb-redhat commented Nov 28, 2024

Add the kube config of RHOSO to shiftstack client pod in order to access the clusterץ

Create a secret with the content of the kubeconfig.
Mount the secret as a volume in the shiftstackclient pod.
The kubeconfig can then be accessed from cifmw_shiftstack_shiftstackclient_incluster_kubeconfig_dir directory

Copy link
Contributor

openshift-ci bot commented Nov 28, 2024

Hi @itzikb-redhat. Thanks for your PR.

I'm waiting for a openstack-k8s-operators member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

Thanks for the PR! ❤️
I'm marking it as a draft, once your happy with it merging and the PR is passing CI, click the "Ready for review" button below.

@github-actions github-actions bot marked this pull request as draft November 28, 2024 11:01
@@ -31,6 +31,7 @@ cifmw_shiftstack_manifests_dir: "{{ cifmw_shiftstack_basedir }}/manifests"
cifmw_shiftstack_project_name: "shiftstack"
cifmw_shiftstack_qa_gerrithub_change: ""
cifmw_shiftstack_qa_repo: "https://review.gerrithub.io/shiftstack/shiftstack-qa"
cifmw_shiftstack_rhoso_kubeconfig : "{{ cifmw_shiftstack_shiftstackclient_installation_dir }}/rhoso_kubeconfig"

Choose a reason for hiding this comment

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

Please set the order so the cifmw_shiftstack_shiftstackclient_installation_dir is defined before use.

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 think that from functionality perspective it doesn't matter and I want to have the variables in alphabetical order, wdyt?

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ac2b82550ca74cf3a011b2139d4e57e1

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 53m 13s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 23m 21s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 33m 50s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 03s
cifmw-pod-pre-commit FAILURE in 7m 14s
✔️ build-push-container-cifmw-client SUCCESS in 37m 51s
✔️ cifmw-molecule-shiftstack SUCCESS in 12m 31s

@itzikb-redhat itzikb-redhat force-pushed the shiftstack-rhoso-kubeconfig branch 3 times, most recently from 459a04c to 6e2be3a Compare December 5, 2024 05:55
@itzikb-redhat
Copy link
Contributor Author

itzikb-redhat commented Dec 9, 2024

[cloud-admin@shiftstackclient-shiftstack ~]$ export KUBECONFIG=./artifacts/installation/rhoso_kubeconfig
[cloud-admin@shiftstackclient-shiftstack ~]$ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.16.0    True        False         21h     Cluster version is 4.16.0

@itzikb-redhat itzikb-redhat marked this pull request as ready for review December 9, 2024 07:09
Copy link
Contributor

@eurijon eurijon left a comment

Choose a reason for hiding this comment

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

Hey Itzik, can you please add the PR description? I added a couple of minor comments too

roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml Outdated Show resolved Hide resolved
roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml Outdated Show resolved Hide resolved
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4d22cb46c67e408b8949557e88ecc5c7

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 18m 19s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 21m 32s
cifmw-crc-podified-edpm-baremetal FAILURE in 58m 54s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 52s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 15s
✔️ build-push-container-cifmw-client SUCCESS in 22m 53s
cifmw-molecule-shiftstack FAILURE in 14m 37s

@itzikb-redhat
Copy link
Contributor Author

[zuul@controller-0 ~]$ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.16.0    True        False         6h48m   Cluster version is 4.16.0
[zuul@controller-0 ~]$ oc  -n openstack exec -it shiftstackclient-shiftstack /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
[cloud-admin@shiftstackclient-shiftstack ~]$ export KUBECONFIG=./artifacts/installation/rhoso_kubeconfig
[cloud-admin@shiftstackclient-shiftstack ~]$ ./oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.16.0    True        False         6h48m   Cluster version is 4.16.0

The job failed on a timeout downloading the client and installer but the kubeconfig is there

@eurijon
Copy link
Contributor

eurijon commented Dec 11, 2024

/lgtm
/assign @rlobillo

@rlobillo
Copy link
Contributor

I think you can acomplish this by playing the shiftstackclient manifest instead of manually copying

@rlobillo
Copy link
Contributor

I think you can acomplish this by playing the shiftstackclient manifest instead of manually copying

.spec.automountServiceAccountToken may help for this

@@ -35,3 +37,4 @@ cifmw_shiftstack_run_playbook: "ocp_testing.yaml"
cifmw_shiftstack_sc: "local-storage"
cifmw_shiftstack_shiftstackclient_artifacts_dir: "/home/cloud-admin/artifacts"
cifmw_shiftstack_shiftstackclient_installation_dir: "{{ cifmw_shiftstack_shiftstackclient_artifacts_dir }}/installation"
cifmw_shiftstack_shiftstackclient_incluster_kubeconfig_dir: "/home/cloud-admin/kubeconfig"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you think this filename could not be descriptive enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

Copy link
Contributor

@eurijon eurijon left a comment

Choose a reason for hiding this comment

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

Hey Itzik, can you please adapt the PR title (it's not being copied now but mounted) and add a descriptive PR description?

roles/shiftstack/README.md Outdated Show resolved Hide resolved
roles/shiftstack/templates/shiftstackclient_pod.yml.j2 Outdated Show resolved Hide resolved
@itzikb-redhat itzikb-redhat force-pushed the shiftstack-rhoso-kubeconfig branch 3 times, most recently from 4d133df to 5c3fd12 Compare December 16, 2024 10:43
@itzikb-redhat itzikb-redhat changed the title [OSASINFRA] Copy rhoso kubeconfig to the shiftstack client pod [OSASINFRA] Add the rhoso kubeconfig to the shiftstack client pod Dec 16, 2024
@itzikb-redhat
Copy link
Contributor Author

Hey Itzik, can you please adapt the PR title (it's not being copied now but mounted) and add a descriptive PR description?

I updated - is it ok ?

@eurijon
Copy link
Contributor

eurijon commented Dec 16, 2024

Hey Itzik, can you please adapt the PR title (it's not being copied now but mounted) and add a descriptive PR description?

I updated - is it ok ?

I would add in the PR description how the kubeconfig is mounted in the pod as a secret type volume. Thx!

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/bf209bc54b3e4cdbaeb3a7806df1f2e5

openstack-k8s-operators-content-provider NODE_FAILURE Node request 100-0007705192 failed in 0s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 10s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 22s
✔️ build-push-container-cifmw-client SUCCESS in 36m 00s
✔️ cifmw-molecule-shiftstack SUCCESS in 15m 05s

@itzikb-redhat
Copy link
Contributor Author

recheck

Create a secret from the file and add it as a volume to the pod
@itzikb-redhat itzikb-redhat force-pushed the shiftstack-rhoso-kubeconfig branch from 613a050 to 8498c98 Compare December 17, 2024 13:10
@eurijon
Copy link
Contributor

eurijon commented Dec 17, 2024

/lgtm

@pablintino
Copy link
Collaborator

/approve

Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pablintino

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 63f8e1b into openstack-k8s-operators:main Dec 19, 2024
5 checks passed
@eurijon
Copy link
Contributor

eurijon commented Jan 17, 2025

/cherry-pick 18.0-fr1

@openshift-cherrypick-robot

@eurijon: #2576 failed to apply on top of branch "18.0-fr1":

Applying: Add RHOSO kubeconfigfile to shiftstackclient pod
Using index info to reconstruct a base tree...
M	roles/shiftstack/README.md
M	roles/shiftstack/tasks/cleanup.yml
M	roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml
Falling back to patching base and 3-way merge...
Auto-merging roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml
Auto-merging roles/shiftstack/tasks/cleanup.yml
Auto-merging roles/shiftstack/README.md
CONFLICT (content): Merge conflict in roles/shiftstack/README.md
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Add RHOSO kubeconfigfile to shiftstackclient pod

In response to this:

/cherry-pick 18.0-fr1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@eurijon
Copy link
Contributor

eurijon commented Jan 17, 2025

Manual cherry-pick on #2666

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

Successfully merging this pull request may close these issues.

6 participants