Skip to content

viglesiasce/skaffold-telepresence-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

skaffold-telepresence-demo

Open in Cloud Shell

Originally posted here: https://blog.getambassador.io/super-fast-inner-development-loops-for-kubernetes-with-skaffold-and-telepresence-1cd3e42ba665

Run the "production" version of the app.

In this tutorial we'll run two different versions of the app in two different clusters. One version will emulate the production environment. The other will be where we'll do development.

  1. Start the production cluster with minikube.

    minikube start --profile prod-cluster
  2. Run kubectl proxy in the background so we can get access to our prod service later.

    nohup kubectl proxy &
  3. Skaffold can be used to build our image and deploy the app in one command. In this case we'll use the Skaffold Profile prod that is configured from production.

    skaffold run --profile prod

Skaffold and Cloud Code Basics: Iterative Development

In the next session we'll set up a development cluster and iterate on the changes we want to make for our app.

  1. Start the development cluster with minikube.

    minikube start --profile dev-cluster
  2. Click Cloud Code in the status bar

  3. Select Run on Kubernetes, confirm that you want to use the "dev-cluster" context

  4. Once your app is deployed, launch it with the link displayed in your Output panel, near the text

    http://localhost:8080
    Update successful
    

    You can open the web preview by clicking the button and selecting "Preview on port 8080".

Modify the app

  1. Open the HelloWorld.js file and change it to say Hello From Skaffold!.

  2. Save the file. You should see Skaffold sync your chanes to the running container and reload the app autoamtically in the Output panel.

  3. Next, we'll make a bit bigger of a chance by changing the version of a dependency. Open the package.json file and downgrade the version of React from 16.13.1 to 16.13.0.

    This change requires a rebuild of the Docker image so you'll see Skaffold do a full rebuild of your image and then redeploy your changes by updating the Kubernetes manifests to point to the newly built image.

You've now seen the tight feedback loop you can create when using Skaffold and Cloud Code. Up next we'll leverage Telepresence to start receiving some of the production traffic on this development version

Introduce Telepresence for realistic testing in dev

  1. Switch to the prodcution cluster's Kubernetes context:

    kubectx prod-cluster
  2. Download the Telepresence binary

    sudo curl -fL https://app.getambassador.io/download/tel2/linux/amd64/latest/telepresence -o /usr/local/bin/telepresence
    sudo chmod +x /usr/local/bin/telepresence
  3. Check that you can access the service by using Web Preview. Hold the Ctrl and click the link output by this command.

    echo http://localhost:8001/api/v1/namespaces/default/services/node/proxy/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages