Master node

ETCD - Backed database default port 2379

Kube Scheduler - Deploys containers on the nodes

Controller Manager

  • Node Controller (Health and placement of the containers)
  • Replication Controller (desired state of the containers)

Kube API Server - Orchestrator

Worker Node/s

Kubelet - run on each node (takes instructions from api server) Kube-proxy - layer to allow containers to communicate with each other

PKS NOTES

  • Fetch the password from PKS tile > Credentials > Uaa Admin Password or om -e env.yml credentials -p pivotal-container-service -c ".properties.uaa_admin_password" -t json | jq -r '.secret'

  • pks login -a api.pks.lab.int -u admin -k

  • pks create-cluster cluster-01 --external-hostname cluster-01.pks.lab.int --plan small --num-nodes 3

  • watch pks cluster test-cluster-01

  • pks clusters

PKS Version    Name             k8s Version  Plan Name  UUID                                  Status     Action
1.6.1-build.6  cluster-01       1.15.5       small      5e0150c9-5cc7-45d5-965b-126cc34ec3b6  succeeded  CREATE
  • pks cluster cluster-01
PKS Version:              1.6.0-build.17
Name:                     test-cluster-01
K8s Version:              1.15.5
Plan Name:                small
UUID:                     eca30ec3-fd0f-41de-97dd-d0c6fb4f6b47
Last Action:              CREATE
Last Action State:        succeeded
Last Action Description:  Instance provisioning completed
Kubernetes Master Host:   ckad.pks.lab.int
Kubernetes Master Port:   8443
Worker Nodes:             3
Kubernetes Master IP(s):  10.0.0.71
Network Profile Name:
  • Create DNS record - cluster-01.pks.lab.int 10.0.0.71
  • pks get-credentials cluster-01
Fetching credentials for cluster cluster-01.
Context set for cluster cluster-01.

You can now switch between clusters by using:
$kubectl config use-context <cluster-name>
  • kubectl config use-context cluster-01

  • kubectl get nodes

kubectl get nodes

NAME                                   STATUS   ROLES    AGE   VERSION
1cc7b7ff-3fbc-4f06-8892-468ac9b53bd3   Ready    <none>   14m   v1.15.5
2953e9be-adbd-4c5f-aaec-622b279e5f5d   Ready    <none>   19m   v1.15.5
5d6edf0f-90e8-468c-b618-e43db29931cf   Ready    <none>   10m   v1.15.5
  • Deploy Sample workload - kubectl run nginx --image=nginx --generator=run-node/v1

  • Expose the service - kubectl expose node nginx --port=80 --type=LoadBalancer

kubectl config view -o jsonpath=’{.contexts[?(@.name == “cluster-01”)].context.user}’ kubectl describe secret $(kubectl describe serviceaccounts e53bdfa6-ab94-46a9-9ba8-fbb0c0cbf78f | grep Tokens | awk ‘{print $2}’) | grep “token:”

kubectl proxy