Giter Club home page Giter Club logo

yc-k8-test's Introduction

yc-k8-test

Setup

  1. Clone repo:

    SSH - git clone [email protected]:mahesh-tier1app/yc-k8-test.git
    HTTPS - git clone https://github.com/mahesh-tier1app/yc-k8-test.git
    
    cd yc-k8-test
  2. Download license.lic and put it into this directory

Docker Image

  1. To build image:

    docker build -t ycrash .
  2. Tag and push the Docker image to Docker Hub

    docker tag ycrash <dockerhub-user>/<repo-name>:<tag-name>
    
    docker push <dockerhub-user>/<repo-name>:<tag-name>
  3. To run the container locally:

    docker run -ti --rm -p 8080:8080 --name ycrash -v $(pwd)/license.lic:/opt/workspace/yc/license.lic ycrash
  4. Then open http://localhost:8080

Kubernetes

Kubernetes manifests (yaml) resides in kubernetes/ directory.

  1. Copy kubernetes/secret.yaml.template to kubernetes/secret.yaml

    cp kubernetes/secret.yaml.template secret.yaml
    
  2. Edit kubernetes/secret.yaml and replace the license template with the real one.

  3. Change image property in the deployment.yaml to update your Docker Hub repository.

  4. Assuming you have a running kubernetes cluster and kubectl ready to access the cluster, next step is to just run:

    kubectl apply -f kubernetes -R
    
  5. There are a few ways of exposing a service in kubernetes to the outside. But for the initial scope, we can access it privately with:

    kubectl port-forward svc/yc-web 8080:8080
    
  6. Then the service should be accessible from http://localhost:8080

Notes

  • Kubernetes deployment yaml is working. It's the simplest implementation, which is easy for initial review but not yet "production ready".

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.