client

package
v0.0.0-...-7b7753e Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMapWatcher

type ConfigMapWatcher struct {
	// contains filtered or unexported fields
}

ConfigMapWatcher configmap 资源监控

func NewConfigMapWatcher

func NewConfigMapWatcher(k8sCli kubernetes.Interface, namespace string, name string, config *LazykubeConfig) *ConfigMapWatcher

NewConfigMapWatcher 实例化 configmap 监控

func (*ConfigMapWatcher) Run

func (w *ConfigMapWatcher) Run(ctx context.Context)

Run 运行

func (*ConfigMapWatcher) SyncConfig

func (w *ConfigMapWatcher) SyncConfig() error

SyncConfig 从 configmap 中同步配置

type LazykubeConfig

type LazykubeConfig struct {
	ReplaceStrategies []ReplaceStrategy `yaml:"replaceStrategies"`
}

LazykubeConfig 配置信息

func (*LazykubeConfig) RegisterReplaceStrategy

func (c *LazykubeConfig) RegisterReplaceStrategy(replace string, mode ReplaceMode, to string)

RegisterReplaceStrategy 注册镜像地址替换策略

func (*LazykubeConfig) Replace

func (c *LazykubeConfig) Replace(image string) string

Replace 根据替换策略,替换镜像地址

func (*LazykubeConfig) UpdateConfig

func (c *LazykubeConfig) UpdateConfig(cm *corev1.ConfigMap) error

UpdateConfig 更新替换策略

type ReplaceMode

type ReplaceMode string

ReplaceMode 替换模式

const (
	// PrefixReplace 前缀替换
	PrefixReplace ReplaceMode = "prefix"

	// DefaultReplace dockerhub 替换
	DefaultReplace ReplaceMode = "default"
)

type ReplaceStrategy

type ReplaceStrategy struct {
	Case  string      `yaml:"case"`
	Mode  ReplaceMode `yaml:"mode"`
	Value string      `yaml:"value"`
}

ReplaceStrategy 替换策略

type WebhookServer

type WebhookServer struct {
	// contains filtered or unexported fields
}

WebhookServer 提供接口调用

func NewWebhookServer

func NewWebhookServer(params *WhSvrParameters) (*WebhookServer, error)

NewWebhookServer 新建 webhook server

func (*WebhookServer) Shutdown

func (whsrv *WebhookServer) Shutdown()

Shutdown 终止

func (*WebhookServer) Start

func (whsrv *WebhookServer) Start() error

Start 启动服务

type WhSvrParameters

type WhSvrParameters struct {
	Port     int    // webhook server port
	CertFile string // path to the x509 certificate for https
	KeyFile  string // path to the x509 private key matching `CertFile`
}

WhSvrParameters webhook server parameters

Jump to

Keyboard shortcuts

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