Skip to content

Instantly share code, notes, and snippets.

@pedes
Last active October 8, 2024 13:06
Show Gist options
  • Save pedes/d515ba61df6b9096f77e1d588db346d2 to your computer and use it in GitHub Desktop.
Save pedes/d515ba61df6b9096f77e1d588db346d2 to your computer and use it in GitHub Desktop.

Cheatsheet for MuleSoft Flex Gateway

Install & Run the Container

docker pull mulesoft/flex-gateway:latest

Repository for docker image: https://hub.docker.com/r/mulesoft/flex-gateway/tags

docker run -d --rm -v $(pwd):/usr/local/share/mulesoft/flex-gateway/conf.d -p 8081:8081 mulesoft/flex-gateway

Troubleshooting tip

If the flex is not properly registered, re-run the container from the /flex folder, where you have the registration.yaml file

So, first stop the running container docker container stop $(docker ps -q)

Location of Logs

/var/tmp/mulesoft/flex-gateway/logs

Sample commands to find logs and its configuration docker exec CONTAINER_ID cat /var/tmp/mulesoft/flex-gateway/logs/current

docker logs CONTAINER_ID

Find the container ID with docker ps

Tracing ID header is X-Request-ID

More info: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/observability/tracing

Key Config folders

/usr/local/share/mulesoft/flex-gateway/conf.d

/etc/mulesoft/flex-gateway/fluent

/etc/mulesoft/flex-gateway/conf.d

/var/tmp/mulesoft/flex-gateway

Fluent Bit Config file /var/tmp/mulesoft/flex-gateway/fluent-bit.conf

Useful Commands

List the images and versions, filtered by Flex

docker images mulesoft/flex-gateway

Connect to the container through the terminal

docker exec -it bbca9200bb8b73a2297da99da4fea7bc66fbe0de3db5f3339aaba950c6e0cc9f bash

List the files in the config folder, from the outside of the container

docker exec a6eb04b7d994 ls /usr/local/share/mulesoft/flex-gateway/conf.d/

Run the docker container in detached mode (-d)

docker run -d --rm -v $(pwd):/usr/local/share/mulesoft/flex-gateway/conf.d -p 8083:8081 mulesoft/flex-gateway

References

@pedes
Copy link
Author

pedes commented Oct 8, 2024

Install Anypoint CLI on the Cloudshare VM

1st Install Node package manager
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

2nd Install Node
nvm install 20

3rd Install Anypoint CLI
npm install -g anypoint-cli-v4

  1. Test installation
    anypoint-cli-v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment