5. Securing Kube-APIServer: Parameters.
phase of each API at Kube-APIServer
1. Authentication
2. Authorization
3. Admission Control
By default, kubeadm-built clusters allow API access without authentication and authorization.
* IP = 127.0.0.1 TLS = No Port = 8080. First two phases are skipped
* IP = First n/w interface IP TLS = Yes Port = 6443. All three phases are executed.
Several arguments are passed to the kube-apiserver process via /etc/kubernetes/manifests/kube-apiserver.yaml
Sample file content
spec:
containers:
- command:
- kube-apiserver
- --advertise-address=10.128.15.193
- --allow-privileged=true
- --authorization-mode=Node,RBAC
- --client-ca-file=/etc/kubernetes/pki/ca.crt
- --enable-admission-plugins=NodeRestriction
- --enable-bootstrap-token-auth=true
Few parameters worth to highlight
* --advertise-address: Used by entire cluster. If absent, then use --bind-address. If that is also absent then use IP address of first network interface
* --allow-privileged : Privileged containers are isolated or not. If absent then value is false. kubeadm set it true. Change application, after modifying the flag.
* --enable-bootstrap-token-auth : If true, bootstrapping tokens can be used as bearer token credentials. It allows requests to authenticate against the API server.
* --etcd-servers=https://127.0.0.1:2379
* --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
If Kube-APIServer need to communicate with Aggregated API (AA) Server:
* --proxy-client-cert-file
* --proxy-client-key-file
How Kube-APIServer and kube-proxy communicate with AA server.
* --requestheader-allowed-names=front-proxy-client
* --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
* --requestheader-extra-headers-prefix=X-Remote-Extra-
* --requestheader-group-headers=X-Remote-Group
* --requestheader-username-headers=X-Remote-User
Many other parameters are captured at https://layers7.blogspot.com/2021/01/k8s-api-server-security-settings.html
0 comments:
Post a Comment