How to Use Zadig’s Self‑Test Mode for Isolated Microservice Development with Istio and SkyWalking
This guide explains how to leverage Zadig v1.11.0’s environment self‑test mode to create isolated developer sub‑environments for large‑scale microservice projects, using Istio’s traffic routing and SkyWalking tracing, detailing prerequisite components, configuration of a PiggyMetrics Spring Boot example, and step‑by‑step verification via Kubernetes commands and curl requests.
Introduction
Microservice architectures are widely adopted in enterprise development, but rapid business growth can lead to hundreds of services and complex test environments. Zadig v1.11.0 introduces an environment self‑test mode that lets engineers spin up low‑cost, dedicated sub‑environments based on a full‑service baseline, using Istio’s dynamic routing and SkyWalking’s tracing to avoid environment‑related bottlenecks.
Project Overview
The tutorial uses the PiggyMetrics Spring Boot project as a representative microservice application, together with Istio, SkyWalking, and a set of supporting services (MongoDB instances, RabbitMQ, etc.). The goal is to demonstrate how to create a developer sub‑environment for the
statistics-serviceand
config-servicecomponents.
Service Composition
The example consists of eight Spring Boot services:
account-service
auth-service
config-service (manages ConfigMaps and Secrets)
gateway
monitoring-service
notification-service
registry-service
statistics-service
Four MongoDB instances and one RabbitMQ instance provide the required data stores.
Prerequisite Components
Kubernetes v1.20.11 (2 nodes, 8 CPU / 16 GB each)
Zadig v1.11.0+
SkyWalking v8.8.1
ElasticSearch 7.5.1
Istio 1.12.1
Installation Steps
1. Install Zadig
Follow the official “Quick Install” documentation.
2. Install Istio
Refer to the Istio Installation Guides.
3. Install SkyWalking
<code>kubectl create ns skywalking
git clone https://github.com/apache/skywalking-kubernetes
cd skywalking-kubernetes
helm repo add elastic https://helm.elastic.co
helm dep up chart/skywalking
helm install skywalking skywalking -n skywalking -f ./skywalking/values-es7.yaml</code>4. Prepare Agent Image
<code>FROM busybox:latest
RUN mkdir -p /usr/skywalking/agent/
ADD apache-skywalking-apm-bin/agent/ /usr/skywalking/agent/
WORKDIR /</code>5. Build Business Service Image
<code>FROM java:8-jre
ADD ./target/statistics-service.jar /app/
ENTRYPOINT ["sh","-c","java -Dapp.id=$SW_AGENT_NAME -Xmx200m $JAVA_OPTS -Dskywalking.agent.service_name=$SW_AGENT_NAME -Dskywalking.collector.backend_service=$SW_AGENT_COLLECTOR_BACKEND_SERVICES -jar /app/statistics-service.jar"]
EXPOSE 7000</code>Create Baseline Environment
In Zadig, create a project named
piggymetricsand import all service YAML files from the Zadig code repository. The baseline environment is named
base.
Enable Self‑Test Mode
After the baseline is ready, create a sub‑environment
subdevthat includes
config-serviceand
statistics-service. Modify the sub‑environment’s ConfigMap
special-config-envto point middleware addresses to the appropriate
.svc.cluster.localDNS names.
<code>apiVersion: v1
data:
account_mongodb_host: account-mongodb.piggymetrics-env-base.svc.cluster.local
auth_mongodb_host: auth-mongodb.piggymetrics-env-base.svc.cluster.local
auth_service_host: auth-service.piggymetrics-env-base.svc.cluster.local
notification_mongodb_host: notification-mongodb.piggymetrics-env-base.svc.cluster.local
rabbitmq_host: rabbitmq.piggymetrics-env-base.svc.cluster.local
registry_service_host: registry.piggymetrics-env-base.svc.cluster.local
statistics_mongodb_host: statistics-mongodb.piggymetrics-env-base.svc.cluster.local
kind: ConfigMap
metadata:
name: special-config-env</code>Verification
Expose the
gatewayservice of the baseline environment:
<code>kubectl port-forward service/gateway 8085:80 -n piggymetrics-env-base</code>Access the baseline via Chrome or
curl:
<code>curl -v -X PUT -H "Authorization: Bearer c7f5d94f-8eca-4702-96b4-f496837e8e29" -H "Content-Type:application/json" -d '{"note":null,"incomes":[{"income_id":1,"title":"10000www","icon":"wallet","currency":"USD","period":"MONTH","amount":"10000","converted":"NaN"}],"expenses":[],"saving":{"amount":0,"capitalization":false,"deposit":false,"currency":"USD","interest":0}}' localhost:8085/accounts/current</code>To test the sub‑environment, add the headers
x-env: subdevand the SkyWalking
sw8propagation header:
<code>curl -v -X PUT -H "Authorization: Bearer c7f5d94f-8eca-4702-96b4-f496837e8e29" -H 'x-env: subdev' -H 'sw8: 1-Mjk3ZWIyYTIzNzk2NGQzZDgzMzVkMjk3MTA3NjliNjQuNDkuMTY1MTczNjc1NDEwNTAwMDE=-Mjk3ZWIyYTIzNzk2NGQzZDgzMzVkMjk3MTA3NjliNjQuNDkuMTY1MTczNjc1NDEwNTAwMDA=-1-U2VydmljZUI=-MTEwY2VhMzFhODcwNDBlZTkwN2QxZjQxOTg0MjUzMTFAMTkyLjE2OC4wLjI0MA==-R0VUOi9ncmVldGluZy97bmFtZX0=-U2VydmljZUE6ODA' -H "Content-Type:application/json" -d '{"note":null,"incomes":[{"income_id":1,"title":"10000www","icon":"wallet","currency":"USD","period":"MONTH","amount":"10000","converted":"NaN"}],"expenses":[],"saving":{"amount":0,"capitalization":false,"deposit":false,"currency":"USD","interest":0}}' localhost:8085/accounts/current</code>Check the logs of
statistics-servicein the sub‑environment to confirm the request reached the isolated instance:
<code>kubectl logs statistics-service-5966d6b65c-5sc98 -n piggymetrics-env-subdev | grep "statistics-service-"</code>Conclusion
By using Zadig’s self‑test mode, engineers can quickly create personal sub‑environments that share the baseline services while remaining isolated, dramatically reducing waiting time and environment‑related conflicts during large‑scale microservice development.
Ops Development Stories
Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.