diff --git a/kubernetes-templates/traefik/0/README.md b/kubernetes-templates/traefik/0/README.md new file mode 100644 index 0000000..aaab41c --- /dev/null +++ b/kubernetes-templates/traefik/0/README.md @@ -0,0 +1,41 @@ +# Traefik load balancer + +### Info: + + This template deploys traefik active load balancer on top of Rancher. It would be deployed in hosts with label **traefik_lb=true**. + +### Config: + +- Replicas: Number of pods to deploy. It should be the same of hosts whith traefik_lb=true +- Kubernetes Namespace = Kubernetes namespace to deploy de repservers lication controller +- Http port = 80 # Port exposed to get access to the published services. +- Https port = 443 # Port exposed to get access to the published services. +- Admin port = 8000 # Port exposed to get admin access to the traefik service. + + +### Service configuration: + +You have to create Ingress objects in order to get included in traefik dynamic config. Example: + +``` +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: foo + namespace: default +spec: + rules: + - host: foo.bar.com + http: + paths: + - backend: + serviceName: foo + servicePort: 8080 +``` + +### Usage: + +- Select Traefik from catalog. +- Review configuration options. +- Click deploy. +- Services with Ingress will be accessed throught hosts whith traefik_lb=true diff --git a/kubernetes-templates/traefik/0/rancher-compose.yml b/kubernetes-templates/traefik/0/rancher-compose.yml new file mode 100644 index 0000000..898ede7 --- /dev/null +++ b/kubernetes-templates/traefik/0/rancher-compose.yml @@ -0,0 +1,38 @@ +.catalog: + name: traefik + version: v1.0.2 + description: | + Traefik load balancer. + minimum_rancher_version: v0.59.0 + maintainer: "German Ramos " + uuid: traefik-0 + questions: + - variable: NAMESPACE + default: default + label: Kubernetes Namespace + required: true + type: string + - variable: REPLICAS + description: Usually match the number of nodes with label traefik_lb=true + default: 1 + label: Replicas + required: true + type: int + - variable: "http_port" + description: "Traefik http public port to listen." + label: "Http port:" + required: true + default: 80 + type: "int" + - variable: "https_port" + description: "Traefik https public port to listen." + label: "Http port:" + required: true + default: 443 + type: "int" + - variable: "admin_port" + description: "Traefik admin public port to listen." + label: "Admin port:" + required: true + default: 8000 + type: "int" diff --git a/kubernetes-templates/traefik/0/traefik-rc.yml b/kubernetes-templates/traefik/0/traefik-rc.yml new file mode 100644 index 0000000..5fb6e69 --- /dev/null +++ b/kubernetes-templates/traefik/0/traefik-rc.yml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + namespace: ${NAMESPACE} + name: traefik-ingress-controller + labels: + k8s-app: traefik-ingress +spec: + replicas: ${REPLICAS} + selector: + k8s-app: traefik-ingress + template: + metadata: + labels: + k8s-app: traefik-ingress + name: traefik-ingress + spec: + terminationGracePeriodSeconds: 60 + containers: + - image: traefik:v1.0.2 + name: traefik-ingress + ports: + - containerPort: 80 + hostPort: ${http_port} + - containerPort: 443 + hostPort: ${https_port} + - containerPort: 8080 + hostPort: ${admin_port} + args: + - --web + - --kubernetes + #- --logLevel=DEBUG + nodeSelector: + traefik_lb: "true" diff --git a/kubernetes-templates/traefik/catalogIcon.svg b/kubernetes-templates/traefik/catalogIcon.svg new file mode 100644 index 0000000..8ee3448 --- /dev/null +++ b/kubernetes-templates/traefik/catalogIcon.svg @@ -0,0 +1,342 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/kubernetes-templates/traefik/config.yml b/kubernetes-templates/traefik/config.yml new file mode 100644 index 0000000..2eebb7d --- /dev/null +++ b/kubernetes-templates/traefik/config.yml @@ -0,0 +1,6 @@ +name: Traefik +description: | + Traefik active load balancer for ingress rules +version: v1.0.2 +category: Load Balancing +maintainer: "German Ramos "