GithubHelp home page GithubHelp logo

kubekit99 / cluster-api-provider-airship Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 225 KB

POC of cluster-api implementation for Airship

License: Apache License 2.0

Dockerfile 0.24% Makefile 0.87% Go 98.89%
kubernetes k8s cluster-api airship openstack openstack-helm operator

cluster-api-provider-airship's Introduction

cluster-api-provider-airship

POC of cluster-api implementation for Airship

Quick notes taken during the creation of the cluster-api-provider-airship scaffolding creation

Prerequesist

Install dep

curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
sudo mv $HOME/bin/dep /usr/bin

Install kustomize

wget https://github.com/kubernetes-sigs/kustomize/releases/download/v1.0.11/kustomize_1.0.11_linux_amd64
mv kustomize_1.0.11_linux_amd64 kustomize
chmod +x kustomize 
sudo mv kustomize /usr/bin/

Install kubebuilder (contains a copy of kubectl, etcd and kubeapi-server)

wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v1.0.8/kubebuilder_1.0.8_linux_amd64.tar.gz
tar xvf kubebuilder_1.0.8_linux_amd64.tar.gz 
mv kubebuilder_1.0.8_linux_amd64 kubebuilder
sudo mv kubebuilder /usr/local

Ensure the local kubelete and kubernetes cluster is stopped

sudo systemctl stop kubelet
docker stop $(docker ps -qa)
export PATH=$PATH:/usr/local/kubebuilder/bin

Creation of scaffolding

Generation steps

cd cluster-api-provider-airship/
kubebuilder init --domain kubekit.cloud --license apache2 --owner "The Kubernetes Authors"
git add .
git commit -m "Generate scaffolding."
git push
kubebuilder create api --group airship --version v1alpha1 --kind AirshipClusterProviderSpec
kubebuilder create api --group airship --version v1alpha1 --kind AirshipClusterProviderStatus
kubebuilder create api --group airship --version v1alpha1 --kind AirshipMachineProviderStatus
kubebuilder create api --group airship --version v1alpha1 --kind AirshipMachineProviderSpec
vi cmd/manager/main.go 
mkdir -p pkg/cloud/airship/actuators/cluster/
mkdir -p pkg/cloud/airship/actuators/machine/
vi pkg/cloud/airship/actuators/cluster/actuator.go
vi pkg/cloud/airship/actuators/machine/actuator.go
vi pkg/controller/add_cluster_controller.go
vi pkg/controller/add_machine_controller.go
vi Makefile 
dep ensure
export IMG=kubekit99/cluster-api-provider-airship
dep ensure
make
make docker-build IMG=${IMG}
git add .
git commit -m "Add CRDs and build image"
git push

Cleanup steps

If you used brute force, git add . the repository becomes bulky. In order to keep the scrict minimum

git rm -fr vendor/
git rm -fr bin/
git commit
git push origin --force --all
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch vendor" HEAD
git push origin --force --all
git clone https://github.com/kubekit99/cluster-api-provider-airship.git
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch bin" HEAD
git push origin --force --all
git clone https://github.com/kubekit99/cluster-api-provider-airship.git

Rebuild images

List of commands used to rebuild and publish the images.

export IMG=kubekit99/cluster-api-provider-airship
dep ensure
make
make docker-build IMG=${IMG}
make docker-push IMG=${IMG}

Deployment and tests

List of commands to deploy and test.

Ensure that /usr/local/kubebuilder is no longer in your path if you are using the same machine

kubectl get nodes
kubectl apply -f provider-components.yaml
kubectl get all --all-namespaces
kubectl logs pod/cluster-api-provider-airship-controller-manager-0 -n cluster-api-provider-airship-system manager

TBD

Testing clusterctl

make clusterctl
./bin/clusterctl create cluster --cluster cmd/clusterctl/examples/airship/cluster.yaml --machines cmd/clusterctl/examples/airship/machines.yaml --addon-components cmd/clusterctl/examples/airship/addons.yaml --provider-components cmd/clusterctl/examples/airship/provider-components.yaml --provider airship

cluster-api-provider-airship's People

Contributors

jbrette avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.