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) 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
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
Click to show internal directories.
Click to hide internal directories.