Giter VIP home page Giter VIP logo

istio-redirector's Introduction

istio-redirector

The redirections tool made for SEO managers that perfectly fit in your Istio Mesh by generating Virtual Service files from CSV.

Demo

What is this ?

istio-redirector is a web application that aims to ease your SEO redirections management at scale. Let your SEO managers handle all the redirections they want and get the output as a Istio Virtual Services.

SEO managers use .csv files, that is why the form takes this kind of file as only input. Depending on the type of redirections needed (3xx or 4xx), the server will generate the adequate Virtual Service.

Once generated, the file can either be added to your GitOps repository or downloaded to be manually applied on your cluster.

The UI for SEO Managers

Homepage

The output for developpers/Ops

Virtual Service

Techno

Features

For SEO Managers

  • Import your .csv file with all your redirections, and get a nice view of the parsed routes.
  • In the Virtual Services tab, check all the redirections deployed in the cluster.

For developpers/Ops

  • Get a valid Virtual Service .yaml file ready to be applied to your cluster
  • Manage your redirections as code
  • Reduce your work and maintenance on the SEO stuff

Installation

The easiest way to run istio-redirector is on Docker.

Either use our GitHub Packages image. Or build the image from the source with the provided Dockerfile.

We also provide the Kubernetes manifests under _infra along with a HelmRelease.

Configuration file

You can configure the istio-redirector API Server through the server/config.yaml file. You can find an example under server/config_example.yaml.

Build

Docker

$ cp server/config_example.yaml server/config.yaml
$ docker build . -t istio-redirector
$ docker run istio-redirector

OR without Docker:

Front

$ cd front
$ npm install
$ npm run build
$ npm run export

Go

$ cd server
$ go build
$ istio-redirector help

Commands

$ istio-redirector generate # generate yaml VirtualService from .csv file
$ istio-redirector help # show the istio-redirector help
$ istio-redirector list-vs # show the VirtualService generated with istio-redirector in your current kubectl context
$ istio-redirector web # start the web server

πŸ”§ Pull Request Steps

istio-redirector is open source, if you think your idea can be integrated directly in istio-redirector, please create an issue or a pull request.

Pull Request

Before creating a PR, test and check for any errors. If there are no errors, then commit and push.

For more information, please refer to the Contributing section.

πŸ’¬ Contributing

πŸ“œ License

This software is licensed under the Apache 2.0 Β© BlaBlaCar.

istio-redirector's People

Contributors

blakefaulds avatar dependabot[bot] avatar erwannrobin avatar etifontaine avatar guillaumewuip avatar jbfavre avatar jhaumont avatar kassad38 avatar sebdoido avatar skhedim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

istio-redirector's Issues

"can't evaluate field DestinationService in type istio.Redirections" when testing in docker

Describe the bug

When running istio-redirector in a docker container, clicking on β€žSendβ€œ produces:

{"error":"template: virtual-service.yaml:33:23: executing \"virtual-service.yaml\" at \u003c$.DestinationService\u003e: can't evaluate field DestinationService in type istio.Redirections","level":"error","msg":"fail to execute content to template","time":"2022-07-20T12:27:54Z"}
{"level":"error","msg":"template: virtual-service.yaml:33:23: executing \"virtual-service.yaml\" at \u003c$.DestinationService\u003e: can't evaluate field DestinationService in type istio.Redirections","time":"2022-07-20T12:27:54Z"}

in the server log and an

An error happened server side: Unexpected token e in JSON at position 1

error in the frontend

To Reproduce

  1. Create a config file that binds on all IPs:
cat << EOF > config.yaml
server:
  URL: ":8080" # the address where the API Server will be exposed
  allowedOrigins: # The allowed CORS, in order to let the SPA reach the API
    - "*"

istio: # The name of your Istio IngressGateway in your cluster
  gateways:
    - istio-system/istio-ingressgateway

frontendConfig:
  enableGitHub: false # Display the "Push to GitHub" button on the UI
  availableNamespace: # The namespace where you allow the deployment of the Virtual Services
    - default
  availableCluster: # The name of the cluser in your GitOps repository
    - prod
  availableDestinationSvc: # The Service name where the traffic can be sent after the redirection
    - my_svc.svc

github: # The GitHub configuration to push the Virtual Services to your GitOps repository.
  token: my_secret_token # The GitHub Token used to authenticate
  email: "[email protected]" # The email used for the commits
  owner: example # The GitHub username hosting your GitOps repository
  repo: "istio-redirector" # The name of your GitOps repository
  baseRef: "master" # The branch name used for the checkout
  newBranchPrefix: "new-redirections" # The prefix used the Pull Request name
EOF
  1. Create a CSV with the following content:
/test,410
/hello,410
  1. Start a container
docker run --rm -v $PWD/config.yaml:/config.yaml -p 8080:8080 ghcr.io/blablacar/istio-redirector:v0.0.23
  1. In the browser, open http://localhost:8080
  2. Set the following options:
    1. Redirection type: 4xx
    2. Environment: prod
    3. Namespace: default
    4. Redirection group name: [set anything you want]
    5. Hosts: [set anything you want]
    6. Destination Host: my_svc.svc

Expected behavior

YAML is generated.

Screenshots

image

Desktop (please complete the following information):

  • OS: MacOS Monterey (12.4)
  • Browser: Chorome, Version 103.0.5060.53 (Official Build) (x86_64)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.