Labos de clusters Kubernetes

 

[fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_label="Intro" admin_toggled="yes"][fusion_builder_row][fusion_builder_column type="2_3" layout="2_3" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Souvent quand on parle de cluster k8s de test on tombe sur le projet minikube. J'ai choisi ici de présenter d'autre projets permettant de mettre en place des clusters k8s de test. Je vais aborder les projets kind, k3d et microk8s, il en existe bien sûr d'autres, hésitez pas à les rajouter dans les commentaires.

[/fusion_text][/fusion_builder_column][fusion_builder_column type="1_3" layout="1_3" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_imageframe image_id="18048|medium" max_width="" style_type="" blur="" stylecolor="" hover_type="none" bordersize="" bordercolor="" borderradius="" align="none" lightbox="no" gallery_id="" lightbox_image="" lightbox_image_id="" alt="" link="" linktarget="_self" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset=""]https://www.aukfood.fr/wp-content/uploads/2019/06/kubernetes_barbu-300x193.png[/fusion_imageframe][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" overlay_color="" video_preview_image="" border_size="" border_color="" border_style="solid" padding_top="" padding_bottom="" padding_left="" padding_right="" admin_toggled="yes" admin_label="kind"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" border_position="all" spacing="yes" background_image="" background_repeat="no-repeat" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="small-visibility,medium-visibility,large-visibility" center_content="no" last="no" min_height="" hover_type="none" link=""][fusion_text columns="1" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

kind

kind est un outils permettant de déployer Kubernetes en local avec des noeuds dans des conteneurs Dockers.

Prérequis

  • Docker
  • Go

Installation

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBnbyBnZXQgLXUgc2lncy5rOHMuaW8va2luZAokIGtpbmQgdmVyc2lvbg==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Créer un cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBraW5kIGNyZWF0ZSBjbHVzdGVyIC0tbmFtZSBraW5kY2x1c3QKQ3JlYXRpbmcgY2x1c3RlciAia2luZGNsdXN0IiAuLi4K4pyTIEVuc3VyaW5nIG5vZGUgaW1hZ2UgKGtpbmRlc3Qvbm9kZTp2MS4xNC4xKSAK4pyTIFByZXBhcmluZyBub2RlcyAK4pyTIENyZWF0aW5nIGt1YmVhZG0gY29uZmlnIArinJMgU3RhcnRpbmcgY29udHJvbC1wbGFuZSAK4pyTIEluc3RhbGxpbmcgQ05JIArinJMgSW5zdGFsbGluZyBTdG9yYWdlQ2xhc3Mg[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Utiliser le cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBleHBvcnQgS1VCRUNPTkZJRz0iJChraW5kIGdldCBrdWJlY29uZmlnLXBhdGggLS1uYW1lPSJraW5kY2x1c3QiKSIKCiQga3ViZWN0bCBnZXQgbm9kZXMKTkFNRSBTVEFUVVMgUk9MRVMgQUdFIFZFUlNJT04Ka2luZGNsdXN0LWNvbnRyb2wtcGxhbmUgUmVhZHkgbWFzdGVyIDRtMTlzIHYxLjE0LjE=[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Supprimer le cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBraW5kIGRlbGV0ZSBjbHVzdGVyIC0tbmFtZSBraW5kY2x1c3Q=[/fusion_syntax_highlighter][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_toggled="yes"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_section_separator divider_type="waves_opacity" divider_position="left" divider_candy="top" icon="" icon_color="" bordersize="" bordercolor="" backgroundcolor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" /][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_label="k3s" admin_toggled="no"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

k3d et k3s

k3s est une version très light de Kubernetes dont le but est principalement de tourner sur de petites architectures telles que raspberry, odroid, etc …

Mais il est tout à fait envisageable de faire tourner k3s sur une machine bureautique pour monter un cluster Kubernetes de développement/test. Ce qui peut permettre par rapport à Minukube de “simuler” plusieurs noeuds.

k3d est un outils permettant de bootstapper k3s avec dind.

Prérequis

Il faut bien sûr avec une machine avec Docker d’installé.

Installation de k3d

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCB3Z2V0IC1xIC1PIC0gaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3JhbmNoZXIvazNkL21hc3Rlci9pbnN0YWxsLnNoIHwgYmFzaAokIGszZCAtdmVyc2lvbg==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Créer un cluster

On va créer un cluster de 10 noeuds :

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrM2QgY3JlYXRlIC0tbmFtZSBrM3MwMSAtLXZlcnNpb24gdjAuNS4wIC0td29ya2VycyAxMA==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Utiliser le cluster

Mettre à jour la variable KUBECONFIG

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBleHBvcnQgS1VCRUNPTkZJRz0kS1VCRUNPTkZJRzoiJChrM2QgZ2V0LWt1YmVjb25maWcgLS1uYW1lPSdrM3MwMScpIg==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Changer de contexte avec kubectx (quoi vous utilisez pas kubectx ????)

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrdWJlY3RsIGdldCBub2RlcwpOQU1FIFNUQVRVUyBST0xFUyBBR0UgVkVSU0lPTgoyZTlhNWFiN2VhYTcgUmVhZHkgMTNoIHYxLjE0LjEtazNzLjQKNGU0YTQwOTRlNTc4IFJlYWR5IDEzaCB2MS4xNC4xLWszcy40CjZmZDkwMWQ4MTViZSBSZWFkeSAxM2ggdjEuMTQuMS1rM3MuNAo3YzI2NjAxYWFiMmQgUmVhZHkgMTNoIHYxLjE0LjEtazNzLjQKOWFjMzY1YjcxYWUzIFJlYWR5IDEzaCB2MS4xNC4xLWszcy40CmEwOWI0NGQ2YWZkOSBSZWFkeSAxM2ggdjEuMTQuMS1rM3MuNApiZGVhYWMxZDJmZDYgUmVhZHkgMTNoIHYxLjE0LjEtazNzLjQKYzY4NDI1NGEyYzVjIFJlYWR5IDEzaCB2MS4xNC4xLWszcy40CmM5NjRmMzdhNjRhNSBSZWFkeSAxM2ggdjEuMTQuMS1rM3MuNApkYzFjNzA4MGVkNGYgUmVhZHkgMTNoIHYxLjE0LjEtazNzLjQKZWIyYjI1OWMzODY2IFJlYWR5IDEzaCB2MS4xNC4xLWszcy40[/fusion_syntax_highlighter][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrdWJlY3RsIGdldCBwb2RzIC0tYWxsLW5hbWVzcGFjZXMKTkFNRVNQQUNFIE5BTUUgUkVBRFkgU1RBVFVTIFJFU1RBUlRTIEFHRQprdWJlLXN5c3RlbSBjb3JlZG5zLTY5NTY4ODc4OS02ZnFjZyAxLzEgUnVubmluZyAxIDEzaAprdWJlLXN5c3RlbSBoZWxtLWluc3RhbGwtdHJhZWZpay12NWNrbiAwLzEgQ29tcGxldGVkIDAgMTNoCmt1YmUtc3lzdGVtIHN2Y2xiLXRyYWVmaWstMm1sYmYgMi8yIFJ1bm5pbmcgMiAxM2gKa3ViZS1zeXN0ZW0gc3ZjbGItdHJhZWZpay02ZzRwOCAyLzIgUnVubmluZyAyIDEzaAprdWJlLXN5c3RlbSBzdmNsYi10cmFlZmlrLTcycXA1IDIvMiBSdW5uaW5nIDIgMTNoCmt1YmUtc3lzdGVtIHN2Y2xiLXRyYWVmaWstOGNzN24gMi8yIFJ1bm5pbmcgMiAxM2gKa3ViZS1zeXN0ZW0gc3ZjbGItdHJhZWZpay1jamJxcyAyLzIgUnVubmluZyAyIDEzaAprdWJlLXN5c3RlbSBzdmNsYi10cmFlZmlrLWY2YnFsIDIvMiBSdW5uaW5nIDIgMTNoCmt1YmUtc3lzdGVtIHN2Y2xiLXRyYWVmaWstZmRyczcgMi8yIFJ1bm5pbmcgMiAxM2gKa3ViZS1zeXN0ZW0gc3ZjbGItdHJhZWZpay1nOWs5bCAyLzIgUnVubmluZyAyIDEzaAprdWJlLXN5c3RlbSBzdmNsYi10cmFlZmlrLWtwNDg4IDIvMiBSdW5uaW5nIDIgMTNoCmt1YmUtc3lzdGVtIHN2Y2xiLXRyYWVmaWstcGc3cWwgMi8yIFJ1bm5pbmcgMiAxM2gKa3ViZS1zeXN0ZW0gc3ZjbGItdHJhZWZpay10YzlicyAyLzIgUnVubmluZyAyIDEzaAprdWJlLXN5c3RlbSB0cmFlZmlrLTU1YmQ5NjQ2ZmMtbjc5Z2IgMS8xIFJ1bm5pbmcgMSAxM2g=[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Lister les clusters

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrM2QgbCAtYQorLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0rLS0tLS0tLS0tKwp8IE5BTUUgfCBJTUFHRSB8IFNUQVRVUyB8IFdPUktFUlMgfAorLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0rLS0tLS0tLS0tKwp8IGszczAxIHwgZG9ja2VyLmlvL3JhbmNoZXIvazNzOnYwLjUuMCB8IGV4aXRlZCB8IDAvMTAgfAorLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0rLS0tLS0tLS0tKw==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Stopper un cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrM2Qgc3RvcCAtLW5hbWUgazNzMDE=[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Démarrer un cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrM2Qgc3RhcnQgLS1uYW1lIGszczAx[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Supprimer un cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBrM2QgZGVsZXRlIC0tbmFtZSBrM3MwMQ==[/fusion_syntax_highlighter][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_toggled="yes"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_section_separator divider_type="curved" divider_position="left" divider_candy="top" icon="" icon_color="" bordersize="" bordercolor="" backgroundcolor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" /][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_label="microk8s" admin_toggled="yes"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Microk8s

Microk8s est un autre projet pour installer un cluster k8s sur un noeud sur une machine Linux.

 

Prérequis

Il faut pour installer microk8s :

  • une machine Linux
  • snap

Installation de microk8s

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBzbmFwIGluc3RhbGwgbWljcm9rOHMgLS1jbGFzc2ljIC0tY2hhbm5lbD0xLjE1L3N0YWJsZQ==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Voir le status

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBtaWNyb2s4cy5zdGF0dXMKbWljcm9rOHMgaXMgcnVubmluZwphZGRvbnM6CmtuYXRpdmU6IGRpc2FibGVkCmphZWdlcjogZGlzYWJsZWQKZmx1ZW50ZDogZGlzYWJsZWQKZ3B1OiBkaXNhYmxlZApzdG9yYWdlOiBkaXNhYmxlZApyZWdpc3RyeTogZGlzYWJsZWQKcmJhYzogZGlzYWJsZWQKaW5ncmVzczogZGlzYWJsZWQKZG5zOiBkaXNhYmxlZAptZXRyaWNzLXNlcnZlcjogZGlzYWJsZWQKbGlua2VyZDogZGlzYWJsZWQKcHJvbWV0aGV1czogZGlzYWJsZWQKaXN0aW86IGRpc2FibGVkCmRhc2hib2FyZDogZGlzYWJsZWQ=[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Fichier de configuration

Avec microk8s on a une commande kubectl différente de celle installée sur une machine habituelle, mais il est tout à fait possible de récupérer la configuration du kubernetes créé et de la rajouter dans les KUBECONFIG.

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBleHBvcnQgS1VCRUNPTkZJRz0kS1VCRUNPTkZJRzoiJChtaWNyb2s4cy5rdWJlY3RsIGNvbmZpZyB2aWV3IC0tcmF3ID4gJEhPTUUvLmt1YmUvY29uZmlnLW1pY3JvazhzKSI=[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Accéder au Kubernetes

Avec la commande spécifique microk8s.kubectl[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBtaWNyb2s4cy5rdWJlY3RsIGdldCBub2RlcwokIG1pY3JvazhzLmt1YmVjdGwgZ2V0IHNlcnZpY2Vz[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Les addons

Il est possible assez facilement de rajouter des addons : dns, dashboard, storage, ingress, istio …

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBtaWNyb2s4cy5lbmFibGUgZG5zIGRhc2hib2FyZA==[/fusion_syntax_highlighter][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Arrêter le cluster

[/fusion_text][fusion_syntax_highlighter theme="" language="x-sh" line_numbers="" line_wrapping="" copy_to_clipboard="" copy_to_clipboard_text="Copy to Clipboard" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" font_size="" border_size="" border_color="" border_style="" background_color="" line_number_background_color="" line_number_text_color="" margin_top="" margin_left="" margin_bottom="" margin_right=""]JCBtaWNyb2s4cy5zdG9w[/fusion_syntax_highlighter][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_toggled="yes"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_section_separator divider_type="slant" divider_position="left" divider_candy="top" icon="" icon_color="" bordersize="" bordercolor="" backgroundcolor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" /][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container hundred_percent="no" hundred_percent_height="no" hundred_percent_height_scroll="no" hundred_percent_height_center_content="yes" equal_height_columns="no" menu_anchor="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" status="published" publish_date="" class="" id="" background_color="" background_image="" background_position="center center" background_repeat="no-repeat" fade="no" background_parallax="none" enable_mobile="no" parallax_speed="0.3" video_mp4="" video_webm="" video_ogv="" video_url="" video_aspect_ratio="16:9" video_loop="yes" video_mute="yes" video_preview_image="" border_size="" border_color="" border_style="solid" margin_top="" margin_bottom="" padding_top="" padding_right="" padding_bottom="" padding_left="" admin_label="Conclusion"][fusion_builder_row][fusion_builder_column type="1_1" layout="1_1" spacing="" center_content="no" link="" target="_self" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id="" background_color="" background_image="" background_image_id="" background_position="left top" background_repeat="no-repeat" hover_type="none" border_size="0" border_color="" border_style="solid" border_position="all" border_radius="" box_shadow="no" dimension_box_shadow="" box_shadow_blur="0" box_shadow_spread="0" box_shadow_color="" box_shadow_style="" padding_top="" padding_right="" padding_bottom="" padding_left="" margin_top="" margin_bottom="" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset="" last="no"][fusion_text columns="" column_min_width="" column_spacing="" rule_style="default" rule_size="" rule_color="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="" id=""]

Ma conclusion

Ces 3 projets en complément de Minikube sont très intéressants pour expérimenter des cluster Kubernetes sur son poste de travail, mon préféré c'est kind, mais microk8s permet aussi de tester des addons.

Hésitez pas à expérimenter et jouer avec les contextes kubectl pour passer d'un cluster à un autre.

[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]