Coder Social home page Coder Social logo

mspoc-todo's Introduction

Rails API + Kubernetes setup

Dockerize the app

docker login
rake docker:push_image

Cluster Setup

minikube start

# initialise the namespace
kubectl create -f infrastructure/namespace/mspoc-todo/namespace.yml

# secrets
kubectl -n mspoc-todo create secret generic db-user --from-literal=username=postgres
kubectl -n mspoc-todo create secret generic secret-key-base --from-literal=secret-key-base=85d6555b10f75f61e8191b81d12c38ce37cefbaa24d62d9482ec1b1572f2901983328caca581d4fc731b9591b17d72e37e0e3662b24c0c2d07eadaa19182122e

# volume and postgres TODO: Terraform
kubectl create -f infrastructure/namespace/mspoc-todo/mspoc-todo-postgres-volume.yml
kubectl create -f infrastructure/namespace/mspoc-todo/mspoc-todo-postgres.yml

# db migration
kubectl create -f infrastructure/namespace/mspoc-todo/mspoc-todo-setup.yml

# main service and deployment
kubectl create -f infrastructure/namespace/mspoc-todo/mspoc-todo.yml

# route request to the main service
kubectl create -f infrastructure/namespace/mspoc-todo/mspoc-todo-ingress.yml

# add the ip to hosts file
minikube ip

# troubleshoot ingress
# why is this in the kube-system namespace when we set it to mspoc-todo
kubectl -n kube-system get pods
kubectl -n kube-system logs nginx-ingress-controller-6fc5bcc8c9-j2xz2

# misc commands
# kubectl get all
# kubectl logs xxx
# kubectl describe ing
# kubectl get ing
# minikube ip
# kubectl -n mspoc-todo delete pods -l app=mspoc-todo-app

Questions:

  • what's spec?
  • what's template?
  • how to restart the ingress?
  • best practices on selectors? app, tier?
  • best practices on namespaces?
  • best practices on secrets and config?

mspoc-todo's People

Contributors

dependabot[bot] avatar lemattma avatar

Stargazers

 avatar

Watchers

 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.