Skip to content

openstack: update the machine templates #1042

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

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

flaper87
Copy link
Contributor

Note that we're passing a version for kubelet, which the openstack
actuator checks on. This version, however, is completely ignored by the
CoreOS image. We'll work on removing this requirement from the openstack
actuator but, in the meantime, we should just set it to something to
avoid breaking.

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 10, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 10, 2019
Copy link
Contributor

@tomassedovic tomassedovic 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 doing this!

I've added a few more things that we need to add to get the actuator to create the workers. These are all things I've had to add in my env before the workers could be created.

@@ -47,8 +47,7 @@ spec:
value:
apiVersion: openstack.cluster.k8s.io/v1alpha1
kind: OpenStackMachineProviderConfig
image:
id: {{.Image}}
image: {{.Image}}
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need all of these (using my own hardcoded values):

      cloudName: standalone
      cloudsSecret: openstack-creds
      networks:
      - uuid: c24f8bc2-4d8b-4ab3-a6ed-1be816113bf6
      placement:
        region: regionOne
      securityGroups:
      - worker
      subnet: worker

And basically the same thing for the master template.

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 knew I was forgetting something. Will update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From your comment, I'm guessing that using tags didn't work for you. Right?

Copy link
Contributor

Choose a reason for hiding this comment

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

In what way? If you mean for worker deletion, than no they didn't.

Btw thanks for the update. As far as I can see, it's still missing the networks array and fixing up the subnet name and securityGroups. Will you add those as well please? I've had to fix all three of them in my testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tomassedovic sorry, I meant for filtering subnets, networks, and securityGroups. The keys exist in the template but I'm assuming that the tag filter didn't work for you.

Copy link
Contributor

Choose a reason for hiding this comment

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

@flaper87 ah yes, sorry.

You're correct: the filters did not work. The actuator kept complaining that it could not be deserialised properly and that it expected a string (or an array of strings for SG).

As far as I can see, this is the validation it uses:

https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/master/config/crd/openstackproviderconfig_v1alpha1.yaml#L19-L28

(or at least something consistent with those expectations)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tomassedovic right, that's what I thought. I think this should be fixed in the actuator CRD since we've added support for filters already: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/master/pkg/cloud/openstack/clients/machineservice.go#L255

What do you think about getting this patch in as is and check these filters one by one in the actuator?

@abhinavdahiya
Copy link
Contributor

@flaper87 flaper87 changed the title Update the machine templates openstack: update the machine templates Jan 11, 2019
@flaper87 flaper87 force-pushed the master branch 2 times, most recently from 7522525 to 0a9aa5a Compare January 11, 2019 09:25
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 11, 2019
value: "{{$value}}"
- name: "tag:{{$key}}"
values:
- "{{$value}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm getting:

I0111 12:13:56.221433       1 controller.go:114] Running reconcile Machine for ostest-worker-8rwch
E0111 12:13:56.225632       1 controller.go:160] Error checking existence of machine instance for machine object ostest-worker-8rwch; error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go struct field OpenstackProviderSpec.networks of type []v1alpha1.NetworkParam

I think this is because networks expects an array of filter objects.

Something like this got my actuator to create the VMs:

networks:
- filter:
    tag: openshiftClusterID=9a6f0a69-3033-4adb-8e7a-91c8f4b75665

That instance is stuck in ERROR, but I think that may be unrelated (altohugh maybe this syntax isn't fully right either).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, ok. So, I failed at defining the filter. Lemme fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, did you check it had the right network attached?

Copy link
Contributor

Choose a reason for hiding this comment

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

It did not. Which may have been the ERROR I was seeing. But my environment was busted for unrelated reasons, so I can't tell for sure if that was it.

I'm running it from scratch again now.

@flaper87
Copy link
Contributor Author

/test e2e-aws

@tomassedovic
Copy link
Contributor

@flaper87 let me paste the exact diff. Yours is still a little off:

diff --git a/pkg/asset/machines/openstack/worker.go b/pkg/asset/machines/openstack/worker.go
index b73fb3cd6..d6e749387 100644
--- a/pkg/asset/machines/openstack/worker.go
+++ b/pkg/asset/machines/openstack/worker.go
@@ -54,15 +54,10 @@ spec:
           flavor: {{.Machine.FlavorName}}
           placement:
             region: {{.Region}}
-          subnet:
-            filters:
-            - name: "tag:Name"
-              values:
-              - "{{.ClusterName}}-worker-*"
-          tags:
+          networks:
 {{- range $key,$value := .Tags}}
-            - name: "{{$key}}"
-              value: "{{$value}}"
+            - filter:
+                tags: "{{$key}}={{$value}}"
 {{- end}}
           securityGroups:
             - worker

So for each tag we create a filter object in the networks array.

@flaper87
Copy link
Contributor Author

@tomassedovic I think there was a small race between your comment and my latest push 😄 The current PS should match what you expect to have for the filters field.

Note that we're passing a version for kubelet, which the openstack
actuator checks on. This version, however, is completely ignored by the
CoreOS image. We'll work on removing this requirement from the openstack
actuator but, in the meantime, we should just set it to something to
avoid breaking.
@tomassedovic
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flaper87, tomassedovic

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:
  • OWNERS [flaper87,tomassedovic]

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

@flaper87
Copy link
Contributor Author

/test e2e-aws

@openshift-merge-robot openshift-merge-robot merged commit 5f357d2 into openshift:master Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants