Giter Site home page Giter Site logo

pkk8scok2ed's Introduction

pkk8scok

Chapter1: Building Your Own Kubernetes

kube-apiserver, kube-scheduler and kube-controller-manager

Command-line interface

kubectl get cs

install etcd
u15

apt install etcd
service stop etcd
etcd -name ke --data-dir /tmp.ke.etcd &

use another machine, connect

etcdctl set ke "ke"
etcd get ke

use curl

curl -L http://localhost:2379/v2/keys/ke

put/update

curl http://localhost:2379/v2/keys/ke -X PUT -d value="ke2"

delete

curl http://localhost:2379/v2/keys/ke?recursive=true -X DELETE

note, an key could be multiple lavel,like

/ke/ke1/ke2

the above delete recursive=true still apply

######enalbe startup service in c7,u15+,use systemd-based

vim /lib/systemd/system/etcd.service

point to

systemctl enable etcd

create /etc/etcd/etcd.conf

cd /etc
mkdir etcd
cd etcd && vim etcd.conf

edit

export ETCD_NAME=ke
export ETCD_DATA_DIR="/tmp/ke.etcd"
export ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0/8080"
export ETCD_ADVERTISE_CLIENT_URLS="http://localhost:8080"

#####install flannel on u16

apt-get install linux-libc-dev golang gcc -y
vim ke.json

edit

{
"Network":"10.136.0.0/16",
"SubnetLen":28
"SubnetMin":"10.136.16.0",
"SubnetMax":"10.136.99.0",
"Backend":{
        "Type":"udp",
        "Port":7890
}
}

then create service file in system

vim /lib/systemd/system/flanneld.service

edit

[Unit]
Description=Flannel
Wants=etcd.service
After=etcd.service
Before=docker.service

[Service]
Type=Notify

EnvironmentFile=/etc/sysconfig/flanneld
EnvironmentFile=-/etc/sysconfig/docker-network
ExecStart=/usr/bin/flanneld -etcd-endpoints=${FLANNEL_ETCD} -etcd-prefix=${FLANN
EL_ETCD_KEY} $FLANNEL_OPTIONS
Restart=on-failure

RestartSec=5s

[Install]
WantedBy=multi-user.target

then create flanneld:

cd /etc && mkdir sysconfig && cd sysconfig && vim flanneld

FLANNEL_ETCD="http://localhost:2379" FLANNEL_ETCD_KEY="/coreos.com/network"

pkk8scok2ed's People

Contributors

rengokantai avatar

Watchers

James Cloos 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.