commit
d43f09081e
3 changed files with 10 additions and 10 deletions
|
@ -38,9 +38,9 @@ See more details in the [ansible guide](ansible.md).
|
||||||
Adding nodes
|
Adding nodes
|
||||||
------------
|
------------
|
||||||
|
|
||||||
You may want to add **worker** nodes to your existing cluster. This can be done by re-running the `cluster.yml` playbook, or you can target the bare minimum needed to get kubelet installed on the worker and talking to your masters. This is especially helpful when doing something like autoscaling your clusters.
|
You may want to add worker, master or etcd nodes to your existing cluster. This can be done by re-running the `cluster.yml` playbook, or you can target the bare minimum needed to get kubelet installed on the worker and talking to your masters. This is especially helpful when doing something like autoscaling your clusters.
|
||||||
|
|
||||||
- Add the new worker node to your inventory under kube-node (or utilize a [dynamic inventory](https://docs.ansible.com/ansible/intro_dynamic_inventory.html)).
|
- Add the new worker node to your inventory in the appropriate group (or utilize a [dynamic inventory](https://docs.ansible.com/ansible/intro_dynamic_inventory.html)).
|
||||||
- Run the ansible-playbook command, substituting `scale.yml` for `cluster.yml`:
|
- Run the ansible-playbook command, substituting `scale.yml` for `cluster.yml`:
|
||||||
|
|
||||||
ansible-playbook -i inventory/mycluster/hosts.ini scale.yml -b -v \
|
ansible-playbook -i inventory/mycluster/hosts.ini scale.yml -b -v \
|
||||||
|
|
|
@ -110,18 +110,18 @@ metadata:
|
||||||
name: kube-registry-v0
|
name: kube-registry-v0
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
labels:
|
labels:
|
||||||
k8s-app: kube-registry-upstream
|
k8s-app: registry
|
||||||
version: v0
|
version: v0
|
||||||
kubernetes.io/cluster-service: "true"
|
kubernetes.io/cluster-service: "true"
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
k8s-app: kube-registry-upstream
|
k8s-app: registry
|
||||||
version: v0
|
version: v0
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
k8s-app: kube-registry-upstream
|
k8s-app: registry
|
||||||
version: v0
|
version: v0
|
||||||
kubernetes.io/cluster-service: "true"
|
kubernetes.io/cluster-service: "true"
|
||||||
spec:
|
spec:
|
||||||
|
@ -164,12 +164,12 @@ metadata:
|
||||||
name: kube-registry
|
name: kube-registry
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
labels:
|
labels:
|
||||||
k8s-app: kube-registry-upstream
|
k8s-app: registry
|
||||||
kubernetes.io/cluster-service: "true"
|
kubernetes.io/cluster-service: "true"
|
||||||
kubernetes.io/name: "KubeRegistry"
|
kubernetes.io/name: "KubeRegistry"
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
k8s-app: kube-registry-upstream
|
k8s-app: registry
|
||||||
ports:
|
ports:
|
||||||
- name: registry
|
- name: registry
|
||||||
port: 5000
|
port: 5000
|
||||||
|
@ -257,7 +257,7 @@ You can use `kubectl` to set up a port-forward from your local node to a
|
||||||
running Pod:
|
running Pod:
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ POD=$(kubectl get pods --namespace kube-system -l k8s-app=kube-registry-upstream \
|
$ POD=$(kubectl get pods --namespace kube-system -l k8s-app=registry \
|
||||||
-o template --template '{{range .items}}{{.metadata.name}} {{.status.phase}}{{"\n"}}{{end}}' \
|
-o template --template '{{range .items}}{{.metadata.name}} {{.status.phase}}{{"\n"}}{{end}}' \
|
||||||
| grep Running | head -1 | cut -f1 -d' ')
|
| grep Running | head -1 | cut -f1 -d' ')
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
shell: >-
|
shell: >-
|
||||||
{{ bin_dir }}/kubectl get configmap kube-proxy -n kube-system -o yaml
|
{{ bin_dir }}/kubectl get configmap kube-proxy -n kube-system -o yaml
|
||||||
| sed 's#server:.*#server:\ {{ kube_apiserver_endpoint }}#g'
|
| sed 's#server:.*#server:\ {{ kube_apiserver_endpoint }}#g'
|
||||||
| kubectl replace -f -
|
| {{ bin_dir }}/kubectl replace -f -
|
||||||
delegate_to: "{{groups['kube-master']|first}}"
|
delegate_to: "{{groups['kube-master']|first}}"
|
||||||
run_once: true
|
run_once: true
|
||||||
when: is_kube_master and kubeadm_discovery_address != kube_apiserver_endpoint
|
when: is_kube_master and kubeadm_discovery_address != kube_apiserver_endpoint
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
# FIXME(mattymo): Reconcile kubelet kubeconfig filename for both deploy modes
|
# FIXME(mattymo): Reconcile kubelet kubeconfig filename for both deploy modes
|
||||||
- name: Symlink kubelet kubeconfig for calico/canal
|
- name: Symlink kubelet kubeconfig for calico/canal
|
||||||
file:
|
file:
|
||||||
src: "{{ kube_config_dir }}//kubelet.conf"
|
src: "{{ kube_config_dir }}/kubelet.conf"
|
||||||
dest: "{{ kube_config_dir }}/node-kubeconfig.yaml"
|
dest: "{{ kube_config_dir }}/node-kubeconfig.yaml"
|
||||||
state: link
|
state: link
|
||||||
force: yes
|
force: yes
|
||||||
|
|
Loading…
Reference in a new issue