Git Product home page Git Product logo

totally-real-multi-cloud-payments's Introduction

totally-real-multi-cloud-payments

Playing around with a demo for my talk "Choosing cloud native technologies for the journey to multi-cloud"

Enter at your own peril. ๐Ÿ™ˆ

Setup

  1. Install golang-migrate

  2. Complete Step 1 and Step 2 from the official docs to set up locally on Kubernetes.

  3. Setup the Cockroach SQL client.

    kubectl create -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/master/examples/client-secure-operator.yaml
  4. Open a shell into the Cockroach SQL client pod

    kubectl exec -it cockroachdb-client-secure -- ./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public
  5. In the SQL shell, create database and user. Then, quit the shell using \q

    CREATE DATABASE payments;
    CREATE USER roach WITH PASSWORD 'payments-r-us';
    GRANT admin TO roach;
  6. Set up port forwarding locally

    kubectl port-forward service/cockroachdb-public 26257
  7. Run the payments app. go run main.go

  8. Turn everything off with minikube stop or minikube delete.

  9. Run client & server without Kubernetes

    docker-compose up
  10. Run client & server with Kubernetes

    kubectl apply -f k8s
    kubectl port-forward service/totally-real-multi-cloud-payments-client-service 8080:8080
    kubectl port-forward service/nats 4222:4222
    kubectl get deployments
    kubectl get pods

Publish images to DockerHub

  1. Build the docker images
docker build -t totally-real-multi-cloud-payments-client -f ./docker/client/Dockerfile .
docker build -t totally-real-multi-cloud-payments-server -f ./docker/server/Dockerfile .
  1. Tag the image
docker tag totally-real-multi-cloud-payments-client classicaddetz/totally-real-multi-cloud-payments-client:1.0.0
docker tag totally-real-multi-cloud-payments-server classicaddetz/totally-real-multi-cloud-payments-server:1.0.0
  1. Login to DockerHub
docker login
  1. Push the image to DockerHub
docker push classicaddetz/totally-real-multi-cloud-payments-client:1.0.0
docker push classicaddetz/totally-real-multi-cloud-payments-server:1.0.0

Troubleshoot

Dirty database version: open SQL terminal and run

drop table schema_migrations;

Resources

totally-real-multi-cloud-payments's People

Contributors

addetz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mdsami

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.