Skip to content

IsmailAki/kubernetes-local-development-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant & Kubernetes Local Development Environment

Why did we create such an environment?

The main reason we created such an environment was to easily deploy the code written by the developer team into a kubernetes cluster, to advance a smooth development process, and to standardize development environments.


When the code was changed with Skaffold, the deployment part was solved.

  1. Whenever there is a change in the code, scaffold automatically detects it and makes a docker image.
  2. Pushing new image to docker hub.
  3. Kubernetes pulls and deploys new image.

Why we used k3s?

  1. Lightweight Kubernetes development environment.
  2. A quick and easy Kubernetes cluster.
  3. A single-node configuration
  4. It has a low memory/CPU consumption.

Why we use skaffold?

  1. Fast iterative development
  2. Production-ready CI/CD pipelines
  3. On-cluster application debugging

Requirements


How to use this environment

Application address is: localhost:3000

  1. Docker login
    docker login
  1. Create docker hub repo

    https://hub.docker.com/repository/create

  2. Clone this repo

    git clone https://github.com/AbdullahAki/Kubernetes-Challenge.git
  1. Go inside the repo
    cd Kubernetes-Challenge
  1. Edit skaffold.yaml
#7  - image: username/docker-repo
  1. Start Vagrant cluster
    vagrant up
  1. Get required authentication file
    sudo chmod +x skaffold.sh && ./skaffold.sh
  1. If we are logged in and we want to do build and deploy your app every time your code changes
    skaffold --kubeconfig='k3s.yaml' dev
  1. If we want to build and deploy your App once
    skaffold --kubeconfig='k3s.yaml' run
  1. If you want to see machine UI, you can SSH into the machine.
    vagrant ssh
  1. Exit machine.
    exit
  1. Delete Vagrant cluster
    vagrant destroy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published