Skip to content

Instantly share code, notes, and snippets.

View Ranjandas's full-sized avatar

Ranjandas Ranjandas

  • 15:39 (UTC +10:00)
View GitHub Profile
  • Create a Shikari Cluster with nomad-consul-secure scenario

    cd scenarios/nomad-consul-secure
    shikari create -n apigw -s 1 -c 1 -i ~/.shikari/c-1.20.1-n-1.9.3-v-1.18.2-b-0.18.1-fedora/hashibox.qcow2
    
  • Export the environment variables

eval $(shikari env -n apigw consul,nomad -ta)

@Ranjandas
Ranjandas / Dockerfile
Last active October 2, 2024 11:03
Setting JAVA_OPTS to set Heap Memory arg
FROM openjdk:11
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN javac HeapMemoryHttpServer.java
ENV JAVA_OPTS=""
CMD java $JAVA_OPTS -cp . HeapMemoryHttpServer
@Ranjandas
Ranjandas / README.md
Last active September 10, 2024 01:22
This creates a VM that is capable of running x86_64 applications on Linux on ARM
shikari create -n rose -s 1 -t https://gist.githubusercontent.com/Ranjandas/773ddaf275e57505708692dd0acd0e2e/raw/9addc14ab8dde5c717dd3789d4f709ea6c8873ce/hashibox.yaml
@Ranjandas
Ranjandas / README.md
Created August 29, 2024 08:23
Consul API Gateway - Header Based Routing to multiple subsets of same Service using Service-Resolvers

Disclaimer: The information provided in this technical solution is for general informational purposes only. It is provided "as is" without any warranties of any kind, either express or implied. The use of this solution is at your own risk, and I do not assume any responsibility or liability for any errors, omissions, or results obtained from the use of this information. Additionally, I disclaim any and all responsibility or liability for any damages or losses, including but not limited to, direct, indirect, incidental, special, or consequential damages arising out of or in connection with the use of or reliance on this technical solution. Users are encouraged to verify any information before relying on it and to consult with appropriate professionals or experts as needed.

This is a demo of how the Consul API gateway can be used with Service-Resolvers to route traffic based on headers to different subsets of the same backend service. This is a workaround as this is not supported natively using API Gateway.

@Ranjandas
Ranjandas / README.md
Last active August 16, 2024 03:05
repro: go-sockaddr interpolation bug for envoy bootstrap

Run the scenario using the following command

shikari create -n repro -s 1 -i <image_path> -t https://gist.githubusercontent.com/Ranjandas/c24fbde0b922d548e74a7be5da5c8046/raw/798c845bb646a54ce0b3d902c7d491c144119de6/hashibox.yaml
@Ranjandas
Ranjandas / hashibox.yaml
Last active July 10, 2024 23:07
Example Lima Template
images:
# Try to use a local image first.
- location: ~/artifacts/qemu/c-1.18-n-1.7/c-1.18-n-1.7.qcow2
plain: true
provision:
- mode: system # install Consul and Nomad Licenses if any
script: |
packer {
required_plugins {
qemu = {
version = ">= 1.1.0"
source = "github.com/hashicorp/qemu"
}
}
}
source "qemu" "hashibox" {
@Ranjandas
Ranjandas / consul.hcl
Last active December 14, 2023 04:22
Consul OpenTelemetry Tracing Example
# Start Consul using the below command
# consul agent -dev -config-file consul.hcl
config_entries {
bootstrap {
Kind = "proxy-defaults"
Name = "global"
Config = {
protocol = "http"
@Ranjandas
Ranjandas / nomad-cloud-init.yaml
Last active August 5, 2024 08:01
A cloud-init file to spin up a single node Nomad + Consul dev environment.
apt:
sources:
hashicorp:
keyid: 798AEC654E5C15428C8E42EEAA16FCBCA621E701 # fingerprint of https://apt.releases.hashicorp.com/gpg to fetch from Ubuntu Keyserver
source: "deb [signed-by=$KEY_FILE] https://apt.releases.hashicorp.com $RELEASE main"
docker:
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
source: "deb [signed-by=$KEY_FILE] https://download.docker.com/linux/ubuntu $RELEASE stable"
package_update: true
packages:
service {
name = "counting"
id = "counting"
port = 9003
address = "127.0.0.2"
connect {
sidecar_service {}
}