Documentation ¶
Index ¶
- Constants
- func AddEtcdVolumeToPod(pod *v1.Pod, pvc *v1.PersistentVolumeClaim)
- func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
- func ClientServiceName(clusterName string) string
- func ClusterListOpt(clusterName string) metav1.ListOptions
- func CreateAndWaitPod(kubecli kubernetes.Interface, ns string, pod *v1.Pod, timeout time.Duration) (*v1.Pod, error)
- func CreateCRD(clientset apiextensionsclient.Interface, ...) error
- func CreateClientService(kubecli kubernetes.Interface, clusterName, ns string, ...) error
- func CreatePatch(o, n, datastruct interface{}) ([]byte, error)
- func CreatePeerService(kubecli kubernetes.Interface, clusterName, ns string, ...) error
- func GetClusterList(restcli rest.Interface, ns string) (*api.EtcdClusterList, error)
- func GetEtcdVersion(pod *v1.Pod) string
- func GetPodNames(pods []*v1.Pod) []string
- func ImageName(repo, version string) string
- func InClusterConfig() (*rest.Config, error)
- func IsKubernetesResourceAlreadyExistError(err error) bool
- func IsKubernetesResourceNotFoundError(err error) bool
- func IsNodeReady(n v1.Node) bool
- func IsPodReady(pod *v1.Pod) bool
- func LabelsForCluster(clusterName string) map[string]string
- func MemberRemoveEvent(memberName string, cl *api.EtcdCluster) *v1.Event
- func MemberUpgradedEvent(memberName, oldVersion, newVersion string, cl *api.EtcdCluster) *v1.Event
- func MustNewKubeClient() kubernetes.Interface
- func MustNewKubeExtClient() apiextensionsclient.Interface
- func NewEtcdPod(m *etcdutil.Member, initialCluster []string, clusterName, state, token string, ...) *v1.Pod
- func NewEtcdPodPVC(m *etcdutil.Member, pvcSpec v1.PersistentVolumeClaimSpec, ...) *v1.PersistentVolumeClaim
- func NewMemberAddEvent(memberName string, cl *api.EtcdCluster) *v1.Event
- func NewSeedMemberPod(clusterName string, ms etcdutil.MemberSet, m *etcdutil.Member, ...) *v1.Pod
- func NewSelfHostedEtcdPod(m *etcdutil.Member, initialCluster, endpoints []string, ...) *v1.Pod
- func PVCNameFromMember(memberName string) string
- func PatchDeployment(kubecli kubernetes.Interface, namespace, name string, ...) error
- func PodSpecToPrettyJSON(pod *v1.Pod) (string, error)
- func PodWithNodeSelector(p *v1.Pod, ns map[string]string) *v1.Pod
- func ReplacingDeadMemberEvent(memberName string, cl *api.EtcdCluster) *v1.Event
- func SetEtcdVersion(pod *v1.Pod, version string)
- func UniqueMemberName(clusterName string) string
- func WaitCRDReady(clientset apiextensionsclient.Interface, crdName string) error
- type EtcdClusterCRUpdateFunc
- type TLSData
Constants ¶
const (
// EtcdClientPort is the client port on client service and etcd nodes.
EtcdClientPort = 2379
)
const TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"
Variables ¶
This section is empty.
Functions ¶
func AddEtcdVolumeToPod ¶ added in v0.8.3
func AddEtcdVolumeToPod(pod *v1.Pod, pvc *v1.PersistentVolumeClaim)
AddEtcdVolumeToPod abstract the process of appending volume spec to pod spec
func CascadeDeleteOptions ¶ added in v0.3.1
func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
func ClientServiceName ¶ added in v0.2.5
func ClusterListOpt ¶ added in v0.2.0
func ClusterListOpt(clusterName string) metav1.ListOptions
We are using internal api types for cluster related.
func CreateAndWaitPod ¶
func CreateAndWaitPod(kubecli kubernetes.Interface, ns string, pod *v1.Pod, timeout time.Duration) (*v1.Pod, error)
CreateAndWaitPod is a workaround for self hosted and util for testing. We should eventually get rid of this in critical code path and move it to test util.
func CreateCRD ¶ added in v0.5.0
func CreateCRD(clientset apiextensionsclient.Interface, crdName, rkind, rplural, shortName string) error
func CreateClientService ¶ added in v0.2.5
func CreateClientService(kubecli kubernetes.Interface, clusterName, ns string, owner metav1.OwnerReference) error
func CreatePatch ¶ added in v0.2.5
func CreatePeerService ¶ added in v0.2.5
func CreatePeerService(kubecli kubernetes.Interface, clusterName, ns string, owner metav1.OwnerReference) error
func GetClusterList ¶ added in v0.2.0
func GetEtcdVersion ¶
func GetPodNames ¶
func InClusterConfig ¶ added in v0.2.2
func IsNodeReady ¶ added in v0.5.0
IsNodeReady checks if the Node condition is ready.
func IsPodReady ¶ added in v0.3.3
IsPodReady returns false if the Pod Status is nil
func LabelsForCluster ¶ added in v0.2.6
func MemberRemoveEvent ¶ added in v0.6.0
func MemberRemoveEvent(memberName string, cl *api.EtcdCluster) *v1.Event
func MemberUpgradedEvent ¶ added in v0.6.0
func MemberUpgradedEvent(memberName, oldVersion, newVersion string, cl *api.EtcdCluster) *v1.Event
func MustNewKubeClient ¶ added in v0.2.1
func MustNewKubeClient() kubernetes.Interface
func MustNewKubeExtClient ¶ added in v0.5.0
func MustNewKubeExtClient() apiextensionsclient.Interface
func NewEtcdPod ¶ added in v0.2.1
func NewEtcdPod(m *etcdutil.Member, initialCluster []string, clusterName, state, token string, cs api.ClusterSpec, owner metav1.OwnerReference) *v1.Pod
func NewEtcdPodPVC ¶ added in v0.8.3
func NewEtcdPodPVC(m *etcdutil.Member, pvcSpec v1.PersistentVolumeClaimSpec, clusterName, namespace string, owner metav1.OwnerReference) *v1.PersistentVolumeClaim
NewEtcdPodPVC create PVC object from etcd pod's PVC spec
func NewMemberAddEvent ¶ added in v0.6.0
func NewMemberAddEvent(memberName string, cl *api.EtcdCluster) *v1.Event
func NewSeedMemberPod ¶ added in v0.6.1
func NewSeedMemberPod(clusterName string, ms etcdutil.MemberSet, m *etcdutil.Member, cs api.ClusterSpec, owner metav1.OwnerReference, backupURL *url.URL) *v1.Pod
NewSeedMemberPod returns a Pod manifest for a seed member. It's special that it has new token, and might need recovery init containers
func NewSelfHostedEtcdPod ¶ added in v0.2.1
func NewSelfHostedEtcdPod(m *etcdutil.Member, initialCluster, endpoints []string, clusterName, state, token string, cs api.ClusterSpec, owner metav1.OwnerReference) *v1.Pod
func PVCNameFromMember ¶ added in v0.8.3
PVCNameFromMember the way we get PVC name from the member name
func PatchDeployment ¶ added in v0.3.0
func PatchDeployment(kubecli kubernetes.Interface, namespace, name string, updateFunc func(*appsv1beta1.Deployment)) error
func ReplacingDeadMemberEvent ¶ added in v0.6.0
func ReplacingDeadMemberEvent(memberName string, cl *api.EtcdCluster) *v1.Event
func SetEtcdVersion ¶
func UniqueMemberName ¶ added in v0.8.3
func WaitCRDReady ¶ added in v0.5.0
func WaitCRDReady(clientset apiextensionsclient.Interface, crdName string) error
Types ¶
type EtcdClusterCRUpdateFunc ¶ added in v0.5.0
type EtcdClusterCRUpdateFunc func(*api.EtcdCluster)
EtcdClusterCRUpdateFunc is a function to be used when atomically updating a Cluster CR.
type TLSData ¶ added in v0.2.6
func GetTLSDataFromSecret ¶ added in v0.2.6
func GetTLSDataFromSecret(kubecli kubernetes.Interface, ns, se string) (*TLSData, error)
GetTLSDataFromSecret retrives the kubernete secret that contain etcd tls certs and put them into TLSData.