{"id":47,"date":"2022-12-17T21:54:25","date_gmt":"2022-12-17T21:54:25","guid":{"rendered":"https:\/\/devopsopen.com\/?p=47"},"modified":"2023-05-02T05:47:06","modified_gmt":"2023-05-02T05:47:06","slug":"architecture-de-base-et-etcd-dans-k8s","status":"publish","type":"post","link":"https:\/\/devopsopen.com\/index.php\/2022\/12\/17\/architecture-de-base-et-etcd-dans-k8s\/","title":{"rendered":"Concept Core K8S"},"content":{"rendered":"<h2>Architecture<\/h2>\n<p>There is many architecture to install a K8S cluster. according to the aim or costs, you can chose the adequat design.<\/p>\n<p>K8S architecture bellow:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-48\" src=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archik8s.png\" alt=\"\" width=\"718\" height=\"389\" srcset=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archik8s.png 718w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archik8s-300x163.png 300w\" sizes=\"(max-width: 718px) 100vw, 718px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-310\" src=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archiK8s-1.png\" alt=\"\" width=\"1126\" height=\"854\" srcset=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archiK8s-1.png 1126w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archiK8s-1-300x228.png 300w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archiK8s-1-1024x777.png 1024w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/archiK8s-1-768x582.png 768w\" sizes=\"(max-width: 1126px) 100vw, 1126px\" \/><\/p>\n<p>most interfaces used in kub: CRI as Container Runtime Interface, CNI as Containes Network Interface, CSI as Container Storage Interface<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-164\" src=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/interfaceskub.png\" alt=\"\" width=\"769\" height=\"377\" srcset=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/interfaceskub.png 1055w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/interfaceskub-300x147.png 300w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/interfaceskub-1024x502.png 1024w, https:\/\/devopsopen.com\/wp-content\/uploads\/2022\/12\/interfaceskub-768x376.png 768w\" sizes=\"(max-width: 769px) 100vw, 769px\" \/><\/p>\n<h2>\u00a0ETCD Database<\/h2>\n<p><span data-contrast=\"auto\">Etcd database store all information about cluster: Nodes, Pods, Config, secret, Accounts, Roles, Binding,\u2026<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li>Direct installation bellow :<\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\"> \u00a0\u00a0\u00a0\u00a0\u00a0wget -q --https-only \\ \"https:\/\/github.com\/coreos\/etcd\/releases\/download\/v3.3.9\/etcd-v3.3.9-linux-amd64.tar.gz\"<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Run etcd service<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559731&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> via la commande <\/span>\n<pre><span data-contrast=\"auto\">.\/etcd<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<\/li>\n<li>change the value into database with etcd control:\n<pre><span data-contrast=\"auto\">.\/etcdctl set key\u00a0 value<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<\/li>\n<li>check installed version of etcdctrl :\n<pre><span data-contrast=\"auto\">.\/etcdctl --version<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559731&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<p>Be attention, you should alwayse check etcdctrl version because there a difference between commands of V2 and V3<\/p>\n<\/li>\n<li><span data-contrast=\"auto\">Change control etcd version<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559731&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">: <\/span><\/li>\n<\/ul>\n<blockquote>\n<pre>e<span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559731&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">xport ETCDCTL_API=3\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .\/etcctrl version\u00a0\r\n \u00a0\u00a0\u00a0\u00a0\u00a0  .\/etcdctrl\u00a0<\/span><\/pre>\n<\/blockquote>\n<ul>\n<li>Changer une valeur et la r\u00e9cup\u00e9rer avec la version 3 du control etcd<\/li>\n<\/ul>\n<pre>       <span data-contrast=\"auto\">.\/etcdctrl put key1 value1<\/span> \r\n<span data-contrast=\"auto\">       .\/etcdctrl get key1<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">The endpoint to communicate with database is 'advertise-client-urls' into etcd.service<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li>If installation is with kubeadm :<\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">        Kubectl get pods \u2013n kube-system<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\r\n<span data-contrast=\"auto\">        Kubectk exec etcd-master \u2013n kube-system etcdctl get \/ --prefix \u2013key-only<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0\r\n<\/span><\/pre>\n<ul>\n<li>In HA, ip adresses are in etcd.service (initial_cluster_etcd)<\/li>\n<li><span data-contrast=\"auto\">Default ETCDCTRL is Version 2. <\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">ETCDCTRL can communicate with ETCD API SERVER with certificat :<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"none\">        kubectl <\/span><span data-contrast=\"none\">exec<\/span><span data-contrast=\"none\"> etcd-master -n kube-system -- sh -c <\/span><span data-contrast=\"none\">\"ETCDCTL_API=3 etcdctl get \/ --prefix --keys-only --limit=10 --cacert \/etc\/kubernetes\/pki\/etcd\/ca.crt --cert \/etc\/kubernetes\/pki\/etcd\/server.crt --key \/etc\/kubernetes\/pki\/etcd\/server.key\"<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559685&quot;:708,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<h2>API Server<\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Installtion from scratch as a service in your node :<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">           https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-apiserver<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">API server execute opertaions bellow :<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ol>\n<li><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Authenticate user<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Validate Request<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Retrieve data<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Update ETCD<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Scheduler<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Kublete<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<pre><span data-contrast=\"auto\">Example of API\u2019s requests : curl \u2013X POST \/api\/v1\/namespaces\/default\/pods<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">In kube-apiserver.service, the importante conf are : etcd-cafile, etcd-certfile,etcd-keyfile, kubelet-cacertficate, kubelet-client-certificate, kubelete-client-key and kubelete-https<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">With kubeadm, configurations are in : \/etc\/kuberntes\/manifests\/kube-apiserver.yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">To check options : \/etc\/systemd\/systemd\/system\/kube-apisever.service<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">We can also see the running process :\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ps \u2013aux|grep kube-apiserver<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0\r\n<\/span><\/pre>\n<h2><span data-contrast=\"auto\">Kub Controller Manager<br \/><\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Controllers : watch status and remediate sitauation, node monitor period = 5s, Node monitor grace period = 40s, POD eviction timeout = 5m<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Example : node controller call api manager to have informations about nodes<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">There is many controller and all are in one process controller\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">       Conf is in the file \/etc\/systemd\/system\/kube-controller-manager.service<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<pre><span data-contrast=\"auto\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0The process is : <\/span><span data-contrast=\"auto\">ps \u2013aux|grep kube-acontroller-manager<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Installation :\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">       wget <\/span><a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-apiserver\"><span data-contrast=\"none\">https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-apiserver<\/span><\/a><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Configurations are in kube-controller-manager.service<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">If installation is wit kubeadm: conf is into the pod : <\/span><span data-contrast=\"auto\">cat \/etc\/kubernetes\/manifests\/kube-controller-manager.yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2><span data-contrast=\"auto\">Kub Scheduler<br \/><\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Role of scheduler is : Which pod goes in wich node.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Scheduler filter nodes to know if cpu and memory is suffisent to put the pod<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> and rank thems<\/span><\/li>\n<li><span data-contrast=\"auto\">Installation :<\/span>\n<pre><span data-contrast=\"auto\"> wget <\/span><a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-scheduler\"><span data-contrast=\"none\">https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-scheduler<\/span><\/a><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<\/li>\n<li><span data-contrast=\"auto\">If scheduler is installed with kubeadm, the conf : cat \/etc\/kubernetes\/manifests\/kube-scheduler.yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\"> \u00a0\u00a0\u00a0\u00a0\u00a0Process : <\/span><span data-contrast=\"auto\">ps \u2013aux|grep kube-scheduler<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<h2><span data-contrast=\"auto\">Kubelet<\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Kubelet recieve info from the apiserver in wich get infi from the scheduler to create pod<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">So the kubelet register node, create pods, monitor node and pods,<\/span><\/li>\n<li><span data-contrast=\"auto\">Installation:<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">       wget <\/span><a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kubelet\"><span data-contrast=\"none\">https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kubelet<\/span><\/a><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">To check process kubelet : <\/span><span data-contrast=\"auto\">ps \u2013aux|grep kubelet<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2><span data-contrast=\"auto\">Kube Proxy<br \/><\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">The role of kube proxy (process kube proxy) is looking for services that are created and create a iptable into the node to reroute packet from the ip service to the pod ip.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Pi : un service est virtuel et n\u2019a pas d\u2019interface comme les pods ni the processus actif, il est juste dans la m\u00e9moire de kub, mais comment les autres n\u0153uds peuvent y acc\u00e9der<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Installation:<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">  \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0wget <\/span><a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-proxy\"><span data-contrast=\"none\">https:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.13.0\/bin\/linux\/amd64\/kube-proxy<\/span><\/a><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">The conf is into kube-proxy.service<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">If installation is with kubeadm, the object created is a deamonset with two pods<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2><span data-contrast=\"auto\">Pods<\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Create a singl pod into K8S cluster :<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">        Kubectl run nginx \u2013image nginx<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Commands pods:<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Kubectl get pods<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Pods with yaml :<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">        kubectl run nginx-test --image nginx\u00a0 --dry-run=client -o=yaml &gt; pod.yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">To apply a yaml file<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Kubectl apply \u2013f pod.yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<h2><span data-contrast=\"auto\">Replicat Set<br \/><\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">The difference between replicaset and replicacontroller is selector\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">The main aim of replicatset is to maintain the number of pods<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2><span data-contrast=\"auto\">Deployment<\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Deployments\u00a0 regroup replicatset and pods difinitions,\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Command to create file fo deployment object :\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\"> \u00a0\u00a0\u00a0   kubectl create deployment --image=nginx nginx --replicas=4 --dry-run=client -o yaml &gt; nginx-deployment.yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Command to scale a deployment\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\"> \u00a0     kubectl scale deployment nginx --replicas=4<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<h2><span data-contrast=\"auto\">Services<\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Services types :\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ol>\n<li><span data-contrast=\"auto\">NodePort<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">ClusterIP<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">LoadBalancer<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ol>\n<ul>\n<li><span data-contrast=\"auto\">To have yaml file\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"auto\">         Kubectl create service clusterip redis \u2013tcp=6379:6379 \u2013dryrun=client \u2013o yaml (change selectors)<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\r\n<span data-contrast=\"auto\">         Or<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\r\n<span data-contrast=\"none\">         kubectl expose deployment nginx <\/span><b><span data-contrast=\"none\">--port<\/span><\/b><span data-contrast=\"none\">=80 <\/span><b><span data-contrast=\"none\">--target-port<\/span><\/b><span data-contrast=\"none\">=8000 \u2013dry-run=client \u2013o <\/span> <span data-contrast=\"none\">yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\r\n<span data-contrast=\"auto\">         Or to expose a pod with own selectors<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\r\n<span data-contrast=\"none\">         kubectl expose pod redis --port=6379 --name redis-service --dry-run=client -o yaml<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Create a Service named nginx of type NodePort to expose pod nginx's port 80 on port 30080 on the nodes:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"none\">         kubectl expose pod nginx --type=NodePort --port=80 --name=nginx-service --dry-run=client -o yaml<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<h2><span data-contrast=\"auto\">Namespaces<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><br \/><\/span><\/h2>\n<ul>\n<li><span data-contrast=\"auto\">Namespace is used to isolate environement like dev and prod<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Commad to get all pods in all namspaces :<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"none\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kubectl get pods --all-namespaces or -A<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<ul>\n<li><span data-contrast=\"auto\">Command to change namespace :<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<blockquote>\n<pre><span data-contrast=\"none\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kubectl config set-context --current --namespace=digicactus-ns<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<\/blockquote>\n<ul>\n<li><span data-contrast=\"auto\">Command to configure or change resource quota<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<blockquote>\n<pre><span data-contrast=\"none\">cat &lt; compute-resources.yaml<\/span>\u00a0\r\n<span data-contrast=\"none\">apiVersion: v1<\/span>\u00a0\r\n<span data-contrast=\"none\">kind: ResourceQuota<\/span>\u00a0\r\n<span data-contrast=\"none\">metadata:<\/span>\u00a0\r\n<span data-contrast=\"none\">\u00a0 name: compute-resources<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span>\r\n\r\n<span data-contrast=\"none\">\u00a0 namespace: dev<\/span>\u00a0\r\n<span data-contrast=\"none\">spec:<\/span>\u00a0\r\n<span data-contrast=\"none\">\u00a0 hard:<\/span>\u00a0\r\n<span data-contrast=\"none\">\u00a0\u00a0\u00a0 requests.cpu: \"1\"<\/span>\u00a0\r\n<span data-contrast=\"none\">\u00a0\u00a0\u00a0 requests.memory: 1Gi<\/span>\u00a0\r\n<span data-contrast=\"none\">\u00a0\u00a0\u00a0 limits.cpu: \"2\"<\/span>\u00a0\r\n<span data-contrast=\"none\">\u00a0\u00a0\u00a0 limits.memory: 2Gi<\/span>\u00a0\r\n<span data-contrast=\"none\">EOF<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n<\/blockquote>\n<ul>\n<li><span data-contrast=\"auto\">Command to know hwo many pods are into namespace<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<pre><span data-contrast=\"none\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kubectl get pods \u2013namespace=nom_du_namespace<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:708,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Architecture There is many architecture to install a K8S cluster. according to the aim or costs, you can chose the adequat design. K8S architecture bellow: most interfaces used in kub: CRI as Container Runtime Interface, CNI as Containes Network Interface, CSI as Container Storage Interface \u00a0ETCD Database Etcd database store all information about cluster: Nodes, Pods, Config, secret, Accounts, Roles, Binding,\u2026\u00a0 Direct installation bellow : \u00a0\u00a0\u00a0\u00a0\u00a0wget -q &#8211;https-only \\ &#8220;https:\/\/github.com\/coreos\/etcd\/releases\/download\/v3.3.9\/etcd-v3.3.9-linux-amd64.tar.gz&#8221;\u00a0 Run etcd service via la commande .\/etcd\u00a0 change the value into database with etcd control: .\/etcdctl set key\u00a0 value\u00a0 check installed version of etcdctrl : .\/etcdctl &#8211;version\u00a0 Be attention, you\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":""},"categories":[12],"tags":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/devopsopen.com\/index.php\/author\/admin_bak\/"},"uagb_comment_info":2,"uagb_excerpt":"Architecture There is many architecture to install a K8S cluster. according to the aim or costs, you can chose the adequat design. K8S architecture bellow: most interfaces used in kub: CRI as Container Runtime Interface, CNI as Containes Network Interface, CSI as Container Storage Interface \u00a0ETCD Database Etcd database store all information about cluster: Nodes,&hellip;","_links":{"self":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":14,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}