• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Synator Kubernetes Secret and ConfigMap synchronizer

Synator Kubernetes Secret and ConfigMap synchronizer

Sometimes we want to use secrets in different namespaces, unfortunately, we can’t do without any helper operators or manual copying because in kubernetes secrets and configmaps are namespace. We can copy secrets and configmaps when we have a couple of namespaces and secrets. But when we have dozens of namespaces, it can be very complicated.

Synator uses kopf python framework. Its easy to use.

Medium writeup

Deployment

It’s easy to use synator on K8s. All we have to do is deploy deploy.yml to Kubernetes.

Usage

Add annotation synator/sync=yes to Secret or ConfigMap. secret.yaml

Optionally add one of these annotations in include specific destination namespaces, or exclude the namespaces from the sync.

For only sync in this namespaces: synator/include-namespaces='namespace1,namespace2'

Sync all namespaces excludes this namespaces: synator/exclude-namespaces='kube-system,kube-node-lease'

secret.yaml

Reload pod when config upgraded

Add annotation synator/reload: "secret:example" to pod or deployment template When secret example updated busybox pod will reload

Note: For multiple secrte or configmap: synator/reload: "secret:example,secret:example2,configmap:example..."

apiVersion: apps/v1
kind: Deployment
metadata:
  name: busybox
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      name: busybox
  template:
    metadata:
      labels:
        name: busybox
      annotations:
        synator/reload: "secret:selam"
    spec:
      containers:
        - name: busybox
          image: busybox
          command:
            - "sleep"
            - "1h"

Triggers

  • When update config or secret
  • When create config or secret

Watching Namespaces

synator Operator installs with cluster wide permissions, however you can optionally control which namespaces it watches by by setting the WATCH_NAMESPACE environment variable.

WATCH_NAMESPACE can be omitted entirely, or a comma separated list of k8s namespaces.

  • WATCH_NAMESPACE="" will watch for resources across the entire cluster.
  • WATCH_NAMESPACE="foo" will watch for resources in the foo namespace.
  • WATCH_NAMESPACE="foo,bar" will watch for resources in the foo and bar namespace.

Build and deploy

Build docker image

docker build -t <usename>/synator:v1 .

Edit deploy.yml with your image name

kubectl apply -f deploy.yml

More Repositories

1

git-switcher

Switch between your git profiles easily
Go
217
star
2

leaked-password

Leaked password check library with bloom filter
Go
42
star
3

tfa

tfa is a 2fa cli tool that aims to help you to generate 2fa code on CI/CD pipelines.
Go
28
star
4

logger

Kubernetes logs to MongoDB
JavaScript
16
star
5

telegram-gitlab

Telegram bot that sends messages about your Gitlab CI job status
Go
13
star
6

anyscript

Any Time Any Type Any Script
TypeScript
6
star
7

kubepwd

Kubernetes port forwarder in simple cli
Go
6
star
8

soru-say

Vue.js tabanli Soru sayma projesi
Vue
5
star
9

webhook-updater

Go
4
star
10

golactic

Ligthweight go microservice boilerplate
Go
4
star
11

devkit

TheYkk's development environment
Shell
4
star
12

star

Go
3
star
13

Arduino_RGB_BL

Arduino RGB manage with bluetooth
C++
3
star
14

k8s-checklist

K8S knowledge checklist
3
star
15

argo-workflow-webhook

Bitbucket argo workflow webhook
Go
2
star
16

givemedocker

Go
2
star
17

api-boil-js

JavaScript
2
star
18

2fa-go

Go
1
star
19

htpasswd

Simple htpasswd generator docker image
Dockerfile
1
star
20

go-fumpter

Go
1
star
21

path

1
star
22

doviz

JavaScript
1
star
23

private-container

Go
1
star
24

gkey

Gkey A simple vaultless password manager in Go
Go
1
star
25

con-version

Generate next semantic version from commit messages
Go
1
star
26

config

Php configleri yonetmek icin yazilmis class
PHP
1
star
27

data-structures

Go
1
star
28

rs-whois

Rust
1
star
29

kaan-bot

Kaan bot is github bot
Go
1
star
30

node-example-docker

JavaScript
1
star
31

logwatcher

Rust
1
star
32

traefik-whoami

Example docker-compose project to run traefik + whoami with ssl certificate easily
1
star
33

docker-ubuntu

Dockerfile
1
star