Coder Social home page Coder Social logo

atrejomora / demo-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vmware-archive/demo-app

0.0 0.0 0.0 111.76 MB

Demo App for DT & k8s and misc.

License: Apache License 2.0

Java 59.55% Shell 3.23% Dockerfile 0.91% Makefile 0.65% Go 7.87% C# 17.78% Python 10.03%

demo-app's Introduction

Tanzu Observability demo-app

This is a polyglot demo app for showcasing Tanzu Observability.

TODO

  1. Add UI repo link

Configure, Build, Package and Deploy


Configure

  • Configure the deploy/src/values.sh file with your settings:
export K8S_NAMESPACE=tacocat
export K8S_APPLICATION=tacocat
export K8S_CLUSTER=cluster1
export K8S_LOCATION=americas
export K8S_REPOSITORY=192.168.1.8/demo-app

The above variables will be used by below scripts to fill in the values to setup the *.yaml files. K8S_REPOSITORY is the repository URL for container images which needs to be specified in order for the deployment to properly download the images.

  • Generate the the yaml files
cd deploy/src
./cm.sh 
./create-yaml.sh
  • cm.sh creates the 01-app-config-*.yaml files
  • create-yaml.sh uses envsubst and values.sh to configure all of the *yaml files
  • *Note: create-yaml.sh must be run before building the images as it also creates applicationTag.yaml files used by the services.

Build

  • Build the Java services - from the root folder run:
mvn package
  • Build the .Net service:
cd payments; dotnet build
  • Build the Golang service:
cd inventory; make

Package

  • Create docker images and push to registry.
  • deploy/src/values.sh is referenced here to provide the repository.
  • Build containers and push to your repository:
cd images; 
./all.sh

Deploy

cd deploy
  • The yaml file are split into the deploy, namespace and services folders.
  • This facilitates redeploying the apps in the deploy folder without changing the k8s service or namespace (easier redeploys).
  • Deploy the namespace first:
kubectl apply -f namespace/
  • Create the Wavefront proxy secret to hold the API key:
kubectl create secret generic  wf-token -n tacocat
kubectl edit secrets wf-token  -n tacocat
  • Your secrets file should look something like this:
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
  token: YOUR BASE64 ENCODED TOKEN HERE
kind: Secret
metadata:
  creationTimestamp: "2021-03-09T15:00:09Z"
  name: wf-token
  namespace: $K8S_NAMESPACE
  resourceVersion: "231537"
  selfLink: /api/v1/namespaces/tacocat/secrets/wf-token
  uid: dd60b398-0f3d-4d8c-8f49-017afbb70299
type: Opaque
  • Now deploy the Wavefront proxy:
kubectl apply -f services/10_wavefront.yaml
  • And now deploy the app and create the shopping service:
kubectl apply -f . 
kubectl apply -f service/19_shopping-service.yml
  • To redeploy (but not delete the namespace or service):
kubectl delete -f . 
kubectl apply -f . 

That's it!

Please let use know how we can improve!

demo-app's People

Contributors

scrogatl avatar sushantdewan123 avatar puckpuck avatar atrejomora avatar dependabot[bot] 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.