GithubHelp home page GithubHelp logo

cloud-native-fullstack's Introduction

Local Dev Environment Setup

Using the NGINX Ingress Controller in the Local Dev Environment

You need to install it because it is not included in the local Kubernetes cluster by default.

You also need to make sure mkcert is installed locally in your machine. Then make sure the local CA is installed in your machine's trust store:

mkcert -install

Then generate the certificate for the domain codehead.training:

mkcert codehead.training "*.codehead.training" codehead.training localhost 127.0.0.1 ::1

Then create a Kubernetes secret with the certificate:

kubectl create secret tls mydomain-tls --cert=path/to/yourdomain.local.pem --key=path/to/yourdomain.local-key.pem

Then install the NGINX Ingress Controller:

# Add the Nginx Helm repository
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx

# Update your local Helm chart repository cache
helm repo update

# Install the ingress-nginx chart
# mydomain-tls is the name of the secret created above
helm install ingress-nginx ingress-nginx/ingress-nginx \
--set controller.extraArgs.default-ssl-certificate=mydomain-tls \
--set controller.service.type=NodePort \
--set controller.service.nodePorts.http=30905 \
--set controller.service.nodePorts.https=30906

Don't forget to update your machine's /etc/hosts file with the following entry:

127.0.0.1 acmestore.codehead.training storeapi.codehead.training

Finally, you can deploy the application with the following command:

helm install acmestore . -f values-dev.yaml

Installing Telepresence Chart

Make sure telepresence is installed in your local machine. You can install the Telepresence chart with the following command:

telepresence helm install

With telepresence we can do two things:

  • We can access the pg server from outside the cluster by using the in-cluster hostname, eg: acmestore-pg:5432. It essentially moves the laptop to the cluster. This is possible after running intercept for the acmestore-pg service, which triggers the installation of the telepresence traffic agent in the cluster. After disconnecting from the intercept, the agent is not removed and we can access the service from outside.

  • We can intercept network requests to any service in the cluster and redirect them to a local process. This is useful for developing and debugging services in the cluster.

cloud-native-fullstack's People

Contributors

svegalopez avatar

Watchers

 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.