k8sniff

command module
v0.0.0-...-e7435d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2017 License: MIT Imports: 26 Imported by: 0

README

K8SNIff

K8SNIff - tcp ingress controller with SNI support

K8SNIff is a small ingress server that will accept incoming TLS connections and parse TLS Client Hello messages for the SNI Extension. If one is found, we'll go ahead and forward that connection to a Kubernetes service with a matching Ingress resource.

sniff config

The following config will K8SNIff listen on port 8443 and listen on Ingress resources

{
    "bind": {
        "host": "localhost",
        "port": 8443
    },
    "kubernetes": {}
}

The example ingress connect any requests to foo to service foo with port 443 and any requests to bar to service bar with port 443. If nothing matches this, it will send the traffic to the default backend with the service bar on port 443.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: tcp
  annotations:
    kubernetes.io/ingress.class: k8sniff
spec:
  backend:
    serviceName: bar
    servicePort: 443
  rules:
  - host: foo
    http:
      paths:
      - backend:
          serviceName: foo
          servicePort: 443
  - host: bar
    http:
      paths:
      - backend:
          serviceName: bar
          servicePort: 443

The requested domain name are interpreted as regular expressions. Each server and name will be checked in the order they appear in the file, stopping with the first match. If there is no match, then the request is sent to the first server with default backend set.

using the parser

import (
    "fmt"

    " kubermatic/k8sniff/parser"
)

func main() {
    listener, err := net.Listen("tcp", "localhost:2222")
    if err != nil {
        return err
    }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package metrics contains some metrics that could be collected by Prometheus.
Package metrics contains some metrics that could be collected by Prometheus.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL