Code Monkey home page Code Monkey logo

infrastructure's Introduction

Home Lab

I am using a I7 machine with 64G of ram and a 600G disk and I connect to my openwrt where I use dnsmask to simulate A records on my box machine I use the xen server XCP-NG what is a greate aquesition and it brings XOA Great job! or KVM and use vagrant to deployment you can clone my repo Orpere and kubespray inside what will help with the kubernetes build.

1 - create a themplate in xen with your election distro "I have add ubuntu18.04 and centos7" and don't forget to add your public key to the instances and enable sudo to your user. I use NOPASSWD

2 - run kubespray against your instances and don't forget to add the option --user and --private-key to your ansible-playbook command

    ansible-playbook  -i inventory/mycluster/hosts.yml --user=<YOUR USER> --become --become-user=root cluster.yml --private-key=<YOUR KEY>

NOTE: this will take long time please have a coffe :)

3 - get your kubectl working it will help to manage the cluster form your network

3.1 - Copy from the kubespray host the file on /etc/kubernetes/admin.conf to your local ~/.kube/config 3.2 - kubectl cluster-info should return:

            Kubernetes master is running at https://<api_ip>:6443
            coredns is running at https://<api_ip>:6443/api/v1/namespaces/kube-system/services/coredns:dns/proxy
            kubernetes-dashboard is running at https://<api_ip>:6443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy

3.3 - kubectl config current-context (for check what cluster is your config ) should return something as: [email protected]

4 - get metallb working

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.5/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.5/manifests/metallb.yaml
# On first install only
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
kubectl apply -f k8s-cluster-manifests/metallb-map.yaml

5 - install traefik

helm init --wait
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
helm install stable/traefik --name traefik --set dashboard.enabled=true,serviceType=NodePort,dashboard.domain=dashboard.traefik,rbac.enabled=true  --namespace kube-system

#traefik dashboard with password
note: first need to remove the previous deployment
htpasswd -nb traefik password


helm install stable/traefik --name traefik --set dashboard.enabled=true,serviceType=LoadBalancer,dashboard.domain=traefik.lan,rbac.enabled=true,dashboard.auth.basic.traefik='$apr1$npha/qF1$VD51O1swfgGWmuiaDfdZA0' --namespace kube-system

Note: check the service type and password

6 - create a dashboard user admin

kubectl apply -f k8s-cluster-manifests/cluster-admin.yaml
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | (grep admin-user || echo "$_") | awk '{print $1}') | grep token: | awk '{print $2}'

infrastructure's People

Contributors

orpere avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.