All Projects → jjcollinge → traefik-on-service-fabric

jjcollinge / traefik-on-service-fabric

Licence: MIT License
Azure Service Fabric now has support for Traefik!

Programming Languages

powershell
5483 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to traefik-on-service-fabric

ServiceFabric-Remoting-CustomHeaders
This package allows injecting custom message headers into remoting messages (Actors and Reliable Services, V2 remoting only) at runtime. The headers are available client side to read. It also provides message interception using BeforeHandleRequestResponseAsync and AfterHandleRequestResponseAsync to act on remoting events.
Stars: ✭ 12 (-76.47%)
Mutual labels:  azure-service-fabric, service-fabric
swarm-router
Scalable stateless «zero config» service-name ingress for docker swarm mode with a fresh more secure approach
Stars: ✭ 58 (+13.73%)
Mutual labels:  reverse-proxy, ingress-controller
microservices
Education & lessons learned from the field. Mainly focusing on AKS and Containers.
Stars: ✭ 16 (-68.63%)
Mutual labels:  service-fabric
mps
MPS is a high-performance HTTP(S) proxy library that supports forward proxies, reverse proxies, man-in-the-middle proxies, tunnel proxies, Websocket proxies. MPS 是一个高性能HTTP(s)中间代理库,它支持正向代理、反向代理、中间人代理、隧道代理、Websocket代理
Stars: ✭ 64 (+25.49%)
Mutual labels:  reverse-proxy
composer-velocita
Velocita - Composer plugin for transparent caching
Stars: ✭ 26 (-49.02%)
Mutual labels:  reverse-proxy
pawxi
Dead simple reverse proxy for all your containerized needss
Stars: ✭ 14 (-72.55%)
Mutual labels:  reverse-proxy
go-reverse-proxy
Reverse proxy with simple routing configuration and override behaviour
Stars: ✭ 21 (-58.82%)
Mutual labels:  reverse-proxy
web-proxy
⛺️ A reverse proxy for web site based on Tornado
Stars: ✭ 50 (-1.96%)
Mutual labels:  reverse-proxy
kong-map
Kongmap is a free visualization tool which allows you to view and edit configurations of your Kong API Gateway Clusters, including Routes, Services, and Plugins/Policies. The tool is being offered for installation via Docker and Kubernetes at this time.
Stars: ✭ 60 (+17.65%)
Mutual labels:  reverse-proxy
docker-traefik
Dockerized Traefik Reverse Proxy with customizable options
Stars: ✭ 17 (-66.67%)
Mutual labels:  reverse-proxy
FastTunnel
expose a local server to the internet. 高性能跨平台的内网穿透解决方案 远程内网计算机 域名访问内网站点 反向代理内网服务 端口转发 http代理
Stars: ✭ 815 (+1498.04%)
Mutual labels:  reverse-proxy
opennms-drift-kubernetes
OpenNMS Drift Deployment in Kubernetes for testing and learning purposes
Stars: ✭ 15 (-70.59%)
Mutual labels:  ingress-controller
shield
Shield is a role-based cloud-native user management system, identity & access proxy, and authorization server for your applications and API endpoints.
Stars: ✭ 158 (+209.8%)
Mutual labels:  reverse-proxy
gorift
A toolkit for reverse proxy and load balancer
Stars: ✭ 20 (-60.78%)
Mutual labels:  reverse-proxy
reproxy
Simple edge server / reverse proxy
Stars: ✭ 994 (+1849.02%)
Mutual labels:  reverse-proxy
aks-multi-tenant-agic
This sample shows how to use the Application Gateway Ingress Controller in a multi-tenant AKS cluster to expose multiple instances of the same application, one for each tenant.
Stars: ✭ 27 (-47.06%)
Mutual labels:  ingress-controller
json-caching-proxy
Node caching HTTP proxy built on top of express-http-proxy. Persists requests and responses to an in-memory HAR-like data structure based on HAR1.2 . Caches JSON content-type responses by default with the ability to cache an entire site; including content-types describing images. Useful for testing front end code, mocking api, and saving the cac…
Stars: ✭ 31 (-39.22%)
Mutual labels:  reverse-proxy
stackdriver-reverse-proxy
Simple HTTP proxy to automatically traces the incoming requests
Stars: ✭ 41 (-19.61%)
Mutual labels:  reverse-proxy
hyper-reverse-proxy
A simple reverse proxy for use with Hyper and Tokio
Stars: ✭ 94 (+84.31%)
Mutual labels:  reverse-proxy
service-fabric-cli
Service Fabric CLI Tools
Stars: ✭ 50 (-1.96%)
Mutual labels:  azure-service-fabric

NOTICE: The Azure Service Fabric provider for Traefik is maintained at https://github.com/containous/traefik-extra-service-fabric. This repository was created before the work was merged as a way to track issues and document the provider. There is still some useful information, demos and tools in this repository which will continue to exist but we will not be actively maintaining this content. Therefore, if you are having trouble with the provider, please open an issue on the Containous repository or reach out to the Containous team directly on their Slack. If you want to maintain your own fork of this repository please feel free to in line with the LICENSE.


Disclaimer: Azure Service Fabric integration was added to Træfik in version 1.5 - please use this version or later.

Warning: Work is currently underway in Træfik to standardize label names between providers. In future releases labels will change, for example: traefik.expose -> traefik.enable. See PR16 to follow the work.

Running Træfik on Azure Service Fabric

What is Træfik?

Træfik (pronounced like traffic) is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease. It supports several backends (Docker, Swarm mode, Kubernetes, Marathon, Consul, Etcd, Rancher, Amazon ECS, and a lot more) to manage its configuration automatically and dynamically. For more information, visit the Træfik homepage

What is Azure Service Fabric?

Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. For more information, visit the Azure Service Fabric homepage

Why run Træfik on Azure Service Fabric?

Integrating Træfik and Azure Service Fabric allows you to configure much more advanced, yet flexible, ingress routing scenarios for your Service Fabric hosted services and applications. You get all the benefits of using Træfik to configure your routing whilst also getting the benefits of Service Fabric's packaging model.

Deploying Traefik to Azure Service Fabric

Azure Service Fabric supports many different methods of deploying applications. Please select the most appropriate from the list below.

Releases

The Azure Service Fabric integration ships as part of Træfik v1.5 or greater, so for stable builds please use the official Træfik releases page. The releases on this repository are for experimental features that may or may not be included in the upstream Træfik tree at a later date.

Exposing a Azure Service Fabric Application

Træfik uses the concept of labels to configure how services are exposed.

Labels allow you to define additional metadata for your services which Træfik can use to configure itself dynamically.

Adding Service labels

In order to assign labels for your service, you can add Extensions to your service's ServiceManifest.xml. Træfik will select any labels prefixed with traefik. Here is an example of using extensions to add Træfik labels:

<StatelessServiceType ServiceTypeName="WebServiceType">
  <Extensions>
      <Extension Name="Traefik">
        <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
          <Label Key="traefik.frontend.rule.example">PathPrefixStrip: /a/path/to/strip</Label>
          <Label Key="traefik.expose">true</Label>
          <Label Key="traefik.frontend.passHostHeader">true</Label>
        </Labels>
      </Extension>
  </Extensions>
</StatelessServiceType>

Warning: In Træfik v1.6 label names have been standardized between providers. If you are using v1.6 please update the sample as follows: traefik.expose -> traefik.enable. Additionally backends will no longer be created for services which aren't enabled.

Note: The Service Fabric service requires the UriScheme attrbute set in its Endpoint Resource entry in order to be discoverable: Example <Resources> <Endpoints> <Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input" Port="9001" UriScheme="http" /> </Endpoints> </Resources>

Note: Stateless Services and Guest Executables are fully supported with experimental support for Stateful Services. The discussion around more complete support for Stateful Service is ongoing. See Issue 45 to follow the progress.

Dynamically updating Service labels

Once you've deployed your service with some default labels, you may need to change the way Træfik is routing requests without redeploying. You can overwrite and add new labels to a named service using Service Fabric's Property Management API. Træfik will then pick up these new/updated labels and reconfigure itself.

Setting a label dynamically using curl

curl -X PUT \
  'http://localhost:19080/Names/GettingStartedApplication2/WebService/$/GetProperty?api-version=6.0&IncludeValues=true' \
  -d '{
  "PropertyName": "traefik.frontend.rule.default",
  "Value": {
    "Kind": "String",
    "Data": "PathPrefixStrip: /a/path/to/strip"
  },
  "CustomTypeId": "LabelType"
}'

WARNING: The json provided in the body is case sensitive.

Setting a label dynamically using sfctl

It is also possible to use sfctl to operate with properties without make raw HTTP requests.

sfctl property put --name-id "GettingStartedApplication/WebService" --property-name "traefik.frontend.rule.default" --value "{\"Kind\": \"String\",\"Data\": \"PathPrefixStrip: /a/path/to/strip\"}"

The command above is current as of sftcl v4.0.0.

Available Labels

The current list of available labels is documented here. This is subject to change as we expand our capabilities.

Debugging

Both services will output logs to stdout and stderr. To enable these logs uncomment the ConsoleRedirection line in both ServiceManifest.xml files.

    <ExeHost>
        <Program>traefik-appinsights-watchdog.exe</Program>
        <Arguments>--appinsightskey=__YOUKEYHERE__ --watchdogtestserverport=29001 --pollintervalsec=60 --debug=true</Arguments>
        <WorkingFolder>CodePackage</WorkingFolder>
        <!-- <ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" /> -->
    </ExeHost>

Once deployed, logs will be stored in the nodes Service Fabric folder. This will be similar to D:\SvcFab\_App\TraefikType_App1\log but may vary depending on your configuration.

Common Issues

  • Azure Service Fabric Provider not shown in Traefik Dashboard: Check you have correctly configured the certificates and clustermanagementurl
  • No events showing in App Insights for Traefik: Check you have uncommented the default services section and double check your instrumentation key is correct

Custom Templates

For advanced users only

If the default configuration the Azure Service Fabric Træfik provider builds is not sufficient for your needs, you can write a custom template that the provider will use instead. Documentation on how to write a custom template is available here. Your custom template will need to be added to either your application's Code or Config folders and the relative URL provided in the traefik.toml configuration. The functions available for you to use in your custom template are documented here.

How does Træfik on Azure Service Fabric work?

Træfik is hosted as a Azure Service Fabric Guest Executable. Træfik has a built-in Azure Service Fabric provider which will query the Service Fabric management API to discover what services are currently being hosted in the cluster (referred to as backends). The provider then maps routing rules (known as frontends) to these service instances (referred to as backends). Ingress flows in via entrypoints (http, https, etc.), frontends are then applied to match and modify each requests before load balancing across the associated backends. The provider will take into account the Health and Status of each of the services to ensure requests are only routed to healthy service instances.

To learn more about how Træfik works and how you can configure is, please see their documentation.

Updating Traefik

If you would like to update the Træfik binary, certs or traefik.toml file. You can use Azure Service Fabric's built in 'rolling updates' as you would with any other application package.

Multi-Environment support and automated management of certificates

One of the issues that comes up during the setup is the need to package and deploy certificates along with Træfik. This can prove difficult if

  1. You have your applications getting deployed to multiple environments using different certificates
  2. Your build system does not have access to certificates

To solve these issues easily you can use PreConfiguratorForTraefikOnServiceFabric to automate fetching of certificates from LocalMachine or KeyVault and process them for Træfik to use. This eliminates the need to package any certificate along with Træfik.

Contributing

See our Contributing guide

Related Repositories

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].