Coder Social home page Coder Social logo

twingate / kubernetes-operator Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 0.0 943 KB

Twingate Kubernetes Operator allows configuring Twingate using Kubernetes assets - OSS

Home Page: https://www.twingate.com

License: Mozilla Public License 2.0

Dockerfile 0.93% Makefile 1.89% Python 93.17% Smarty 1.34% JavaScript 0.24% Shell 1.15% Go 1.27%
gitops helm kubernetes kubernetes-operator python twingate

kubernetes-operator's People

Contributors

chenbishop avatar dependabot[bot] avatar ekampf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubernetes-operator's Issues

Feature Proposal: Add resources by annotating Service objects

To make services accessible on K8S a Service object is used.
Rather than make user manually create an aditional TwingateResource to expose that service we can do that automatically.

Implementation details

  • To expose a Service as a Twingate Resource, annotate it with twingate.com/expose value "true" (under its metadata.annotations)
  • Operator will listen on annotated services and create a child TwingateResource object with address <service name>.<namespace>.svc.cluster.local

Questions

  • What about other TwingateResource properties like isvisible, isBrowserShortcutEnabled and securityPolicyId ? Maybe the twingate.com/expose should actually be an object...
  • What if you have the same service on multiple clusters? (prod\non prod) they will all get the same resource address...

Feature Proposal: TwingateConnector Object

Allow defining a TwingateConnector that'll

  • Provision a connector via API - get access&refresh tokens
  • Start a pod with said connector
  • Monitor pod and allow auto updating it

This is a basic building block on top of which we could later define an object that creates multiple of these (like a Deployment with replicas prop)

Technical implementation

Proposal for CRD:

apiVersion: twingate.com/v1beta
kind: TwingateConnector
metadata:
  name: my-connector
spec:
  name: My K8S Connector
  imagePolicy:
    schedule: "0 2 * * *"
    version: 0.1.x
  containerExtra:
    resources:
      requests:
        cpu: 314m
        memory: 128Mi
      limits:
        cpu: 500m
        memory: 128Mi
  podExtra: {}

On create operator will:

  1. Provision a connector and get tokens
  2. Create a child Secret and Pod objects
  3. Monitor pod and secret and not allow changing them
  4. Create timers based on imagePolicy.check that will
  5. Check for newer tag on docker hub (based on imagePolicy.version)
  6. Patch the pod's image if a newer tag is detected

feat: TwingateResourceAccess allow specifying principal by name

What is missing?
In order to get principalId developer needs access to Twingate Admin which he, usually doesn't have.

Example:

apiVersion: twingate.com/v1beta
kind: TwingateResourceAccess
metadata:
  name: my-twingate-access
spec:
  resourceRef:
    name: my-twingate-resource
    namespace: default
  principalExternalRef:
    type: Group
    byName: "my group"

feat: Allow costumizing Connector logging level

What is missing?
Ability to customize connector log level.
Right now it is hardcoded to 7 but should be able to override it via the TwingateConnector CRD

Why do we need it?
Not all environments need or want the full extent of logs

Feat: GCP support for Connector imagePolicy

What is missing?
Ability to have a connector image auto-update from a GCP repository (Google Artifact Registry)

Why do we need it?
Certain customers proxy dockerhub through their GCP for security scanning etc.

feat: Allow specifying an apiKey by referencing an existing Secret

What is missing?
values.yaml requires specifying the apiKey directly but for certain customers (dependin on how they manage secrets) it may be better to create the Secret object with the apiKey value themselves and point to it.

** Details **
Extend twingateOperator section in values.yaml to allow either specifying an apiKey value or existingAPIKeySecret:
Example:

twingateOperator:
  network: "acme"
  remoteNetworkId: "123"
  existingAPIKeySecret:
    name: my-secret-object
    key: twingate-api-key

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.