• Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training
Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips!
  • Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training
No Result
View All Result
Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips!
  • Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training
No Result
View All Result
Sick Codes - Security Research, Hardware & Software Hacking, Consulting, Linux, IoT, Cloud, Embedded, Arch, Tweaks & Tips!
No Result
View All Result
Home Tutorials

One Liner: ULTIMATE Kubernetes Install! K3s! Ubuntu, CentOS, Debian, RHEL. Best k8s, minikube, okd, Openshift Alternative.

by Sick Codes
May 1, 2020 - Updated on June 24, 2020
in Tutorials
0

Forget minikube, k8s, docker swarm, okd, Openshift or any other bloated mess of amateur shell scripts.

This is the one. Install Docker on ANY of the above Operating Systems and then run:

# run this and you're done!
curl -sfL https://get.k3s.io | sh -
kubectl get node
kubectl get get all --all-namespaces

TIP: instead of writing kubectl all the time, it’s much more efficient to put an alias for this command:

echo 'alias ks=kubectl' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
source ~/.bashrc

Now you can type ks or just k to run kubectl commands. I like ks because it sits right under the fingers, ready for action.

If you haven’t got Docker, run this first:

Install Docker CE on Ubuntu

apt-get remove docker docker-engine docker.io containerd runc -y
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg |  apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update -y
apt-get install docker-ce docker-ce-cli containerd.io -y
docker run hello-world
curl -sfL https://get.k3s.io | sh -

And you’re done!

Install a Local Docker Registry On your Kubernetes VM

Put the docker file in your current directory

docker run -d -p 5000:5000 --restart=always --name registry registry:2
docker build --no-cache -t IMAGENAME .
docker tag IMAGENAME localhost:5000/IMAGENAME
docker push localhost:5000/IMAGENAME

Now you can pull direct from that image

docker run localhost:5000/IMAGENAME

Install the Kubernetes Dashboard on K3s

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml

echo 'apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard' > dashboard.admin-user.yml

echo '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' > dashboard.admin-user-role.yml

k3s kubectl create -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml
k3s kubectl -n kubernetes-dashboard describe secret admin-user-token | grep ^token
k3s kubectl proxy
Next Post

How to Convert SQLite to MySQL & Connect DJANGO to WEB + MySQL Server: Converting a Django sqlite3 to MySQL

how to run pipenv inside a docker container

PIPENV Crontab & Docker: How to Run PIPENV Python Automatically Properly in Cron Jobs with Pipenv - Running Django On a Server

django forms field generator automatically after

Advanced Django Tricks: Dynamically & Automatically Generate Form Fields Using Python Local Variables

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result
  • Home
  • Releases
  • Submit Vuln
  • Press
  • About
  • PGP
  • Contact
    • Contact
    • Submit Vuln
    • VDP
  • Tutorials
    • All Posts
    • Photoshop on Linux
    • macOS on Linux
  • Supporters
  • Projects
  • Training

© 2017-2021 Sick.Codes

@sickcodes

@sickcodes

@sickcodes

Discord Server

sickcodes.slack.com

t.me/sickcodeschat

./contact_form