Skip to content

Creating a "live" infastructure from YAML config

Notifications You must be signed in to change notification settings

Ivanhahanov/mimic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mimic

Creating a "live" infastructure from YAML config

Install Generator

You can download mimic-gen from Github Releases Download for MacOS on ARM

wget -c https://github.com/Ivanhahanov/mimic/releases/download/0.1.0/mimic_Darwin_arm64.tar.gz -O - | tar -xz
sudo mv ./mimic-gen /usr/local/bin/mimic-gen

Quick start

Generate k8s manifests

mimic-gen examples/infra.yml 

Apply manifests

kubectl apply -f manifests/dev -f manifests/test/

As a result we get 3 services that send http requests to each other every 10 seconds

Tip

You can explore how the services communicate using the hubble ui or hubble observe

Config Example

Create two namespace dev and test with services dev/app, dev/api and test/app.

  • dev/app - port 8080, url /dev, requests to app.test and api services
  • dev/api - port 8080, url /api, requests to app.test service
  • test/app - port 8080, url /test, requests to app.dev service
image: explabs/mimic
namespaces:
  - name: dev
    resources:
      - deployment:
          name: app
          ingress:
          - http:
              port: 8080
              endpoints:
                - url: /dev
                  resp: "Hello from dev"
          egress:
          - http:
              interval: 10
              requests:
                - uri: http://app.test:8080/test
                  method: POST
                - uri: http://api:8080/api
                  method: POST
      - deployment:
          name: api
          ingress:
          - http:
              port: 8080
              endpoints:
                - url: /api
                  resp: "api"
          egress:
          - http:
              interval: 10
              requests:
                - uri: http://app.test:8080/test
                  method: POST

  - name: test
    resources:
      - deployment:
          name: app
          ingress:
          - http:
              port: 8080
              endpoints:
                - url: /test
                  resp: "Hello from test"
          egress:
          - http:
              interval: 10
              requests:
                - uri: http://app.dev:8080/dev
                  method: GET

About

Creating a "live" infastructure from YAML config

Resources

Stars

Watchers

Forks

Languages