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
service { | |
name = "counting" | |
id = "counting" | |
port = 9003 | |
address = "127.0.0.2" | |
connect { | |
sidecar_service {} | |
} |
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: |
# Start Consul using the below command | |
# consul agent -dev -config-file consul.hcl | |
config_entries { | |
bootstrap { | |
Kind = "proxy-defaults" | |
Name = "global" | |
Config = { | |
protocol = "http" |
packer { | |
required_plugins { | |
qemu = { | |
version = ">= 1.1.0" | |
source = "github.com/hashicorp/qemu" | |
} | |
} | |
} | |
source "qemu" "hashibox" { |
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: | |
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
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.
shikari create -n rose -s 1 -t https://gist.githubusercontent.com/Ranjandas/773ddaf275e57505708692dd0acd0e2e/raw/9addc14ab8dde5c717dd3789d4f709ea6c8873ce/hashibox.yaml
FROM openjdk:11 | |
COPY . /usr/src/myapp | |
WORKDIR /usr/src/myapp | |
RUN javac HeapMemoryHttpServer.java | |
ENV JAVA_OPTS="" | |
CMD java $JAVA_OPTS -cp . HeapMemoryHttpServer |
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)