Documentation
¶
Index ¶
- Constants
- func CollectPods(ctx context.Context, namespace string, matchLabels map[string]string, ...) (map[string]v1.Pod, error)
- func ConvertError(err error) error
- func ConvertErrorWithContext(err error, format string, args ...interface{}) error
- func FromFile(act action, path string) ([]byte, error)
- func FromStdIn(act action, data string) ([]byte, error)
- func GenerateConfigMap(name string, namespace string, fromFile []string, fromLiteral []string) (*v1.ConfigMap, error)
- func KubeCommand(args ...string) *exec.Cmd
- func LabelNode(name string, label string) ([]byte, error)
- func Namespace(namespace string) string
- func ParseAPIService(r io.Reader) (*apiregistrationv1.APIService, error)
- func ParseAlertmanager(r io.Reader) (*monitoringv1.Alertmanager, error)
- func ParseClusterRole(r io.Reader) (*rbacv1.ClusterRole, error)
- func ParseClusterRoleBinding(r io.Reader) (*rbacv1.ClusterRoleBinding, error)
- func ParseConfigMap(r io.Reader) (*v1.ConfigMap, error)
- func ParseCustomResourceDefinition(r io.Reader) (*extensionsv1.CustomResourceDefinition, error)
- func ParseDaemonSet(r io.Reader) (*appsv1.DaemonSet, error)
- func ParseDeployment(r io.Reader) (*appsv1.Deployment, error)
- func ParseJob(r io.Reader) (*batchv1.Job, error)
- func ParseMutatingWebhookConfiguration(r io.Reader) (*admissionregistrationv1.MutatingWebhookConfiguration, error)
- func ParseNamespace(r io.Reader) (*v1.Namespace, error)
- func ParsePodSecurityPolicy(r io.Reader) (*v1beta1.PodSecurityPolicy, error)
- func ParsePriorityClass(r io.Reader) (*schedulingv1beta1.PriorityClass, error)
- func ParsePrometheus(r io.Reader) (*monitoringv1.Prometheus, error)
- func ParsePrometheusRule(r io.Reader) (*monitoringv1.PrometheusRule, error)
- func ParseReplicationController(r io.Reader) (*v1.ReplicationController, error)
- func ParseRole(r io.Reader) (*rbacv1.Role, error)
- func ParseRoleBinding(r io.Reader) (*rbacv1.RoleBinding, error)
- func ParseSecret(r io.Reader) (*v1.Secret, error)
- func ParseService(r io.Reader) (*v1.Service, error)
- func ParseServiceAccount(r io.Reader) (*v1.ServiceAccount, error)
- func ParseServiceMonitor(r io.Reader) (*monitoringv1.ServiceMonitor, error)
- func ParseShortcut(in, defaultVal string) (string, error)
- func ParseStatefulSet(r io.Reader) (*appsv1.StatefulSet, error)
- func ParseValidatingWebhookConfiguration(r io.Reader) (*admissionregistrationv1.ValidatingWebhookConfiguration, error)
- func PollStatus(ctx context.Context, retryAttempts int, retryPeriod time.Duration, ...) error
- func ScaleReplicationController(name string, replicas int, tries int) error
- func WaitForRCPods(rcName string, desired int, delay time.Duration, tries int) error
- type APIServiceConfig
- type APIServiceControl
- type AlertmanagerConfig
- type AlertmanagerControl
- type Changeset
- func (cs *Changeset) Create(ctx context.Context, namespace, name string) (*ChangesetResource, error)
- func (cs *Changeset) Delete(ctx context.Context, namespace, name string) error
- func (cs *Changeset) DeleteResource(ctx context.Context, changesetNamespace, changesetName string, ...) error
- func (cs *Changeset) Freeze(ctx context.Context, changesetNamespace, changesetName string) error
- func (cs *Changeset) Get(ctx context.Context, namespace, name string) (*ChangesetResource, error)
- func (cs *Changeset) Init(ctx context.Context) error
- func (cs *Changeset) List(ctx context.Context, namespace string) (*ChangesetList, error)
- func (cs *Changeset) Revert(ctx context.Context, changesetNamespace, changesetName string) error
- func (cs *Changeset) Status(ctx context.Context, changesetNamespace, changesetName string, ...) error
- func (cs *Changeset) Upsert(ctx context.Context, changesetNamespace, changesetName string, data []byte) error
- type ChangesetConfig
- type ChangesetItem
- type ChangesetList
- type ChangesetResource
- type ChangesetSpec
- type ClusterRoleBindingConfig
- type ClusterRoleBindingControl
- type ClusterRoleConfig
- type ClusterRoleControl
- type ConfigMapConfig
- type ConfigMapControl
- type CustomResourceDefinitionConfig
- type CustomResourceDefinitionControl
- type DSConfig
- type DSControl
- type DeploymentConfig
- type DeploymentControl
- type Job
- type JobConfig
- type JobControl
- type JobStatus
- type Metadata
- type MutatingWebhookConfigurationConfig
- type MutatingWebhookConfigurationControl
- type NamespaceConfig
- type NamespaceControl
- type Node
- type NodeList
- type OperationInfo
- type Pod
- type PodCondition
- type PodList
- type PodSecurityPolicyConfig
- type PodSecurityPolicyControl
- type PodStatus
- type PriorityClassConfig
- type PriorityClassControl
- type PrometheusConfig
- type PrometheusControl
- type PrometheusRuleConfig
- type PrometheusRuleControl
- type RCConfig
- type RCControl
- type Ref
- type ReplicationController
- type ReplicationControllerStatus
- type ResourceHeader
- type RoleBindingConfig
- type RoleBindingControl
- type RoleConfig
- type RoleControl
- type SecretConfig
- type SecretControl
- type ServiceAccountConfig
- type ServiceAccountControl
- type ServiceConfig
- type ServiceControl
- type ServiceMonitorConfig
- type ServiceMonitorControl
- type StatefulSetConfig
- type StatefulSetControl
- type StatusReporter
- type ValidatingWebhookConfigurationConfig
- type ValidatingWebhookConfigurationControl
Constants ¶
const ( ChangesetResourceName = "changesets.changeset.gravitational.io" ChangesetGroup = "changeset.gravitational.io" ChangesetVersion = "v1" ChangesetCollection = "changesets" ChangesetPlural = "changesets" ChangesetSingular = "changeset" ChangesetScope = "Namespaced" DefaultNamespace = "default" KindDaemonSet = "DaemonSet" KindStatefulSet = "StatefulSet" KindChangeset = "Changeset" KindConfigMap = "ConfigMap" KindDeployment = "Deployment" KindReplicaSet = "ReplicaSet" KindReplicationController = "ReplicationController" KindService = "Service" KindServiceAccount = "ServiceAccount" KindSecret = "Secret" KindJob = "Job" KindRole = "Role" KindClusterRole = "ClusterRole" KindRoleBinding = "RoleBinding" KindClusterRoleBinding = "ClusterRoleBinding" KindPodSecurityPolicy = "PodSecurityPolicy" KindCustomResourceDefinition = "CustomResourceDefinition" KindNamespace = "Namespace" KindPriorityClass = "PriorityClass" KindAPIService = "APIService" KindServiceMonitor = monitoringv1.ServiceMonitorsKind KindAlertmanager = monitoringv1.AlertmanagersKind KindPrometheus = monitoringv1.PrometheusesKind KindPrometheusRule = monitoringv1.PrometheusRuleKind KindValidatingWebhookConfiguration = "ValidatingWebhookConfiguration" KindMutatingWebhookConfiguration = "MutatingWebhookConfiguration" ControllerUIDLabel = "controller-uid" OpStatusCreated = "created" OpStatusCompleted = "completed" OpStatusReverted = "reverted" ChangesetStatusReverted = "reverted" ChangesetStatusInProgress = "in-progress" ChangesetStatusCommitted = "committed" // DefaultRetryAttempts specifies amount of retry attempts for checks DefaultRetryAttempts = 60 // RetryPeriod is a period between Retries DefaultRetryPeriod = time.Second DefaultBufferSize = 1024 ChangesetAPIVersion = "changeset.gravitational.io/v1" // CustomerManagedAnnotation specifies an annotation that a customer can use to take control of a kubernetes object // that is normally managed via gravity/rigging. If rigging sees this annotation on an object, it will no longer // update the object to the current desired state. Insert / Delete operations will still proceed however. This // is mainly so that a customer can take over and customize configuration built into gravity. CustomerManagedAnnotation = "gravitational.io/customer-managed" )
const ( ActionCreate action = "create" ActionDelete action = "delete" ActionReplace action = "replace" ActionApply action = "apply" )
Variables ¶
This section is empty.
Functions ¶
func CollectPods ¶
func CollectPods(ctx context.Context, namespace string, matchLabels map[string]string, logger log.FieldLogger, client *kubernetes.Clientset, fn func(metav1.OwnerReference) bool) (map[string]v1.Pod, error)
CollectPods collects pods matched by fn
func ConvertError ¶
func ConvertErrorWithContext ¶
func FromFile ¶
FromFile performs action on the Kubernetes resources specified in the path supplied as an argument.
func FromStdIn ¶
FromStdin performs action on the Kubernetes resources specified in the string supplied as an argument.
func GenerateConfigMap ¶
func GenerateConfigMap(name string, namespace string, fromFile []string, fromLiteral []string) (*v1.ConfigMap, error)
GenerateConfigMap returns a configMap using the specified parameters.
func KubeCommand ¶
KubeCommand returns an exec.Command for kubectl with the supplied arguments.
func ParseAPIService ¶
func ParseAPIService(r io.Reader) (*apiregistrationv1.APIService, error)
ParseAPIService parses a APIService resource from the provided data
func ParseAlertmanager ¶
func ParseAlertmanager(r io.Reader) (*monitoringv1.Alertmanager, error)
ParseAlertmanager parses a Alertmanager resource from the provided data
func ParseClusterRole ¶
func ParseClusterRole(r io.Reader) (*rbacv1.ClusterRole, error)
ParseClusterRole parses an rbac cluster role from the specified stream
func ParseClusterRoleBinding ¶
func ParseClusterRoleBinding(r io.Reader) (*rbacv1.ClusterRoleBinding, error)
ParseClusterRoleBinding parses an rbac cluster role binding from the specified stream
func ParseConfigMap ¶
ParseConfigMap parses Config Map
func ParseCustomResourceDefinition ¶
func ParseCustomResourceDefinition(r io.Reader) (*extensionsv1.CustomResourceDefinition, error)
ParseCustomResourceDefinition parses a Custom Resource Definition
func ParseDaemonSet ¶
ParseDaemonSet parses daemon set from reader
func ParseDeployment ¶
func ParseDeployment(r io.Reader) (*appsv1.Deployment, error)
ParseDeployment parses deployment
func ParseMutatingWebhookConfiguration ¶
func ParseMutatingWebhookConfiguration(r io.Reader) (*admissionregistrationv1.MutatingWebhookConfiguration, error)
ParseMutatingWebhookConfiguration parses a MutatingWebhookConfiguration resources from the provided data stream.
func ParseNamespace ¶
ParseNamespace parses a namespace object from the specified stream
func ParsePodSecurityPolicy ¶
func ParsePodSecurityPolicy(r io.Reader) (*v1beta1.PodSecurityPolicy, error)
ParsePodSecurityPolicy parses a pod security policy from the specified stream
func ParsePriorityClass ¶
func ParsePriorityClass(r io.Reader) (*schedulingv1beta1.PriorityClass, error)
ParsePriorityClass parses a PriorityClass object from the specified stream
func ParsePrometheus ¶
func ParsePrometheus(r io.Reader) (*monitoringv1.Prometheus, error)
ParsePrometheus parses a Prometheus resource from the provided data
func ParsePrometheusRule ¶
func ParsePrometheusRule(r io.Reader) (*monitoringv1.PrometheusRule, error)
ParsePrometheusRule parses a PrometheusRule resource from the provided data
func ParseReplicationController ¶
func ParseReplicationController(r io.Reader) (*v1.ReplicationController, error)
ParseReplicationController parses replication controller
func ParseRoleBinding ¶
func ParseRoleBinding(r io.Reader) (*rbacv1.RoleBinding, error)
ParseRoleBinding parses an rbac role binding from the specified stream
func ParseSecret ¶
ParseSecret parses a secret from the specified stream
func ParseServiceAccount ¶
func ParseServiceAccount(r io.Reader) (*v1.ServiceAccount, error)
ParseServiceAccount parses a service account from the specified stream
func ParseServiceMonitor ¶
func ParseServiceMonitor(r io.Reader) (*monitoringv1.ServiceMonitor, error)
ParseServiceMonitor parses a ServiceMonitor resource from the provided data
func ParseShortcut ¶
func ParseStatefulSet ¶
func ParseStatefulSet(r io.Reader) (*appsv1.StatefulSet, error)
ParseStatefulSet parses statefulset resource from reader
func ParseValidatingWebhookConfiguration ¶
func ParseValidatingWebhookConfiguration(r io.Reader) (*admissionregistrationv1.ValidatingWebhookConfiguration, error)
ParseValidatingWebhookConfiguration parses a ValidatingWebhookConfiguration resources from the provided data stream.
func PollStatus ¶
func PollStatus(ctx context.Context, retryAttempts int, retryPeriod time.Duration, reporter StatusReporter) error
PollStatus polls status periodically
Types ¶
type APIServiceConfig ¶
type APIServiceConfig struct {
// APIService is the parsed APIService resource
*v1.APIService
// Client is Kube aggregator clientset
Client *apiregistration.Clientset
}
APIServiceConfig is a APIService control configuration
func (*APIServiceConfig) CheckAndSetDefaults ¶
func (c *APIServiceConfig) CheckAndSetDefaults() error
CheckAndSetDefaults validates the config
type APIServiceControl ¶
type APIServiceControl struct {
APIServiceConfig
log.FieldLogger
}
APIServiceControl a controller for APIService resources
func NewAPIServiceControl ¶
func NewAPIServiceControl(config APIServiceConfig) (*APIServiceControl, error)
NewAPIServiceControl returns new instance of APIService updater
type AlertmanagerConfig ¶
type AlertmanagerConfig struct {
// Alertmanager is the parsed Alertmanager resource
*monitoringv1.Alertmanager
// Client is monitoring API client
Client *monitoring.Clientset
}
AlertmanagerConfig is a Alertmanager control configuration
func (*AlertmanagerConfig) CheckAndSetDefaults ¶
func (c *AlertmanagerConfig) CheckAndSetDefaults() error
CheckAndSetDefaults validates the config
type AlertmanagerControl ¶
type AlertmanagerControl struct {
AlertmanagerConfig
log.FieldLogger
}
AlertmanagerControl a controller for Alertmanager resources
func NewAlertmanagerControl ¶
func NewAlertmanagerControl(config AlertmanagerConfig) (*AlertmanagerControl, error)
NewAlertmanagerControl returns new instance of Alertmanager updater
func (*AlertmanagerControl) Delete ¶
func (c *AlertmanagerControl) Delete(ctx context.Context, cascade bool) error
type Changeset ¶
type Changeset struct {
ChangesetConfig
// APIExtensionsClient is a client for the extensions server
APIExtensionsClient *apiextensionsclientset.Clientset
// APIRegistrationClient is Kube aggregator clientset
APIRegistrationClient *apiregistration.Clientset
// MonitoringClient is Prometheus operator client
MonitoringClient *monitoring.Clientset
// contains filtered or unexported fields
}
Changeset is a is a collection changeset log that can revert a series of changes to the system
func NewChangeset ¶
func NewChangeset(ctx context.Context, config ChangesetConfig) (*Changeset, error)
func (*Changeset) Create ¶
func (cs *Changeset) Create(ctx context.Context, namespace, name string) (*ChangesetResource, error)
Create creates a new one given the name and namespace. The new changeset is created with status in-progress. If there's already a changeset with this name in this namespace, AlreadyExists error is returned.
func (*Changeset) DeleteResource ¶
func (cs *Changeset) DeleteResource(ctx context.Context, changesetNamespace, changesetName string, resourceNamespace string, resource Ref, cascade bool) error
DeleteResource deletes a resources in the context of a given changeset
func (*Changeset) Freeze ¶
Freeze "freezes" changeset, prohibits adding or removing any changes to it
type ChangesetConfig ¶
type ChangesetConfig struct {
// Client is k8s client
Client *kubernetes.Clientset
// Config is rest client config
Config *rest.Config
}
func (*ChangesetConfig) CheckAndSetDefaults ¶
func (c *ChangesetConfig) CheckAndSetDefaults() error
type ChangesetItem ¶
type ChangesetList ¶
type ChangesetList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of third party objects
Items []ChangesetResource `json:"items"`
}
func (*ChangesetList) GetObjectKind ¶
func (tr *ChangesetList) GetObjectKind() schema.ObjectKind
type ChangesetResource ¶
type ChangesetResource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ChangesetSpec `json:"spec"`
}
func (*ChangesetResource) GetObjectKind ¶
func (tr *ChangesetResource) GetObjectKind() schema.ObjectKind
func (*ChangesetResource) String ¶
func (tr *ChangesetResource) String() string
type ChangesetSpec ¶
type ChangesetSpec struct {
Status string `json:"status"`
Items []ChangesetItem `json:"items"`
}
type ClusterRoleBindingConfig ¶
type ClusterRoleBindingConfig struct {
// Binding is the existing cluster role binding
*v1.ClusterRoleBinding
// Client is k8s client
Client *kubernetes.Clientset
}
ClusterRoleBindingConfig defines controller configuration
type ClusterRoleBindingControl ¶
type ClusterRoleBindingControl struct {
ClusterRoleBindingConfig
log.FieldLogger
}
ClusterRoleBindingControl is a cluster role bindings controller, adds various operations, like delete, status check and update
func NewClusterRoleBindingControl ¶
func NewClusterRoleBindingControl(config ClusterRoleBindingConfig) (*ClusterRoleBindingControl, error)
NewClusterRoleBindingControl returns a new instance of the ClusterRoleBinding controller
func (*ClusterRoleBindingControl) Delete ¶
func (c *ClusterRoleBindingControl) Delete(ctx context.Context, cascade bool) error
type ClusterRoleConfig ¶
type ClusterRoleConfig struct {
// Role is the existing cluster role
*v1.ClusterRole
// Client is k8s client
Client *kubernetes.Clientset
}
ClusterRoleConfig defines controller configuration
type ClusterRoleControl ¶
type ClusterRoleControl struct {
ClusterRoleConfig
log.FieldLogger
}
ClusterRoleControl is a cluster roles controller, adds various operations, like delete, status check and update
func NewClusterRoleControl ¶
func NewClusterRoleControl(config ClusterRoleConfig) (*ClusterRoleControl, error)
NewClusterRoleControl returns a new instance of the ClusterRole controller
type ConfigMapConfig ¶
type ConfigMapConfig struct {
// ConfigMap is already parsed daemon set, will be used if present
*v1.ConfigMap
// Client is k8s client
Client *kubernetes.Clientset
}
ConfigMapConfig is a ConfigMap control configuration
type ConfigMapControl ¶
type ConfigMapControl struct {
ConfigMapConfig
*log.Entry
}
ConfigMapControl is a daemon set controller, adds various operations, like delete, status check and update
func NewConfigMapControl ¶
func NewConfigMapControl(config ConfigMapConfig) (*ConfigMapControl, error)
NewConfigMapControl returns new instance of ConfigMap updater
type CustomResourceDefinitionConfig ¶
type CustomResourceDefinitionConfig struct {
// CustomResourceDefinition is already parsed daemon set, will be used if present
*apiextensions.CustomResourceDefinition
// Client is k8s client
Client *apiextensionsclientset.Clientset
}
CustomResourceDefinitionConfig is a CustomResourceDefinition control configuration
type CustomResourceDefinitionControl ¶
type CustomResourceDefinitionControl struct {
CustomResourceDefinitionConfig
*log.Entry
}
CustomResourceDefinitionControl is a daemon set controller, adds various operations, like delete, status check and update
func NewCustomResourceDefinitionControl ¶
func NewCustomResourceDefinitionControl( config CustomResourceDefinitionConfig) (*CustomResourceDefinitionControl, error)
NewCustomResourceDefinitionControl returns new instance of CustomResourceDefinition updater
func (*CustomResourceDefinitionControl) Delete ¶
func (c *CustomResourceDefinitionControl) Delete(ctx context.Context, cascade bool) error
type DSConfig ¶
type DSConfig struct {
// DaemonSet specifies the existing resource
*appsv1.DaemonSet
// Client is k8s client
Client *kubernetes.Clientset
}
DSConfig is a DaemonSet control configuration
type DSControl ¶
type DSControl struct {
DSConfig
log.FieldLogger
}
DSControl is a daemon set controller, adds various operations, like delete, status check and update
func NewDaemonSetControl ¶
NewDaemonSetControl returns new instance of DaemonSet controller
type DeploymentConfig ¶
type DeploymentConfig struct {
// Deployment specifies the existing deployment
*appsv1.Deployment
// Client is k8s client
Client *kubernetes.Clientset
}
DeploymentConfig is a Deployment control configuration
type DeploymentControl ¶
type DeploymentControl struct {
DeploymentConfig
log.FieldLogger
}
DeploymentControl is a deployment controller, adds various operations, like delete, status check and update
func NewDeploymentControl ¶
func NewDeploymentControl(config DeploymentConfig) (*DeploymentControl, error)
NewDeploymentControl returns new instance of Deployment updater
type JobControl ¶
type JobControl struct {
JobConfig
log.FieldLogger
}
func NewJobControl ¶
func NewJobControl(config JobConfig) (*JobControl, error)
type MutatingWebhookConfigurationConfig ¶
type MutatingWebhookConfigurationConfig struct {
*admissionregistrationv1.MutatingWebhookConfiguration
Client *kubernetes.Clientset
}
MutatingWebhookConfigurationConfig is the control configuration.
func (*MutatingWebhookConfigurationConfig) CheckAndSetDefaults ¶
func (c *MutatingWebhookConfigurationConfig) CheckAndSetDefaults() error
CheckAndSetDefauls validates the config and sets defaults.
type MutatingWebhookConfigurationControl ¶
type MutatingWebhookConfigurationControl struct {
MutatingWebhookConfigurationConfig
log.FieldLogger
}
MutatingWebhookConfigurationControl is the control service for MutatingWebhookConfiguration resources.
func NewMutatingWebhookConfigurationControl ¶
func NewMutatingWebhookConfigurationControl(config MutatingWebhookConfigurationConfig) (*MutatingWebhookConfigurationControl, error)
NewMutatingWebhookConfigurationControl creates control service for MutatingWebhookConfiguration resouces.
func (*MutatingWebhookConfigurationControl) Delete ¶
func (c *MutatingWebhookConfigurationControl) Delete(ctx context.Context, cascade bool) error
Delete deletes the resource.
type NamespaceConfig ¶
type NamespaceConfig struct {
// Namespace is already parsed daemon set, will be used if present
*v1.Namespace
// Client is k8s client
Client *kubernetes.Clientset
}
NamespaceConfig is a Namespace control configuration
type NamespaceControl ¶
type NamespaceControl struct {
NamespaceConfig
*log.Entry
}
NamespaceControl is a daemon set controller, adds various operations, like delete, status check and update
func NewNamespaceControl ¶
func NewNamespaceControl( config NamespaceConfig) (*NamespaceControl, error)
NewNamespaceControl returns new instance of Namespace updater
type OperationInfo ¶
type OperationInfo struct {
From *ResourceHeader
To *ResourceHeader
}
func GetOperationInfo ¶
func GetOperationInfo(item ChangesetItem) (*OperationInfo, error)
GetOperationInfo returns operation information
func (*OperationInfo) Kind ¶
func (o *OperationInfo) Kind() string
func (*OperationInfo) String ¶
func (o *OperationInfo) String() string
type PodCondition ¶
type PodSecurityPolicyConfig ¶
type PodSecurityPolicyConfig struct {
// PodSecurityPolicy is the existing pod security policy
*v1beta1.PodSecurityPolicy
// Client is k8s client
Client *kubernetes.Clientset
}
PodSecurityPolicyConfig defines controller configuration
func (*PodSecurityPolicyConfig) CheckAndSetDefaults ¶
func (c *PodSecurityPolicyConfig) CheckAndSetDefaults() error
type PodSecurityPolicyControl ¶
type PodSecurityPolicyControl struct {
PodSecurityPolicyConfig
log.FieldLogger
}
PodSecurityPolicyControl is a pod security policy controller, adds various operations, like delete, status check and update
func NewPodSecurityPolicyControl ¶
func NewPodSecurityPolicyControl(config PodSecurityPolicyConfig) (*PodSecurityPolicyControl, error)
NewPodSecurityPolicyControl returns a new instance of the PodSecurityPolicy controller
func (*PodSecurityPolicyControl) Delete ¶
func (c *PodSecurityPolicyControl) Delete(ctx context.Context, cascade bool) error
type PodStatus ¶
type PodStatus struct {
Phase string
Conditions []PodCondition
}
type PriorityClassConfig ¶
type PriorityClassConfig struct {
// PriorityClass is already parsed daemon set, will be used if present
*v1beta1.PriorityClass
// Client is k8s client
Client *kubernetes.Clientset
}
PriorityClassConfig is a PriorityClass control configuration
type PriorityClassControl ¶
type PriorityClassControl struct {
PriorityClassConfig
*log.Entry
}
PriorityClassControl is a daemon set controller, adds various operations, like delete, status check and update
func NewPriorityClassControl ¶
func NewPriorityClassControl( config PriorityClassConfig) (*PriorityClassControl, error)
NewPriorityClassControl returns new instance of PriorityClass updater
func (*PriorityClassControl) Delete ¶
func (c *PriorityClassControl) Delete(ctx context.Context, cascade bool) error
type PrometheusConfig ¶
type PrometheusConfig struct {
// Prometheus is the parsed Prometheus resource
*monitoringv1.Prometheus
// Client is monitoring API client
Client *monitoring.Clientset
}
PrometheusConfig is a Prometheus control configuration
func (*PrometheusConfig) CheckAndSetDefaults ¶
func (c *PrometheusConfig) CheckAndSetDefaults() error
CheckAndSetDefaults validates the config
type PrometheusControl ¶
type PrometheusControl struct {
PrometheusConfig
log.FieldLogger
}
PrometheusControl a controller for Prometheus resources
func NewPrometheusControl ¶
func NewPrometheusControl(config PrometheusConfig) (*PrometheusControl, error)
NewPrometheusControl returns new instance of Prometheus updater
type PrometheusRuleConfig ¶
type PrometheusRuleConfig struct {
// PrometheusRule is the parsed PrometheusRule resource
*monitoringv1.PrometheusRule
// Client is monitoring API client
Client *monitoring.Clientset
}
PrometheusRuleConfig is a PrometheusRule control configuration
func (*PrometheusRuleConfig) CheckAndSetDefaults ¶
func (c *PrometheusRuleConfig) CheckAndSetDefaults() error
CheckAndSetDefaults validates the config
type PrometheusRuleControl ¶
type PrometheusRuleControl struct {
PrometheusRuleConfig
log.FieldLogger
}
PrometheusRuleControl a controller for PrometheusRule resources
func NewPrometheusRuleControl ¶
func NewPrometheusRuleControl(config PrometheusRuleConfig) (*PrometheusRuleControl, error)
NewPrometheusRuleControl returns new instance of PrometheusRule updater
func (*PrometheusRuleControl) Delete ¶
func (c *PrometheusRuleControl) Delete(ctx context.Context, cascade bool) error
type RCConfig ¶
type RCConfig struct {
// ReplicationController specifies the existing ReplicationController
*v1.ReplicationController
// Client is k8s client
Client *kubernetes.Clientset
}
RCConfig is a ReplicationController control configuration
type RCControl ¶
type RCControl struct {
RCConfig
log.FieldLogger
}
RCControl is a daemon set controller, adds various operations, like delete, status check and update
func NewReplicationControllerControl ¶
NewReplicationControllerControl returns new instance of ReplicationController control
type Ref ¶
Ref is a resource refernece
type ReplicationController ¶
type ReplicationController struct {
Status ReplicationControllerStatus
}
func GetReplicationController ¶
func GetReplicationController(name string) (*ReplicationController, error)
type ResourceHeader ¶
type ResourceHeader struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
}
func ParseResourceHeader ¶
func ParseResourceHeader(reader io.Reader) (*ResourceHeader, error)
ParseResourceHeader parses resource header information
type RoleBindingConfig ¶
type RoleBindingConfig struct {
// RoleBinding is the existing role binding
*v1.RoleBinding
// Client is k8s client
Client *kubernetes.Clientset
}
RoleBindingConfig defines controller configuration
type RoleBindingControl ¶
type RoleBindingControl struct {
RoleBindingConfig
log.FieldLogger
}
RoleBindingControl is a role bindings controller, adds various operations, like delete, status check and update
func NewRoleBindingControl ¶
func NewRoleBindingControl(config RoleBindingConfig) (*RoleBindingControl, error)
NewRoleBindingControl returns a new instance of the RoleBinding controller
type RoleConfig ¶
type RoleConfig struct {
// Role is the existing role
*v1.Role
// Client is k8s client
Client *kubernetes.Clientset
}
RoleConfig defines controller configuration
type RoleControl ¶
type RoleControl struct {
RoleConfig
log.FieldLogger
}
RoleControl is a roles controller, adds various operations, like delete, status check and update
func NewRoleControl ¶
func NewRoleControl(config RoleConfig) (*RoleControl, error)
NewRoleControl returns a new instance of the Role controller
type SecretConfig ¶
type SecretConfig struct {
// Secret specifies the existing secret
*v1.Secret
// Client is k8s client
Client *kubernetes.Clientset
}
SecretConfig is a Secret control configuration
type SecretControl ¶
type SecretControl struct {
SecretConfig
log.FieldLogger
}
SecretControl is a daemon set controller, adds various operations, like delete, status check and update
func NewSecretControl ¶
func NewSecretControl(config SecretConfig) (*SecretControl, error)
NewSecretControl returns new instance of Secret updater
type ServiceAccountConfig ¶
type ServiceAccountConfig struct {
// ServiceAccount is the existing service account
*v1.ServiceAccount
// Client is k8s client
Client *kubernetes.Clientset
}
ServiceAccountConfig defines controller configuration
type ServiceAccountControl ¶
type ServiceAccountControl struct {
ServiceAccountConfig
log.FieldLogger
}
ServiceAccountControl is a service accounts controller, adds various operations, like delete, status check and update
func NewServiceAccountControl ¶
func NewServiceAccountControl(config ServiceAccountConfig) (*ServiceAccountControl, error)
NewServiceAccountControl returns a new instance of the ServiceAccount controller
func (*ServiceAccountControl) Delete ¶
func (c *ServiceAccountControl) Delete(ctx context.Context, cascade bool) error
type ServiceConfig ¶
type ServiceConfig struct {
// Service specifies the existing service
*v1.Service
// Client is k8s client
Client *kubernetes.Clientset
}
ServiceConfig is a Service control configuration
func (*ServiceConfig) CheckAndSetDefaults ¶
func (c *ServiceConfig) CheckAndSetDefaults() error
type ServiceControl ¶
type ServiceControl struct {
ServiceConfig
log.FieldLogger
}
ServiceControl is a daemon set controller, adds various operations, like delete, status check and update
func NewServiceControl ¶
func NewServiceControl(config ServiceConfig) (*ServiceControl, error)
NewServiceControl returns new instance of Service updater
type ServiceMonitorConfig ¶
type ServiceMonitorConfig struct {
// ServiceMonitor is the parsed ServiceMonitor resource
*monitoringv1.ServiceMonitor
// Client is monitoring API client
Client *monitoring.Clientset
}
ServiceMonitorConfig is a ServiceMonitor control configuration
func (*ServiceMonitorConfig) CheckAndSetDefaults ¶
func (c *ServiceMonitorConfig) CheckAndSetDefaults() error
CheckAndSetDefaults validates the config
type ServiceMonitorControl ¶
type ServiceMonitorControl struct {
ServiceMonitorConfig
log.FieldLogger
}
ServiceMonitorControl a controller for ServiceMonitor resources
func NewServiceMonitorControl ¶
func NewServiceMonitorControl(config ServiceMonitorConfig) (*ServiceMonitorControl, error)
NewServiceMonitorControl returns new instance of ServiceMonitor updater
func (*ServiceMonitorControl) Delete ¶
func (c *ServiceMonitorControl) Delete(ctx context.Context, cascade bool) error
type StatefulSetConfig ¶
type StatefulSetConfig struct {
// StatefulSet is already parsed statefulset
*appsv1.StatefulSet
// Client is k8s client
Client *kubernetes.Clientset
}
StatefulSetConfig is a StatefulSet control configuration
type StatefulSetControl ¶
type StatefulSetControl struct {
StatefulSetConfig
log.FieldLogger
}
StatefulSetControl is a statefulset controller, adds various operations, like delete, status check and update
func NewStatefulSetControl ¶
func NewStatefulSetControl(config StatefulSetConfig) (*StatefulSetControl, error)
NewStatefulSetControl returns new instance of the StatefulSet controller
func (*StatefulSetControl) Delete ¶
func (c *StatefulSetControl) Delete(ctx context.Context, cascade bool) error
Delete deletes this statefulset resource
type StatusReporter ¶
type StatusReporter interface {
// Status returns the state of the resource.
// Returns nil if successful (created/deleted/updated), otherwise an error
Status(ctx context.Context) error
// Infof logs the specified message and arguments in context of this resource
Infof(message string, args ...interface{})
}
StatusReporter reports the status of the resource.
type ValidatingWebhookConfigurationConfig ¶
type ValidatingWebhookConfigurationConfig struct {
*admissionregistrationv1.ValidatingWebhookConfiguration
Client *kubernetes.Clientset
}
ValidatingWebhookConfigurationConfig is the control configuration.
func (*ValidatingWebhookConfigurationConfig) CheckAndSetDefaults ¶
func (c *ValidatingWebhookConfigurationConfig) CheckAndSetDefaults() error
CheckAndSetDefauls validates the config and sets defaults.
type ValidatingWebhookConfigurationControl ¶
type ValidatingWebhookConfigurationControl struct {
ValidatingWebhookConfigurationConfig
log.FieldLogger
}
ValidatingWebhookConfigurationControl is the control service for ValidatingWebhookConfiguration resources.
func NewValidatingWebhookConfigurationControl ¶
func NewValidatingWebhookConfigurationControl(config ValidatingWebhookConfigurationConfig) (*ValidatingWebhookConfigurationControl, error)
NewValidatingWebhookConfigurationControl creates control service for ValidatingWebhookConfiguration resouces.
func (*ValidatingWebhookConfigurationControl) Delete ¶
func (c *ValidatingWebhookConfigurationControl) Delete(ctx context.Context, cascade bool) error
Delete deletes the resource.
Source Files
¶
- alertmanager.go
- apiservice.go
- changeset.go
- configmap.go
- configmapgen.go
- constants.go
- crd.go
- deployment.go
- ds.go
- job.go
- label.go
- loc.go
- namespace.go
- nodes.go
- parse.go
- policies.go
- priorityclass.go
- prometheus.go
- prometheusrule.go
- rc.go
- rcc.go
- roles.go
- secret.go
- service.go
- serviceaccount.go
- servicemonitor.go
- spec.go
- statefulset.go
- types.go
- utils.go
- webhook.go