Posts

Showing posts from October, 2021

Storage in kubernetes

 CNI(Container Storage Interface): here Reclaim policy in pv: 3 types of reclaims  1.Retain 2.Delete 3.Recycle(It is depricated) In case of dynamic provisioning, default re-claim policy is delete i.e when you delete pvc then pv is deleted and also associated data in storage providers(GCP,NFS,Azure File etc) also gets deleted. But incase of retain, when we delete pvc, pv and actual storage both are not deleted.We need to delete both of them manually. If a pv is already created using claim reuest by dynamic provisioning, we can change re-claim policy of that pv to retain by applying path as shown below: kubectl patch pv <your-pv-name> -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}" Note: In case of dynamic provisioning using nfs, there is a filed called archieveonDelete in class.yaml file,which is by default set to false.So if we change that to true when we delete pv,then its actual storage is still retained in nfs server as ar...

Authentication and Authorisation in Kubernetes

 Authentication and Authorisation in Kubernetes: Who wants to talk to kubernetes cluster??? Either a user or an application. So if an user or application want to talk to kubernetes cluster, He needs auhentication and authorisation. Authentication: If an user needs to talk to k8 cluster, the authentication is provided by kubeconfig file For example, if a user named admin wants to talk to k8 cluster, he needs kubernetes config file, the default location of this file is( ~/.kube/config ) This file contains the information of  1.User  2.Cluster  3.Context Generally admin user, manages who wants to communicate with cluster by creating seperate config files for each user(This is in theory in practice all the developers users the same admin config file,which he shares with all the developers with in the team, by editing namespace) If any one want to authenticate to kube api server, he needs 3 things 1.ca.crt(certificate of CA, local to the cluster) 2.user.crt(User certifica...