Wilson Mar bio photo

Wilson Mar

Hello!

Email me Calendar Skype call

LinkedIn Twitter Gitter Instagram Youtube

Github Stackoverflow Pinterest

My customizations and notes about using the HashiCups sample app and infrastructure code created by HashiCorp to do their demos and training

US (English)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Estonian   اَلْعَرَبِيَّةُ (Egypt Arabic)   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean

Overview

NOTE: Content here are my personal opinions, and not intended to represent any employer (past or present). “PROTIP:” here highlight information I haven’t seen elsewhere on the internet because it is hard-won, little-know but significant facts based on my personal research and experience.

“HashiCups” is the demo app used across several products from HashiCorp.

HashiCups is not a “bare bones” toy app. Unlike many others, HashiCups comes with configuration settings for installing in several clouds running with Kubernetes, Gateways, and other production-grade infrastructure.

That’s because HashiCorp created it and actively maintains it as the base for testing, demos, training, observability instrumentation (logging, monintoring, tracing), and performance benchmarks of HashiCorp’s industry-grade Terraform, Vault, Consul, Nomad, Waypoint, Packer, Vagrant, and others used by many Global 2000 enterprises around the world.

HashiCorp provides instructions for creating instances of HashiCups locally on a Mac and in Linux servers in various clouds. CircleCI config.yml code is provided for using Terraform Cloud.

HashiCups configurations include HA (High Availability) and High Performance redudancies across several Availability Zones and even several regions.

HashiCups leverages micro-services and Consul Service Mesh to connect components together securely in a way that satisfies “Zero Trust” principals.

All that means complexity to learn. So being comfortable installing and using HashiCups takes some time and cloud credits (if you’re not using Instruqt labs). But you’ll be learning a production-quality way to make use of the latest IT technologies.

My files in GitHub

The above is why here is where I put notes about integrating various HashiCorp products with utility software such as Kubernetes. Files for this topic is under my personal account:

    https://github.com/wilsonmar/hashicups
  1. For use while going through a a class:

    export SCRIPT="consul-server-install.sh"
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/wilsonmar/hashicups/main/${SCRIPT})" -v
    

Doc & Tutorials

https://github.com/hashicorp/learn-consul-k8s-hashicups

https://github.com/hashicorp/field-demo-hashicups-sample

https://wilsonmar.github.io/hashicups/#hashicorps-codebase-for-hashicups

HashiCorp’s Codebase for HashiCups

Code to create an instance of Hashicups is (Apache 2) open-sourced at the GitHub Organization: https://github.com/hashicorp-demoapp

  • https://github.com/hashicorp-demoapp/hashicups-client-go

  • https://github.com/hashicorp-demoapp/frontend provides a React-based UI which makes GraphQL calls to the products-api backend

  • https://github.com/hashicorp-demoapp/product-api is the products-api backend which responds to GraphQL API calls

  • https://github.com/hashicorp-demoapp/product-api-go is the products-api backend which accesses the

  • https://github.com/hashicorp-demoapp/postgres database

  • https://github.com/hashicorp-demoapp/payments is the gRCP-based payments service which handles customer payments. This service is backed by a PostgreSQL database or a Redis queue.

SREs look at this regarding infrastructure:

  • https://github.com/hashicorp-demoapp/instruqt uses Shipyard data workflows https://shipyard.run/ referencing https://github.com/shipyard-run/shipyard to run Cloud Native Dev deployments on local environments (managing dependencies better than Docker Compose & Postman)

  • https://github.com/hashicorp-demoapp/hashicups-setups
  • https://github.com/hashicorp-demoapp/infrastructure

  • https://github.com/hashicorp-demoapp/traffic-simulation by nicholas jackson is the code to https://hub.docker.com/repository/docker/hashicorpdemoapp/traffic-simulation

  • https://github.com/hashicorp-demoapp/coffee-service is the code to https://hub.docker.com/r/hashicorpdemoapp/coffee-service

Its standard library of reusable abstractions (in Golang) uses Opentracing, Zipkin, Jaeger.

HashiStack

“HashiStack” is the nickname for an implementation that makes use of HashiCorp’s main products and associated utilities:

</table> https://blog.marcolancini.it/2019/blog-offensive-infrastructure-hashistack/ ## Consul K8s Prometheus Grafana dashboard https://github.com/hashicorp/consul-k8s-prometheus-grafana-hashicups-demoapp from Sep 2020 (by Derek Strickland) contains application and dashboard definitions for the Consul Layer 7 observability with Kubernetes guide located at learn.hashicorp.com ## References https://www.consul.io/docs/agent/telemetry https://www.consul.io/docs/connect/observability https://learn.hashicorp.com/tutorials/terraform/provider-setup https://learn.hashicorp.com/tutorials/consul/kubernetes-deployment-guide https://learn.hashicorp.com/collections/consul/kubernetes-production https://www.fyber.com/engineering/syncing-kubernetes-and-hashicorp-consul/ Reference Architecture: * https://learn.hashicorp.com/tutorials/vault/reference-architecture * https://play.instruqt.com/hashicorp/tracks/adp-vault * https://play.instruqt.com/hashicorp/tracks/hashicups-sample (by ex-employee Lance Larsen) brings up an enviornment of all servers, with no instructional content.
## Terraform Custom providers STAR: https://learn.hashicorp.com/tutorials/terraform/provider-use contains documentation on Terraform Custom Providers
    It downloads https://github.com/hashicorp/learn-terraform-hashicups-provider
"You cannot understand how Terraform works skimming a tutorial. You must (manually) follow along." -- VIDEO: "How to Build a Usable Terraform Provider in 20 hours"Terraform Plugin flow * https://www.peerislands.io/building-a-custom-terraform-provider-evolution-and-future-of-iaac/ * https://www.youtube.com/watch?v=noxwUVet5RE "Creating a Terraform Provider for Just About Anything" * https://learn.hashicorp.com/collections/terraform/providers describes how to interact with APIs using Terraform providers, based on
https://github.com/hashicorp/terraform-provider-hashicups at
https://registry.terraform.io/providers/hashicorp/hashicups/latest and docs at
https://registry.terraform.io/providers/hashicorp/hashicups/latest/docs * https://www.katacoda.com/hashicorp/scenarios/terraform-custom-provider-workshop * https://learn.hashicorp.com/tutorials/terraform/provider-setup within a private cloud. * https://blog.devgenius.io/custom-terraform-provider-design-c39287c816e9 * "Zero Trust Security & Data Protection" course slides online at https://hashicorp.github.io/field-workshops-vault/slides/multi-cloud/adp/#1
Component Usage
Vagrant Ansible.
Terraform Infrastructure as Code.
Consul Service Discovery.
Vault Secrets Management.
Nomad Applications Management.
Docker Applications Containerization.
Dnsmasq Internal Hostnames Resolution.
Traefik Reverse Proxy.