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

Use standard clouds.yaml file as config file #16

Closed
flaper87 opened this issue Aug 28, 2018 · 17 comments
Closed

Use standard clouds.yaml file as config file #16

flaper87 opened this issue Aug 28, 2018 · 17 comments
Assignees

Comments

@flaper87
Copy link
Contributor

flaper87 commented Aug 28, 2018

We're currently using a custom config file for cluster-api-provider-openstack, which is different from both, the cloud-provider-openstack config file and the standard clouds.yaml file. The current config uses the following format:

user-name:
password: 
domain-name: 
tenant-id: 
region:
auth-url:

In order to provider a better user experience, it'd be better to either adopt the config file format used by the cloud-provider-openstack or, even better, the clouds.yaml format (gophercloud has support for the latter already). Here's an example of what the yaml would look like:

clouds:
  my_cloud:
    insecure: true
    verify: false
    identity_api_version: 3
    auth:
      auth_url: http://10.0.0.14:5000/v3
      project_name: admin
      username: admin
      password: $SUPER_PASSWORD
      project_domain_name: Default
      user_domain_name: Default
    region: RegionOne

Thoughts?

/cc @Lion-Wei

@Lion-Wei
Copy link

Thanks, Actually I'm not very familiar with openstack cloud configs. But I feel use standard clouds.yaml file would be a better way.
So user offer a clouds.yaml configfile, and we generate it to a secret?

@flaper87
Copy link
Contributor Author

@Lion-Wei yes! We create a secret just like the clouds.yaml file and we change the openstack-machine-controller to use the same format as well. If you agree, I can start hacking on this

@m1093782566
Copy link

@flaper87

Contributions are always welcome!

@flaper87
Copy link
Contributor Author

@m1093782566 sure thing, thanks.

What I'd like to do, before coding anything, is evaluating whether this approach is something the rest of the team would be ok with. If so, I'm more than happy to work on it.

@scruplelesswizard
Copy link
Contributor

@flaper87 Have you made any commits on this? If not I am interested in picking this up.

@flaper87
Copy link
Contributor Author

@chaosaffe

I started looking into this and then I thought it'd be nice to have this code shared across the cluster-api-provider and the cloud-provider OpenStack. I discussed the idea with some other folks from this SIG and the feedback seemed to be good.

If you have time available to get this done in a short time, then feel free to take it as I'm not going to be able to do it myself until the end of next week. But I was definitely hoping to get it done before mid-Oct (just to give you an idea :D)

Thanks a lot for reaching out, let me know what you decide 😄 🍰

@scruplelesswizard
Copy link
Contributor

@flaper87 just to clarify the intent and question here:

You want to refactor the code in cluster-api-provider-openstack and the OpenStack K8s cloud-provider to share code for cloud.yaml parsing?

I am happy to pick this up this week, but some more concrete information about how you would like to see this done would be great. If it is easier you can find me on the K8s Slack with the same username.

@flaper87
Copy link
Contributor Author

@chaosaffe yep, that's exactly what I'd love to see happening.

Basically, we could add support for clouds.yaml to cloud-provider-openstack and then vendor that code in cluster-api-provider-openstack. I believe this is the right direction because we could use some other parts of cloud-provider-openstack in cluster-api-provider-openstack, like VM management, etc. But that's something we could work on later on. Starting with the clouds.yaml and working on the structure to share code is already a great start.

I'll also ping you on slack but I wanted to have this written here for other folks interested in following this issue.

@iamemilio
Copy link
Contributor

hey @m1093782566 @chaosaffe, would it be acceptable for me to add https://github.com/gophercloud/utils as a dependancy for cluster-api-provider-openstack in a pull request, in order to implement this feature? The following library (https://github.com/gophercloud/utils/blob/a45c12ccd8b0ce73306762607a60568a1bca4bbe/openstack/clientconfig/requests.go) would provide a way to parse clouds.yaml without home brewing and then having to test/maintain our own.

@dims
Copy link
Member

dims commented Oct 5, 2018

@iamemilio sounds good. go for it!

@scruplelesswizard
Copy link
Contributor

scruplelesswizard commented Oct 5, 2018

@iamemilio certainly! I was looking at the same package for implementing, so we are on the same page for it. Looking forward to seeing your PR!

@flaper87
Copy link
Contributor Author

flaper87 commented Oct 8, 2018

@iamemilio hey, others have also replied but I wanted to give you some feedback on this. I think it's fine to do that. Have you looked at how terraform-provider-openstack added support for clouds.yaml? Just wondering if there's anything we can use from that implementation

iamemilio pushed a commit to iamemilio/cluster-api-provider-openstack that referenced this issue Oct 15, 2018
this patch allows clouds.yaml to be used to configure access to the openstack cluster
in response to: kubernetes-sigs#16
iamemilio pushed a commit to iamemilio/cluster-api-provider-openstack that referenced this issue Oct 17, 2018
this patch allows clouds.yaml to be used to configure access to the openstack cluster
in response to: kubernetes-sigs#16
iamemilio pushed a commit to iamemilio/cluster-api-provider-openstack that referenced this issue Oct 19, 2018
this patch allows clouds.yaml to be used to configure access to the openstack cluster
in response to: kubernetes-sigs#16
k8s-ci-robot pushed a commit that referenced this issue Oct 19, 2018
* Uses Clouds.yaml to authenticate with openstack

* Use Clouds.yaml

this patch allows clouds.yaml to be used to configure access to the openstack cluster
in response to: #16

* unit tests

* Modifies the generator to genreate clouds.yaml scripts
 - can also read in clouds.yaml files
@iamemilio
Copy link
Contributor

\assign @iamemilio

@scruplelesswizard
Copy link
Contributor

/assign @iamemilio

@iamemilio
Copy link
Contributor

oops

@iamemilio
Copy link
Contributor

is this issue closed?

@Lion-Wei
Copy link

Lion-Wei commented Oct 29, 2018

Seems works about this issue all finished, I'll just close this issue. : )
@flaper87 Feels free to reopen it if found any other thing left todo.

flaper87 pushed a commit to openshift/cluster-api-provider-openstack that referenced this issue Nov 29, 2018
* Uses Clouds.yaml to authenticate with openstack

* Use Clouds.yaml

this patch allows clouds.yaml to be used to configure access to the openstack cluster
in response to: kubernetes-sigs#16

* unit tests

* Modifies the generator to genreate clouds.yaml scripts
 - can also read in clouds.yaml files
luis5tb pushed a commit to luis5tb/cluster-api-provider-openstack that referenced this issue Feb 15, 2019
…uster-api

Fork and rebrand cluster-api for openshift
iamemilio pushed a commit to iamemilio/cluster-api-provider-openstack that referenced this issue Jan 4, 2022
Bug 2033382: Fix missing machine annotations
pierreprinetti pushed a commit to shiftstack/cluster-api-provider-openstack that referenced this issue Apr 22, 2024
* Uses Clouds.yaml to authenticate with openstack

* Use Clouds.yaml

this patch allows clouds.yaml to be used to configure access to the openstack cluster
in response to: kubernetes-sigs#16

* unit tests

* Modifies the generator to genreate clouds.yaml scripts
 - can also read in clouds.yaml files
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

No branches or pull requests

6 participants