controllers

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 91 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdClientPort  = 2379
	EtcdPeerPort    = 2380
	EtcdMetricsPort = 2381
)
View Source
const (
	EtcdVersion = "v3.4.8"

	ProxyImageRepository = "quay.io/f110/heimdallr-proxy"

	RPCServerImageRepository = "quay.io/f110/heimdallr-rpcserver"
	DashboardImageRepository = "quay.io/f110/heimdallr-dashboard"
)

Variables

View Source
var (
	ErrEtcdClusterIsNotReady = errors.New("EtcdCluster is not ready yet")
	ErrRPCServerIsNotReady   = errors.New("rpc server is not ready")
)

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	tls.Certificate
	// contains filtered or unexported fields
}

func NewCertificate

func NewCertificate(source tls.Certificate) (Certificate, error)

func (*Certificate) MarshalCertificate

func (c *Certificate) MarshalCertificate() []byte

func (*Certificate) ToSecret

func (c *Certificate) ToSecret() *corev1.Secret

type ConfigConverter added in v0.8.0

type ConfigConverter struct {
}

func (ConfigConverter) Proxy added in v0.8.0

func (ConfigConverter) Proxy(backends []*proxyv1alpha2.Backend, serviceLister listers.ServiceLister) ([]byte, error)

func (ConfigConverter) RPCPermission added in v0.8.0

func (ConfigConverter) RPCPermission(permissions []*proxyv1alpha2.RpcPermission) ([]byte, error)

func (ConfigConverter) Role added in v0.8.0

func (ConfigConverter) Role(backends []*proxyv1alpha2.Backend, roleList []*proxyv1alpha2.Role, roleBindings []*proxyv1alpha2.RoleBinding) ([]byte, error)

type CreateSecret

type CreateSecret struct {
	Name   string
	Known  func() bool
	Create func() (*corev1.Secret, error)
}

type EtcdCluster

type EtcdCluster struct {
	*etcdv1alpha2.EtcdCluster

	ClusterDomain string
	// contains filtered or unexported fields
}

func NewEtcdCluster

func NewEtcdCluster(c *etcdv1alpha2.EtcdCluster, clusterDomain string, log *zap.Logger, mockOpt *MockOption) *EtcdCluster

func (*EtcdCluster) AllExistMembers

func (c *EtcdCluster) AllExistMembers() []*corev1.Pod

func (*EtcdCluster) AllMembers

func (c *EtcdCluster) AllMembers() []*EtcdMember

AllMembers returns all members of etcd, regardless of status

func (*EtcdCluster) CA

func (c *EtcdCluster) CA(s *corev1.Secret) (*corev1.Secret, error)

func (*EtcdCluster) CASecretName

func (c *EtcdCluster) CASecretName() string

func (*EtcdCluster) Client

func (c *EtcdCluster) Client(endpoints []string) (*clientv3.Client, error)

func (*EtcdCluster) ClientCertSecret

func (c *EtcdCluster) ClientCertSecret(ca *corev1.Secret) (*corev1.Secret, error)

func (*EtcdCluster) ClientCertSecretName

func (c *EtcdCluster) ClientCertSecretName() string

func (*EtcdCluster) ClientService

func (c *EtcdCluster) ClientService() *corev1.Service

func (*EtcdCluster) ClientServiceName

func (c *EtcdCluster) ClientServiceName() string

func (*EtcdCluster) CurrentInternalState

func (c *EtcdCluster) CurrentInternalState() InternalState

func (*EtcdCluster) CurrentPhase

func (c *EtcdCluster) CurrentPhase() etcdv1alpha2.EtcdClusterPhase

func (*EtcdCluster) DNSNames

func (c *EtcdCluster) DNSNames() []string

func (*EtcdCluster) DefragmentCronJob

func (c *EtcdCluster) DefragmentCronJob() *batchv1beta1.CronJob

func (*EtcdCluster) DefragmentCronJobName

func (c *EtcdCluster) DefragmentCronJobName() string

func (*EtcdCluster) DiscoveryService

func (c *EtcdCluster) DiscoveryService() *corev1.Service

func (*EtcdCluster) EtcdRole added in v0.12.0

func (c *EtcdCluster) EtcdRole() *rbacv1.Role

func (*EtcdCluster) EtcdRoleBinding added in v0.12.0

func (c *EtcdCluster) EtcdRoleBinding() *rbacv1.RoleBinding

func (*EtcdCluster) EtcdVersion added in v0.11.0

func (c *EtcdCluster) EtcdVersion() string

func (*EtcdCluster) GetMetrics

func (c *EtcdCluster) GetMetrics(addr string) ([]*dto.MetricFamily, error)

func (*EtcdCluster) GetOwnedPods added in v0.11.0

func (c *EtcdCluster) GetOwnedPods(podLister listers.PodLister, pvcLister listers.PersistentVolumeClaimLister) error

func (*EtcdCluster) HasTemporaryMember added in v0.9.0

func (c *EtcdCluster) HasTemporaryMember() bool

func (*EtcdCluster) InjectRestoreContainer added in v0.11.0

func (c *EtcdCluster) InjectRestoreContainer(pod *corev1.Pod)

func (*EtcdCluster) IsPodReady

func (c *EtcdCluster) IsPodReady(pod *corev1.Pod) bool

func (*EtcdCluster) NeedRepair

func (c *EtcdCluster) NeedRepair(pod *corev1.Pod) bool

func (*EtcdCluster) PermanentMembers

func (c *EtcdCluster) PermanentMembers() []*corev1.Pod

func (*EtcdCluster) ServerCert

func (c *EtcdCluster) ServerCert(ca *corev1.Secret) (Certificate, error)

func (*EtcdCluster) ServerCertSecret

func (c *EtcdCluster) ServerCertSecret(ca *corev1.Secret) (*corev1.Secret, error)

func (*EtcdCluster) ServerCertSecretName

func (c *EtcdCluster) ServerCertSecretName() string

func (*EtcdCluster) ServerDiscoveryServiceName

func (c *EtcdCluster) ServerDiscoveryServiceName() string

func (*EtcdCluster) ServiceAccount added in v0.12.0

func (c *EtcdCluster) ServiceAccount() *corev1.ServiceAccount

func (*EtcdCluster) ServiceAccountName added in v0.12.0

func (c *EtcdCluster) ServiceAccountName() string

func (*EtcdCluster) SetAnnotationForPod

func (c *EtcdCluster) SetAnnotationForPod(pod *corev1.Pod)

func (*EtcdCluster) SetCASecret

func (c *EtcdCluster) SetCASecret(ca *corev1.Secret)

func (*EtcdCluster) SetOwnedPods

func (c *EtcdCluster) SetOwnedPods(pods []*corev1.Pod)

func (*EtcdCluster) SetServerCertSecret

func (c *EtcdCluster) SetServerCertSecret(cert *corev1.Secret)

func (*EtcdCluster) ShouldUpdate

func (c *EtcdCluster) ShouldUpdate(pod *corev1.Pod) bool

func (*EtcdCluster) ShouldUpdateServerCertificate

func (c *EtcdCluster) ShouldUpdateServerCertificate(certPem []byte) bool

func (*EtcdCluster) TemporaryMember

func (c *EtcdCluster) TemporaryMember() *EtcdMember

type EtcdController

type EtcdController struct {
	*controllerbase.Controller
	// contains filtered or unexported fields
}

func NewEtcdController

func NewEtcdController(
	sharedInformerFactory informers.SharedInformerFactory,
	coreSharedInformerFactory kubeinformers.SharedInformerFactory,
	coreClient kubernetes.Interface,
	client clientset.Interface,
	cfg *rest.Config,
	clusterDomain string,
	runOutsideCluster bool,
	transport http.RoundTripper,
	mockOpt *MockOption,
) (*EtcdController, error)

func (*EtcdController) ConvertToKeys added in v0.10.0

func (*EtcdController) EventSources added in v0.10.0

func (ec *EtcdController) EventSources() []cache.SharedIndexInformer

func (*EtcdController) Finalize added in v0.10.0

func (ec *EtcdController) Finalize(_ context.Context, _ interface{}) error

func (*EtcdController) Finalizers added in v0.10.0

func (ec *EtcdController) Finalizers() []string

func (*EtcdController) GetObject added in v0.10.0

func (ec *EtcdController) GetObject(key string) (interface{}, error)

func (*EtcdController) ListerSynced added in v0.10.0

func (ec *EtcdController) ListerSynced() []cache.InformerSynced

func (*EtcdController) Name added in v0.10.0

func (ec *EtcdController) Name() string

func (*EtcdController) Reconcile added in v0.10.0

func (ec *EtcdController) Reconcile(ctx context.Context, obj interface{}) error

func (*EtcdController) UpdateObject added in v0.10.0

func (ec *EtcdController) UpdateObject(ctx context.Context, obj interface{}) error

type EtcdMember added in v0.11.0

type EtcdMember struct {
	Pod                   *corev1.Pod
	PersistentVolumeClaim *corev1.PersistentVolumeClaim
	// TODO: Remove after v0.12
	OldVersion bool
}

type GitHubController

type GitHubController struct {
	*controllerbase.Controller
	// contains filtered or unexported fields
}

func NewGitHubController

func NewGitHubController(
	sharedInformerFactory informers.SharedInformerFactory,
	coreSharedInformerFactory kubeinformers.SharedInformerFactory,
	coreClient kubernetes.Interface,
	client clientset.Interface,
	transport http.RoundTripper,
) (*GitHubController, error)

func (*GitHubController) ConvertToKeys added in v0.10.0

func (*GitHubController) EventSources added in v0.10.0

func (c *GitHubController) EventSources() []cache.SharedIndexInformer

func (*GitHubController) Finalize added in v0.10.0

func (c *GitHubController) Finalize(ctx context.Context, obj interface{}) error

func (*GitHubController) Finalizers added in v0.10.0

func (c *GitHubController) Finalizers() []string

func (*GitHubController) GetObject added in v0.10.0

func (c *GitHubController) GetObject(key string) (interface{}, error)

func (*GitHubController) ListerSynced added in v0.10.0

func (c *GitHubController) ListerSynced() []cache.InformerSynced

func (*GitHubController) Name added in v0.10.0

func (c *GitHubController) Name() string

func (*GitHubController) Reconcile added in v0.10.0

func (c *GitHubController) Reconcile(ctx context.Context, obj interface{}) error

func (*GitHubController) UpdateObject added in v0.10.0

func (c *GitHubController) UpdateObject(ctx context.Context, obj interface{}) error

type HeimdallrProxy

type HeimdallrProxy struct {
	Name                string
	Namespace           string
	Object              *proxyv1alpha2.Proxy
	Spec                proxyv1alpha2.ProxySpec
	Datastore           *etcdv1alpha2.EtcdCluster
	CASecret            *corev1.Secret
	SigningPrivateKey   *corev1.Secret
	GithubWebhookSecret *corev1.Secret
	CookieSecret        *corev1.Secret
	InternalTokenSecret *corev1.Secret

	RPCServer       *process
	ProxyServer     *process
	DashboardServer *process
	// contains filtered or unexported fields
}

func NewHeimdallrProxy

func NewHeimdallrProxy(opt HeimdallrProxyParams) *HeimdallrProxy

func (*HeimdallrProxy) Backends

func (r *HeimdallrProxy) Backends() []*proxyv1alpha2.Backend

func (*HeimdallrProxy) CASecretName

func (r *HeimdallrProxy) CASecretName() string

func (*HeimdallrProxy) Certificate

func (r *HeimdallrProxy) Certificate() runtime.Object

func (*HeimdallrProxy) CertificateSecretName

func (r *HeimdallrProxy) CertificateSecretName() string

func (*HeimdallrProxy) ConfigForDashboard

func (r *HeimdallrProxy) ConfigForDashboard() (*corev1.ConfigMap, error)

func (*HeimdallrProxy) ConfigForMain

func (r *HeimdallrProxy) ConfigForMain() (*corev1.ConfigMap, error)

func (*HeimdallrProxy) ConfigForRPCServer

func (r *HeimdallrProxy) ConfigForRPCServer() (*corev1.ConfigMap, error)

func (*HeimdallrProxy) ConfigNameForDashboard

func (r *HeimdallrProxy) ConfigNameForDashboard() string

func (*HeimdallrProxy) ConfigNameForMain

func (r *HeimdallrProxy) ConfigNameForMain() string

func (*HeimdallrProxy) ConfigNameForRPCServer

func (r *HeimdallrProxy) ConfigNameForRPCServer() string

func (*HeimdallrProxy) ControlObject

func (r *HeimdallrProxy) ControlObject(obj metav1.Object)

func (*HeimdallrProxy) CookieSecretName

func (r *HeimdallrProxy) CookieSecretName() string

func (*HeimdallrProxy) DeploymentNameForDashboard

func (r *HeimdallrProxy) DeploymentNameForDashboard() string

func (*HeimdallrProxy) DeploymentNameForMain

func (r *HeimdallrProxy) DeploymentNameForMain() string

func (*HeimdallrProxy) DeploymentNameForRPCServer

func (r *HeimdallrProxy) DeploymentNameForRPCServer() string

func (*HeimdallrProxy) EtcdCluster

func (*HeimdallrProxy) EtcdClusterName

func (r *HeimdallrProxy) EtcdClusterName() string

func (*HeimdallrProxy) EtcdHost

func (r *HeimdallrProxy) EtcdHost() string

func (*HeimdallrProxy) GithubSecretName

func (r *HeimdallrProxy) GithubSecretName() string

func (*HeimdallrProxy) IdealDashboard

func (r *HeimdallrProxy) IdealDashboard() (*process, error)

func (*HeimdallrProxy) IdealProxyProcess

func (r *HeimdallrProxy) IdealProxyProcess() (*process, error)

func (*HeimdallrProxy) IdealRPCServer

func (r *HeimdallrProxy) IdealRPCServer() (*process, error)

func (*HeimdallrProxy) InternalTokenSecretName

func (r *HeimdallrProxy) InternalTokenSecretName() string

func (*HeimdallrProxy) LabelsForDashboard

func (r *HeimdallrProxy) LabelsForDashboard() map[string]string

func (*HeimdallrProxy) LabelsForDefragmentJob

func (r *HeimdallrProxy) LabelsForDefragmentJob() map[string]string

func (*HeimdallrProxy) LabelsForMain

func (r *HeimdallrProxy) LabelsForMain() map[string]string

func (*HeimdallrProxy) LabelsForRPCServer

func (r *HeimdallrProxy) LabelsForRPCServer() map[string]string

func (*HeimdallrProxy) NewCA

func (r *HeimdallrProxy) NewCA() (*corev1.Secret, error)

func (*HeimdallrProxy) NewCookieSecret

func (r *HeimdallrProxy) NewCookieSecret() (*corev1.Secret, error)

func (*HeimdallrProxy) NewGithubSecret

func (r *HeimdallrProxy) NewGithubSecret() (*corev1.Secret, error)

func (*HeimdallrProxy) NewInternalTokenSecret

func (r *HeimdallrProxy) NewInternalTokenSecret() (*corev1.Secret, error)

func (*HeimdallrProxy) NewSigningPrivateKey

func (r *HeimdallrProxy) NewSigningPrivateKey() (*corev1.Secret, error)

func (*HeimdallrProxy) PodDisruptionBudgetNameForDashboard

func (r *HeimdallrProxy) PodDisruptionBudgetNameForDashboard() string

func (*HeimdallrProxy) PodDisruptionBudgetNameForMain

func (r *HeimdallrProxy) PodDisruptionBudgetNameForMain() string

func (*HeimdallrProxy) PodDisruptionBudgetNameForRPCServer

func (r *HeimdallrProxy) PodDisruptionBudgetNameForRPCServer() string

func (*HeimdallrProxy) PrivateKeySecretName

func (r *HeimdallrProxy) PrivateKeySecretName() string

func (*HeimdallrProxy) ReverseProxyConfig

func (r *HeimdallrProxy) ReverseProxyConfig() (*corev1.ConfigMap, error)

func (*HeimdallrProxy) ReverseProxyConfigName

func (r *HeimdallrProxy) ReverseProxyConfigName() string

func (*HeimdallrProxy) RoleBindings added in v0.8.0

func (r *HeimdallrProxy) RoleBindings() []*proxyv1alpha2.RoleBinding

func (*HeimdallrProxy) Roles

func (r *HeimdallrProxy) Roles() []*proxyv1alpha2.Role

func (*HeimdallrProxy) RpcPermissions

func (r *HeimdallrProxy) RpcPermissions() []*proxyv1alpha2.RpcPermission

func (*HeimdallrProxy) Secrets

func (r *HeimdallrProxy) Secrets() []CreateSecret

func (*HeimdallrProxy) ServiceNameForDashboard

func (r *HeimdallrProxy) ServiceNameForDashboard() string

func (*HeimdallrProxy) ServiceNameForInternalApi

func (r *HeimdallrProxy) ServiceNameForInternalApi() string

func (*HeimdallrProxy) ServiceNameForMain

func (r *HeimdallrProxy) ServiceNameForMain() string

func (*HeimdallrProxy) ServiceNameForRPCServer

func (r *HeimdallrProxy) ServiceNameForRPCServer() string

func (*HeimdallrProxy) Version

func (r *HeimdallrProxy) Version() string

type HeimdallrProxyParams added in v0.7.0

type HeimdallrProxyParams struct {
	Spec               *proxyv1alpha2.Proxy
	Clientset          clientset.Interface
	ServiceLister      listers.ServiceLister
	Backends           []*proxyv1alpha2.Backend
	Roles              []*proxyv1alpha2.Role
	RpcPermissions     []*proxyv1alpha2.RpcPermission
	RoleBindings       []*proxyv1alpha2.RoleBinding
	CertManagerVersion string
}

type IngressController added in v0.10.0

type IngressController struct {
	*controllerbase.Controller
	// contains filtered or unexported fields
}

func NewIngressController added in v0.10.0

func NewIngressController(
	coreSharedInformerFactory coreInformers.SharedInformerFactory,
	sharedInformerFactory informers.SharedInformerFactory,
	coreClient kubernetes.Interface,
	client clientset.Interface,
) *IngressController

func (*IngressController) ConvertToKeys added in v0.10.0

func (*IngressController) EventSources added in v0.10.0

func (ic *IngressController) EventSources() []cache.SharedIndexInformer

func (*IngressController) Finalize added in v0.10.0

func (ic *IngressController) Finalize(ctx context.Context, obj interface{}) error

func (*IngressController) Finalizers added in v0.10.0

func (ic *IngressController) Finalizers() []string

func (*IngressController) GetObject added in v0.10.0

func (ic *IngressController) GetObject(key string) (interface{}, error)

func (*IngressController) ListerSynced added in v0.10.0

func (ic *IngressController) ListerSynced() []cache.InformerSynced

func (*IngressController) Name added in v0.10.0

func (ic *IngressController) Name() string

func (*IngressController) Reconcile added in v0.10.0

func (ic *IngressController) Reconcile(ctx context.Context, obj interface{}) error

func (*IngressController) UpdateObject added in v0.10.0

func (ic *IngressController) UpdateObject(ctx context.Context, obj interface{}) error

type InternalState

type InternalState string
const (
	InternalStateCreatingFirstMember InternalState = "creatingFirstNode"
	InternalStateCreatingMembers     InternalState = "creatingMembers"
	InternalStateRepair              InternalState = "repair"
	InternalStateRestore             InternalState = "restore"
	InternalStatePreparingUpdate     InternalState = "preparingUpdate"
	InternalStateUpdatingMember      InternalState = "updatingMember"
	InternalStateTeardownUpdating    InternalState = "teardownUpdating"
	InternalStateRunning             InternalState = "running"
)

type MockOption

type MockOption struct {
	Cluster     clientv3.Cluster
	Maintenance clientv3.Maintenance
}

type Probe added in v0.8.0

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

func NewProbe added in v0.8.0

func NewProbe(addr string) *Probe

func (*Probe) Ready added in v0.8.0

func (p *Probe) Ready()

func (*Probe) ServeHTTP added in v0.8.0

func (p *Probe) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Probe) Start added in v0.8.0

func (p *Probe) Start() error

type ProxyController

type ProxyController struct {
	*controllerbase.Controller
	// contains filtered or unexported fields
}

func NewProxyController

func NewProxyController(
	sharedInformerFactory informers.SharedInformerFactory,
	coreSharedInformerFactory kubeinformers.SharedInformerFactory,
	client kubernetes.Interface,
	proxyClient clientset.Interface,
) (*ProxyController, error)

func (*ProxyController) ConvertToKeys added in v0.10.0

func (*ProxyController) EventSources added in v0.10.0

func (c *ProxyController) EventSources() []cache.SharedIndexInformer

func (*ProxyController) Finalize added in v0.10.0

func (c *ProxyController) Finalize(_ context.Context, _ interface{}) error

func (*ProxyController) Finalizers added in v0.10.0

func (c *ProxyController) Finalizers() []string

func (*ProxyController) GetObject added in v0.10.0

func (c *ProxyController) GetObject(key string) (interface{}, error)

func (*ProxyController) ListerSynced added in v0.10.0

func (c *ProxyController) ListerSynced() []cache.InformerSynced

func (*ProxyController) Name added in v0.10.0

func (c *ProxyController) Name() string

func (*ProxyController) Reconcile added in v0.10.0

func (c *ProxyController) Reconcile(ctx context.Context, obj interface{}) error

func (*ProxyController) UpdateObject added in v0.10.0

func (c *ProxyController) UpdateObject(ctx context.Context, obj interface{}) error

type RoleBindings added in v0.7.0

type RoleBindings []*proxyv1alpha2.RoleBinding

func (RoleBindings) Select added in v0.7.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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