Code Monkey home page Code Monkey logo

rcj-deploy's Introduction

Deploying RCJ to Kube

  • Ensure that kubectl get nodes or a similarly basic command works
  • Install Helm/Tiller. Helm is the client side component while Tiller is the server-side
sudo snap install helm --classic
kubectl create serviceaccount tiller --namespace=kube-system
kubectl create clusterrolebinding tiller-admin --serviceaccount=kube-system:tiller --clusterrole=cluster-admin
helm init --service-account=tiller
  • With Helm installed, running the following to install cert-manager helm install --name cert-manager --namespace kube-system stable/cert-manager
    • You may encounter an error about a resource already existing. In that case, use these steps
helm delete --purge cert-manager
helm install --name cert-manager --namespace kube-system stable/cert-manager --set createCustomResource=false
helm upgrade --install --namespace kube-system cert-manager stable/cert-manager --set createCustomResource=true
  • Create a Cert Issuer tied to Lets Encrypt with kubectl apply -f cert-issuer.yaml
  • In order to use Google Sheets, we need some credentials for the app to use. Visit https://developers.google.com/sheets/api/quickstart/go and use the Enable button. Follow the steps and download the credentials.json file.
  • Install the credentials into the cluster kubectl create secret generic google-sheets-credential --from-file=credential.json
  • Deploy the database kubectl apply -f cockroach-single.yaml
  • Create the database user using kubectl exec cockroachdb-0 /cockroach/cockroach -- user set rcjgo --insecure
  • Create the database using kubectl exec cockroachdb-0 /cockroach/cockroach -- sql --insecure -e 'CREATE DATABASE rcj'
  • Assign permissions using kubectl exec cockroachdb-0 /cockroach/cockroach -- sql --insecure -e 'GRANT ALL ON DATABASE rcj TO rcjgo'
  • Get a terminal on the database container using kubectl exec -it cockroachdb-0 bash and run the following
apt-get update
apt-get install -y curl
curl -O https://raw.githubusercontent.com/davefinster/rcj-go/master/tables.sql
./cockroach sql --user=rcjgo --database=rcj --insecure < tables.sql
  • Deploy the backend with kubectl apply -f rcj-go.yaml
  • Deploy the frontend with kubectl apply -f rcj-react.yaml

Provider Specific Deployments

Due to the way ingresses are handled, there are some specifics around

Deploying to GKE

  • Reserve a static IP address via the gcloud tool using gcloud compute addresses create rcj-ip --global
  • Fetch the IP address using gcloud compute addresses list and update the DNS entry you want to use. You can check propogation using https://www.whatsmydns.net/
  • Create the ingress with kubectl apply -f ingress-gce.yaml

Deploying to DigitalOcean Kube

  • Provision an nginx based ingress with kubectl apply -f ingress-nginx.yaml
  • Using kubectl get --namespace=ingress-nginx services, obtain the external IP of the load balancer
  • Update the DNS entry you want to use for RCJ to point to this IP address. You can check propogation using https://www.whatsmydns.net/
  • Generate the SSL certificate using kubectl apply -f cert.yaml
  • Deploy the ingress entry kubectl apply -f ingress.yaml

rcj-deploy's People

Contributors

davefinster 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.