auto-secret-replication

command module
v0.0.0-...-300f0fa Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

auto-secret-replication

automatically replicate secrets to all namespaces, useful for tls certificates or docker registries

自动从某个命名空间作为来源,复制指定密文到所有的命名空间

使用方法

  1. 创建 autoops 命名空间

  2. 部署以下资源

apiVersion: v1
kind: ServiceAccount
metadata:
  name: auto-secret-replication
  namespace: autoops
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: auto-secret-replication
rules:
  - apiGroups: [""]
    resources: ["namespaces"]
    verbs: ["watch"]
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "watch", "create", "update", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: auto-secret-replication
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: auto-secret-replication
subjects:
  - kind: ServiceAccount
    name: auto-secret-replication
    namespace: autoops
---
apiVersion: v1
kind: Service
metadata:
  name: auto-secret-replication
  namespace: autoops
spec:
  ports:
    - port: 42
      name: life
  clusterIP: None
  selector:
    app: auto-secret-replication
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: auto-secret-replication
  namespace: autoops
spec:
  selector:
    matchLabels:
      app: auto-secret-replication
  serviceName: auto-secret-replication
  replicas: 1
  template:
    metadata:
      labels:
        app: auto-secret-replication
    spec:
      serviceAccount: auto-secret-replication
      containers:
        - name: auto-secret-replication
          image: guoyk/auto-secret-replication
          imagePullPolicy: Always
          env:
            - name: SOURCE_NAMESPACE
              value: autoops
  1. 在 autoops 命名空间部署需要复制的密文,并添加以下注解
net.guoyk.auto-secret-replication/enabled: "true"

如果允许覆盖已经存在的密文,追加以下注解

net.guoyk.auto-secret-replication/overwrite: "true"

许可证

Guo Y.K., MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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