Giter Site home page Giter Site logo

k3d-cluster-bershire's Introduction

Prerequisites Installs on local desktop:

  1. Installed Chocolatey package manager for Windows: https://chocolatey.org/install
  2. Installed k3d using Choco
  3. Installed Docker Desktop Hint: This may be required as virtual is required for docker engine to work PS C:\WINDOWS\system32> bcdedit /set hypervisorlaunchtype auto The operation completed successfully.

PS C:\Users\adeba> wsl -l -v NAME STATE VERSION

  • Ubuntu-22.04 Running 2 docker-desktop Running 2 docker-desktop-data Running 2 PS C:\Users\adeba> Note Docker Engine won't stay up until docker-desktop and docker-desktop-data need to be RUNNING - spent time troubleshooting Engine NOT coming

Installation and Setup:

  1. Create Dockerfile and copy html (pre-created) to the same folder

  2. Builder file and test docker build -t bayo-nginx:v1 .

  3. Create private registry k3d registry create test-app-registry --port 5050

  4. Create registries.yaml (file in folder)

mirrors: "localhost:5050": endpoint: - http://k3d-test-app-registry:5050

  1. Create new cluster with registy:

k3d cluster create seyicluster -p "9900:80@loadbalancer" --registry-use k3d-test-app-registry:5050 --registry-config registries.yaml

k3d node edit k3d-seyicluster-serverlb --port-add 80:80

Hint: Ran docker ps to see all port mappings with the load balancer

  1. Tag and push the image to the local registry created

docker tag bayo-nginx:v1 localhost:5050/bayo-nginx:v1 docker push localhost:5050/bayo-nginx:v1

  1. Create a new deployment and service using node port:

kubectl create ns bayodev

kubectl create deployment bayo-web-server-deployment --image=k3d-test-app-registry:5050/bayo-nginx:v1 -n bayodev

kubectl create service nodeport bayo-web-server-svc --tcp=80:80 -n bayodev

Note: Converted everything to attached .yaml files

Hint: To switch bayodev namespace as context: "kubectl config set-context --current --namespace=bayodev"

  1. Create Ingress resource for service:

cat bayo-web-server-ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: bayo-web-server-ingress namespace: bayodev spec: rules:

  • host: localhost http: paths:
    • backend: service: name: bayo-web-server-svc port: number: 80 path: / pathType: Prefix

kubectl apply -f bayo-web-server-ingress.yaml

k3d-cluster-bershire's People

Contributors

bayoalege avatar

Watchers

 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.