- SSL
- Etcd
- Master node
- Worker node
- CNI
1 to 4 bundles per cluster
- Single CA
- Keypairs:
- apiserver
- kubelets
- etcd clients
- etcd peers
- Kubernetes
- CA
- apiserver keypair
- kubelets keypair
- Etcd
- CA
- peers keypair
- clients keypair
- CA
- apiserver
- CA
- keypairs
- kubelets
- CA
- keypairs
- etcd peers
- CA
- keypairs
- etcd clients
- CA
- keypairs
- keypair per host
- keypair per component
- Validity!
Distributed reliable key-value store
--initial-advertise-peer-urls=https://etcd0:2380 \
--initial-cluster-state=new \
--initial-cluster-token=RfDz6BPYvQWSshe8J0cEhUoAGbnm1LfgS0A77EsjCa \
--initial-cluster=etcd0=https://etcd0:2380,etcd1=https://etcd1:2380,etcd2=https://etcd2:2380 \
- on any old member:
$ etcdctl member add name peerURL
- on a new member start
etcd
changing following opts:--initial-cluster-state=existing --initial-cluster=all-old-members,https://new-member:2380
- on any live member:
$ etcdctl member list $ etcdctl member remove ID
CLUSTER SIZE | MAJORITY | FAILURE TOLERANCE |
---|---|---|
1 | 1 | 0 |
2 | 2 | 0 |
3 | 2 | 1 |
4 | 3 | 1 |
5 | 3 | 2 |
$ etcd grpc-proxy start --endpoints=...
- load balancing
- leases
spec:
template:
spec:
schedulerName: default-scheduler
- simple shell script
/etc/kubernetes/addons
- labels
metadata: labels: addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/cluster-service: "true"
- Specification: 0.3.1
- Tool: 0.6.0
- Plugins: 0.7.0
- forward traffic from one or more ports on the host to the container
- chained
/etc/cni/net.d/10-weave.conflist
{ "cniVersion": "0.3.1", "name": "weave", "plugins": [ { "name": "weave", "type": "weave-net", "hairpinMode": true }, { "type": "portmap", "capabilities": { "portMappings": true }, "snat": true } ] }
- Fast Datapath
- Encryption
- NPC
- Multi-hop routing
- CNI plugin
- Single
clickkubectl
exec Kubernetes integration
$ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=\
$(kubectl version | base64 | tr -d '\n')"
Always remove /etc/cni/net.d/10-weave.conf
- Host network
- Pod network (CNI)
- Service network (Netfilter)
Don’t forget
ip route add service_network dev internal_interface
kind: EncryptionConfig
apiVersion: v1
resources:
- resources:
- secrets
- configmaps
providers:
- aescbc:
keys:
- name: key1
secret: RnVjayB0aGlzIHNoaXQhCg==
- identity: {}
# kube-apiserver --experimental-encryption-provider-config=/etc/kubernetes/encryption-config.yaml ...
$ kubectl get secrets --all-namespaces -o json | kubectl replace -f -
- Good
# kube-apiserver --endpoint-reconciler-type=lease ...
- Bad
# kube-apiserver --endpoint-reconciler-type=master-count ...
There is no authentication inside kubernetes! AT ALL!
- X509 Client Certs
- Static Token File
- Static Password File
- OpenID Connect Tokens
- Webhook Token Authentication
- DEX
- Apiserver:
--enable-bootstrap-token-auth
- Kubelet:
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig-bootstrap.yaml
- Patch versions: smooth and simple
- Minor versions: all pods restart