Code Monkey home page Code Monkey logo

lab-kubernetes's Introduction

Docker and Kubernetes Lab

Build Status

What is Docker? How can Docker containers help you build and deploy a cloud native solution as micro-services? This lab will teach you what-you-need-to-know to get started building and running Docker Containers in IBM Cloud. It covers what Docker is, and more importantly, what Docker is not! You will learn how to deploy and run existing Docker community images, how to create your own Docker images and push them to IBM Cloud, and how to connect containers together using Docker Compose. If you want to know what all this fuss about containers is about, come to this lab and spin up a few containers and see for yourself why everyone is adopting Docker.

This lab is an example of how to create a Python / Flask / Redis app using Docker on IBM Cloud

Copy your apikey to /home/vscode

docker cp ~/.bluemix/apikey.json lab-kubernetes:/home/vscode
docker exec lab-kubernetes sudo chown vscode:vscode /home/vscode/apikey.json

IBM Cloud Login

ibmcloud login -a cloud.ibm.com -r us-south -g default --apikey @~/apikey.json
ibmcloud ks cluster config --cluster nyu-devops
ibmcloud cr login

Update Image name

(kustomize edit set image hitcounter=us.icr.io/nyu_devops/lab-kubernetes && kustomize build .)
kustomize build kube/overlays/dev | kc apply -f -  

Create a dev namespace

When you create a new namespace you must copy the ImagePullSecret from the default namespace so that deployments in the new namespace can pull images from the IBM Cloud Container Registry.

The command to do this for dev is:

kunectl create namespace dev
kubectl -n default get secret all-icr-io -o yaml | sed 's/default/dev/g' | kubectl -n dev apply -f -

What the second command does is to get the ImagePullSecret named all-icr-io from the default namespace and running it through sed to change the namespace: to whatever is needed, and applying it to the dev namespace.

Use with Minikube

In order to use Minikube you need to enable the ingress and registry addons.

Here are the commands to get minikube working:

minikube start
minikube addons enable ingress
minikube addons enable registry

You can also specify these are start up with:

minikube start --addons ingress --addons registry

See Minikube documentation for reference.

lab-kubernetes's People

Contributors

dependabot[bot] avatar rofrano avatar

Watchers

 avatar  avatar  avatar  avatar

lab-kubernetes's Issues

Update for Summer 2022 semester

The 2022 semester is switching from VirtualBox and Vagrant to Docker and Visual Code Studio with the Remote Containers extension. This now supports Docker with Docker and Kubernetes natively so we need to switch to using that instead of a home-grown solution.

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.