Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Latest commit

 

History

History

K8s-on-prem

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Getting started with kubernetes on prem

Abstract

Provision an on-prem Kubernetes test cluster with vagrant and ansible.

Prerequisites

vagrant ansible virtualbox

Instructions

For this tutorial we will make use of this fantastic repo.

Clone the repo:

git clone https://github.com/itwonderlab/ansible-vbox-vagrant-kubernetes.git && cd ansible-vbox-vagrant-kubernetes

start vagrant provisioning:

vagrant up

Once finished, create ssh tunnel with the Kubernetes master node:

ssh -L localhost:8001:127.0.0.1:8001 vagrant@192.168.50.11

Connect to the master node via vagrant ssh utility:

vagrant ssh k8s-m-1

Now we will manually deploy Kubernetes dashboard.
deploy it with the following command:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.0/aio/deploy/recommended.yaml

Create full privilege admin user:

mkdir ~/dashboard && cd ~/dashboard

create a yml file:

nano dashboard-admin.yaml

and paste the following content:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kubernetes-dashboard

Deploy the admin user role:

kubectl apply -f dashboard-admin.yaml

Create admin login token

kubectl -n kubernetes-dashboard create token admin-user

start proxy:

kubectl proxy

Move to the local host, open the browser to the dashboard UI and login with the generated token:

firefox http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

Create our app deployment: click on the '+' sing on the top right and select create => form

add the following data:

alt text

check progress in workload: alt_text

check the deployed app on the worker nodes:

alt_text

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy