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

[v1alpha2 Migration] add v1alpha2 controllers #446

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Aug 18, 2019

Initial migration to v1alpha2 controllers as described here: #380 (comment)

(This also contains the commits from: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pulls)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 18, 2019
@k8s-ci-robot k8s-ci-robot requested review from dims and iamemilio August 18, 2019 09:14
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 18, 2019
@sbueringer
Copy link
Member Author

Dev env for v1alpha2 is described here: https://github.com/sbueringer/capi-dev

@sbueringer sbueringer changed the title Pr add v1alpha2 controllers [v1alpha2 Migration] add v1alpha2 controllers Aug 18, 2019
@sbueringer sbueringer changed the title [v1alpha2 Migration] add v1alpha2 controllers [WIP] [v1alpha2 Migration] add v1alpha2 controllers Aug 18, 2019
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 18, 2019
@sbueringer
Copy link
Member Author

sbueringer commented Aug 18, 2019

Seems to work :):

Every 1.0s: openstack server list                                                                                                                                                                                                localhost.localdomain: Sun Aug 18 20:06:43 2019

+--------------------------------------+-------------------------+--------+---------------------------------------------------+-----------------+--------+
| ID                                   | Name                    | Status | Networks                                          | Image           | Flavor |
+--------------------------------------+-------------------------+--------+---------------------------------------------------+-----------------+--------+
| 77e3ae08-e8be-4342-98d7-927ff074733b | ix1pi020-kube-node-01   | ACTIVE | k8s-clusterapi-cluster-default-ix1pi020=10.6.0.6  | coreos-2023.5.0 | large  |
| 7c983a77-2640-41b4-af77-792a864295e2 | ix1pi020-kube-master-02 | ACTIVE | k8s-clusterapi-cluster-default-ix1pi020=10.6.0.3  | coreos-2023.5.0 | large  |
| 55ae4749-4862-4548-a302-fc182f31f45f | ix1pi020-kube-master-01 | ACTIVE | k8s-clusterapi-cluster-default-ix1pi020=10.6.0.17 | coreos-2023.5.0 | large  |
+--------------------------------------+-------------------------+--------+---------------------------------------------------+-----------------+--------+


Every 1.0s: kubectl --kubeconfig /home/fedora/.kube/kind-config-kind --context kubernetes-admin@kind --namespace default get machine,openstackmachine                                                                            localhost.localdomain: Sun Aug 18 20:06:30 2019

NAME                                               PROVIDERID                                           PHASE
machine.cluster.x-k8s.io/ix1pi020-kube-master-01   openstack:////55ae4749-4862-4548-a302-fc182f31f45f   provisioned
machine.cluster.x-k8s.io/ix1pi020-kube-master-02   openstack:////7c983a77-2640-41b4-af77-792a864295e2   provisioned
machine.cluster.x-k8s.io/ix1pi020-kube-node-01     openstack:////77e3ae08-e8be-4342-98d7-927ff074733b   provisioned

NAME                                                                       AGE
openstackmachine.infrastructure.cluster.x-k8s.io/ix1pi020-kube-master-01   23m
openstackmachine.infrastructure.cluster.x-k8s.io/ix1pi020-kube-master-02   6m44s
openstackmachine.infrastructure.cluster.x-k8s.io/ix1pi020-kube-node-01     6m44s

NAME                      STATUS     ROLES    AGE   VERSION
ix1pi020-kube-master-01   NotReady   master   20m   v1.15.0-1+702333862a992f-dhc
ix1pi020-kube-master-02   NotReady   master   92s   v1.15.0-1+702333862a992f-dhc
ix1pi020-kube-node-01     NotReady   node     27s   v1.15.0-1+702333862a992f-dhc

I'll write some docs for the dev-environment the next few days

@sbueringer sbueringer force-pushed the pr-add-v1alpha2-controllers branch from 67bb5bd to fb80cda Compare August 18, 2019 20:35
@sbueringer
Copy link
Member Author

sbueringer commented Aug 19, 2019

Implementation is done (HA cluster works in my case). Documentation to use it is here: https://github.com/sbueringer/capi-dev

Note: Cluster deletions currently doesn't work because we have to migrate to kubeadm bootstrapper first. But this will be another PR

@sbueringer sbueringer changed the title [WIP] [v1alpha2 Migration] add v1alpha2 controllers [v1alpha2 Migration] add v1alpha2 controllers Aug 19, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 19, 2019
@sbueringer
Copy link
Member Author

/assign @hidekazuna
/assign @jichenjc

Can you please take a look? :)

@sbueringer sbueringer force-pushed the pr-add-v1alpha2-controllers branch 2 times, most recently from 89ade64 to 9164abe Compare August 19, 2019 17:34
@sbueringer
Copy link
Member Author

Overall this seems to work in my env. Code should also be okay. I'll have some followup task like cleaning up the Makefile & refactor the logging a bit. Depending on how seen this PR is reviewed I would integrate it here or create an additional PR for that

@jichenjc
Copy link
Contributor

I will try on ubuntu env as well, so might need your help and confirm

  1. 445 already merged into this PR?
  2. do I need Tilt ? I am not using IDE and no experience on it, is it mandatory for non-IDE env?
  3. I saw a set of samples changed , I assume that's the thing I need migrate from my existing one to (the format and name etc) ,correct?

@sbueringer
Copy link
Member Author

sbueringer commented Aug 20, 2019

I will try on ubuntu env as well, so might need your help and confirm

  1. 445 already merged into this PR?
  2. do I need Tilt ? I am not using IDE and no experience on it, is it mandatory for non-IDE env?
  3. I saw a set of samples changed , I assume that's the thing I need migrate from my existing one to (the format and name etc) ,correct?
  1. It was the basis for this PR. So yes it's included
  2. I also just know it since 3 days :). Documentation what it does is below
  3. Yes the new samples from the samples folder are the files you need in addition to the stuff Tilt deploys

Tilt basically does the following:

  • Docker Images: build, load into Kind & live-update the following images:
    • cluster api controller
    • cluster api bootstrap provider kubeadm (not needed yet)
    • cluster api Openstack controller
  • It seds the names of loaded Images in the config/default folder of each of these 3 repos (cluster-api, cluster-api-bootstrap-provider-kubeadm, cluster-api-provider-openstack)
  • it executes kustomize on /config/default and pipes the result to kubectl apply
  • It redeploys as soon as something is changed

Problem is that clusterctl is not migrated to v1alpha2 and there isn't much documentation yet. Most of the documentation probably will be done for clusterctl or in the common ClusterAPI I guess, but I don't know how it will be.

@sbueringer sbueringer force-pushed the pr-add-v1alpha2-controllers branch from 9164abe to adfb48b Compare August 20, 2019 05:55
@dims
Copy link
Member

dims commented Aug 20, 2019

/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from dims August 20, 2019 22:17
@jichenjc
Copy link
Contributor

ok, struggled for a while and now the tilt is up including all containers (a set of minor changes...)
now I will deploy from ubuntu and I will share some comments/info after the test

@jichenjc
Copy link
Contributor

jichenjc commented Aug 21, 2019

I can't comment on cluster-api-provider-openstack/samples/templates/clouds-secrets/kustomize.yaml (don't know the reason), but I made some modification to make namespace to capo-system, otherwise the container can't find the secret during startup, you find same issue?

apiVersion: v1
data:
  cacert:  ........
  clouds.yaml: ......
kind: Secret
metadata:
  name: cloud-config
+  namespace: capo-system
type: Opaque

@sbueringer sbueringer force-pushed the pr-add-v1alpha2-controllers branch from adfb48b to 71fe9a0 Compare August 21, 2019 09:36
@sbueringer
Copy link
Member Author

I can't comment on cluster-api-provider-openstack/samples/templates/clouds-secrets/kustomize.yaml (don't know the reason), but I made some modification to make namespace to capo-system, otherwise the container can't find the secret during startup, you find same issue?

apiVersion: v1
data:
  cacert:  ........
  clouds.yaml: ......
kind: Secret
metadata:
  name: cloud-config
+  namespace: capo-system
type: Opaque

Oh yes you're right. I fixed it in the PR. Problem was I was using a copy of the samples (with completely different user-data) and I only fixed it there

@jichenjc
Copy link
Contributor

@sbueringer seems KUBELET_VERSION={{ .Machine.Spec.Versions.Kubelet }} in master/worker node need to be updated? there is no Versions anymore

and the namespace settings is fairly complicated now... makes test very hard :(

@sbueringer
Copy link
Member Author

@sbueringer seems KUBELET_VERSION={{ .Machine.Spec.Versions.Kubelet }} in master/worker node need to be updated? there is no Versions anymore

and the namespace settings is fairly complicated now... makes test very hard :(

I'll take a look

What do you mean with namespace settings?

@jichenjc
Copy link
Contributor

the machine spec, cluster spec, secret ...all need set namespace now ... they don't need in v1alpha1, nothing special, I am still fixing those namespace settings on my system

@sbueringer
Copy link
Member Author

the machine spec, cluster spec, secret ...all need set namespace now ... they don't need in v1alpha1, nothing special, I am still fixing those namespace settings on my system

Oh yes. I think it will be easier in the future. clusterctl should be working soon again and there are more tools planned. Not sure what the exact scope of clusteradm will be

@sbueringer
Copy link
Member Author

@sbueringer seems KUBELET_VERSION={{ .Machine.Spec.Versions.Kubelet }} in master/worker node need to be updated? there is no Versions anymore

Yup the changed Versions.Kubelet to just Version. I fixed it. (I need Ubuntu to test stuff like this :/)

@jichenjc
Copy link
Contributor

ok, I made some modifications locally and ubuntu works now. so I think it's time to merge this and evolve from here :), I will submit PR to fix ubuntu cases.

root@jj-master:~/capi-dev/cluster-api-provider-openstack/samples/output# kubectl get machine
NAME PROVIDERID PHASE
test-cluster-kube-master-01 openstack:////d6b5c2d1-4b0c-4196-a8fc-d8f6d973bdd0 provisioned
test-cluster-openstack-node-01 openstack:////c6ef9117-3f9b-4e46-904f-283ca5d174fa provisioned

cloudusr@test-cluster-kube-master-01:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
test-cluster-kube-master-01 Ready master 85m v1.15.0
test-cluster-openstack-node-01 Ready node 40m v1.15.0

@jichenjc
Copy link
Contributor

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 23, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jichenjc, sbueringer

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 23, 2019
@k8s-ci-robot k8s-ci-robot merged commit 3ac9dd8 into kubernetes-sigs:master Aug 23, 2019
@sbueringer sbueringer deleted the pr-add-v1alpha2-controllers branch August 23, 2019 05:26
prankul88 pushed a commit to prankul88/cluster-api-provider-openstack that referenced this pull request Sep 5, 2019
* migrate types & controllers to v1alpha2

* fix kubelet version
pierreprinetti pushed a commit to shiftstack/cluster-api-provider-openstack that referenced this pull request Apr 22, 2024
* migrate types & controllers to v1alpha2

* fix kubelet version
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants