Coder Social home page Coder Social logo

kube-aliyun's Introduction

Kube Aliyun

CircleCI

Aliyun essentials for Kubernetes. It provides SLB, Routes controllers and a Volume plugin for Kubernetes to function properly on Aliyun instances.

Features

  • Service load balancers sync (TCP & UDP)
  • Routes sync
  • Volumes / PersistentVolumes
  • Centralized attach/detach control. No credentials needed on nodes.
  • PersistentVolumes dynamic provisioning

Docker Image

  • kubeup/kube-aliyun
  • registry.aliyuncs.com/kubeup/kube-aliyun

Dependency

Due to Kubernetes v1.6.0 flexvolume api break, the master currently supports k8s v1.6+.

To use the last v1.5.x support versionn, use the tag k8s-1.5.

Components

There are two components.

aliyun-controller is a daemon responsible for service & route synchronization, attach/detach control and PV provisioning. It has to run on all master nodes.

aliyun-flexv is a binary plugin responsible for volumes operations on nodes. It has to be deployed on all nodes and will be called by kubelets/controller-manager when needed.

Deploy to Aliyun

aliyun-controller

  1. Make sure all node names are internal ip addresses.
  2. Make sure node cidr will be allocated by adding --allocate-node-cidrs=true --configure-cloud-routes=false to kube-controller-manager commandline.
  3. Update the required fields in manifests/aliyun-controller.yaml
  4. Upload it to pod-manifest-path-of-kubelets on all your master nodes
  5. Use docker logs to check if the controller is running properly

** If your nodes can't access Aliyun metadata somehow, you need to specify 3 more variables in env:

  • ALIYUN_REGION
  • ALIYUN_VPC
  • ALIYUN_VSWITCH

aliyun-flexv

  1. Add to kubelet commandline an option --volume-plugin-dir=/opt/k8s/volume/plugins
  2. Add to kube-controller-manager commandline an option --flex-volume-plugin-dir=/opt/k8s/volume/plugins
  3. Add two env variables to kube-controller-manager:
  • ALIYUN_ACCESS_KEY
  • ALIYUN_ACCESS_KEY_SECRET
  1. Make flexv binary available on every node in a ./ailyun~flexv/ folder under the kubelet volume plugin path. Or for your convenience, run this
  FLEXPATH=/opt/k8s/volume/plugins/aliyun~flexv; sudo mkdir $FLEXPATH -p; docker run -v $FLEXPATH:/opt kubeup/kube-aliyun:master cp /flexv /opt/

** Customizing volume plugin path is optional. You can just use the default which is /usr/libexec/kubernetes/kubelet-plugins/volume/exec/.

Usage

Services

Just create Loadbalancer Services as usual. Currently only TCP & UDP types are supported. Some options can be customized through annotaion on Service. Please see pkg/cloudprovider/providers/aliyun/loadbalancer.go for details.

Routes

Since we are using k8s to allocate node cidrs, we need a way to make that effective on containers. There are several ways to do this.

  • Use kubenet plugin. Details here
  • Pass --bip={subnet} and --ip-masq=false to docker daemon

Volumes

example

Use flexVolume in any volume spec.

Static PersistentVolumes

example

** Recycling policy is not supported. Use custom recycler pod if you want to.

Dynamic PersistentVolumes and StorageClass

example

Avaialable parameters on StorageClass:

  • diskCategory: Disk category as in Aliyun doc. Required.
  • fsType: Filesystem type. Default: ext4

More Examples

Please find a more complete setup example here which Archon is able to deploy automatically.

License

Apache Version 2.0

kube-aliyun's People

Contributors

ledzep2 avatar adieu 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.