Playing around with a demo for my talk "Choosing cloud native technologies for the journey to multi-cloud"
Enter at your own peril. ๐
-
Install
golang-migrate
-
Complete Step 1 and Step 2 from the official docs to set up locally on Kubernetes.
-
Setup the Cockroach SQL client.
kubectl create -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/master/examples/client-secure-operator.yaml
-
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
-
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;
-
Set up port forwarding locally
kubectl port-forward service/cockroachdb-public 26257
-
Run the payments app.
go run main.go
-
Turn everything off with
minikube stop
orminikube delete
. -
Run client & server without Kubernetes
docker-compose up
-
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
- 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 .
- 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
- Login to DockerHub
docker login
- 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
Dirty database version: open SQL terminal and run
drop table schema_migrations;