Documentation
¶
Index ¶
- type AllResourceStatus
- type CRBOption
- type CROption
- type Client
- func (c *Client) CreateClusterRole(option *CROption) error
- func (c *Client) CreateClusterRoleBinding(option *CRBOption) error
- func (c *Client) CreateNamespace(namespace string) error
- func (c *Client) CreatePersistentVolume(option *PVOption) error
- func (c *Client) CreatePersistentVolumeClaim(opt *PVCOption) error
- func (c *Client) CreateServiceAccount(name, namespace string) error
- func (c *Client) DeleteClusterRole(name string) error
- func (c *Client) DeleteClusterRoleBinding(name string) error
- func (c *Client) DeleteDeployment(namespace, deployName string) error
- func (c *Client) DeleteNamespace(namespace string) error
- func (c *Client) DeletePersistentVolume(pvName string) error
- func (c *Client) DeletePersistentVolumeClaim(namespace, pvcName string) error
- func (c *Client) DeleteService(namespace, serviceName string) error
- func (c *Client) DeleteServiceAccount(name, namespace string) error
- func (c *Client) DescribeArgocdApp(app *argocdv1alpha1.Application) map[string]interface{}
- func (c *Client) GetArgocdApplication(namespace, name string) (*argocdv1alpha1.Application, error)
- func (c *Client) GetDaemonset(namespace, name string) (*appsv1.DaemonSet, error)
- func (c *Client) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
- func (c *Client) GetNamespace(namespace string) (*corev1.Namespace, error)
- func (c *Client) GetResourceStatus(nameSpace string, anFilter, labelFilter map[string]string) (AllResourceStatus, error)
- func (c *Client) GetService(namespace, name string) (*corev1.Service, error)
- func (c *Client) GetStatefulset(namespace, name string) (*appsv1.StatefulSet, error)
- func (c *Client) IsArgocdApplicationReady(application *argocdv1alpha1.Application) bool
- func (c *Client) IsDaemonsetReady(daemonset *appsv1.DaemonSet) bool
- func (c *Client) IsDeploymentReady(deployment *appsv1.Deployment) bool
- func (c *Client) IsDevstreamNS(namespace string) (bool, error)
- func (c *Client) IsNamespaceExists(namespace string) (bool, error)
- func (c *Client) IsStatefulsetReady(statefulset *appsv1.StatefulSet) bool
- func (c *Client) ListArgocdApplications(namespace string) ([]argocdv1alpha1.Application, error)
- func (c *Client) ListDaemonsetsWithLabel(namespace string, labeFilter map[string]string) ([]appsv1.DaemonSet, error)
- func (c *Client) ListDeploymentsWithLabel(namespace string, labelFilter map[string]string) ([]appsv1.Deployment, error)
- func (c *Client) ListDevstreamNamespace() (*corev1.NamespaceList, error)
- func (c *Client) ListServices(namespace string) ([]corev1.Service, error)
- func (c *Client) ListStatefulsetsWithLabel(namespace string, labelFilter map[string]string) ([]appsv1.StatefulSet, error)
- func (c *Client) WaitForDeploymentReady(retry int, namespace, deployName string) error
- type PVCOption
- type PVOption
- type ResourceStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllResourceStatus ¶ added in v0.8.0
type AllResourceStatus struct { Deployment []ResourceStatus StatefulSet []ResourceStatus DaemonSet []ResourceStatus }
type CROption ¶
type CROption struct { Name string PolicyRules []rbacv1.PolicyRule }
type Client ¶
type Client struct { *kubernetes.Clientset Argocd *argocdclient.Clientset }
func (*Client) CreateClusterRole ¶
func (*Client) CreateClusterRoleBinding ¶
func (*Client) CreateNamespace ¶
func (*Client) CreatePersistentVolume ¶
func (*Client) CreatePersistentVolumeClaim ¶ added in v0.8.0
func (*Client) CreateServiceAccount ¶
func (*Client) DeleteClusterRole ¶
func (*Client) DeleteClusterRoleBinding ¶
func (*Client) DeleteDeployment ¶ added in v0.8.0
func (*Client) DeleteNamespace ¶
func (*Client) DeletePersistentVolume ¶ added in v0.8.0
func (*Client) DeletePersistentVolumeClaim ¶ added in v0.8.0
func (*Client) DeleteService ¶ added in v0.8.0
func (*Client) DeleteServiceAccount ¶
func (*Client) DescribeArgocdApp ¶
func (c *Client) DescribeArgocdApp(app *argocdv1alpha1.Application) map[string]interface{}
func (*Client) GetArgocdApplication ¶
func (c *Client) GetArgocdApplication(namespace, name string) (*argocdv1alpha1.Application, error)
func (*Client) GetDaemonset ¶
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
func (*Client) GetNamespace ¶
func (*Client) GetResourceStatus ¶ added in v0.8.0
func (c *Client) GetResourceStatus(nameSpace string, anFilter, labelFilter map[string]string) (AllResourceStatus, error)
GetResourceStatus get all resource state by input nameSpace and filtermap
func (*Client) GetService ¶
func (*Client) GetStatefulset ¶
func (c *Client) GetStatefulset(namespace, name string) (*appsv1.StatefulSet, error)
func (*Client) IsArgocdApplicationReady ¶
func (c *Client) IsArgocdApplicationReady(application *argocdv1alpha1.Application) bool
func (*Client) IsDaemonsetReady ¶
func (*Client) IsDeploymentReady ¶
func (c *Client) IsDeploymentReady(deployment *appsv1.Deployment) bool
func (*Client) IsDevstreamNS ¶ added in v0.8.0
Check whether the given namespace is created by dtm If the given namespace has label "created_by=DevStream", we'll control it.
- The specified namespace is created by dtm, then it should be deleted when errors are encountered during creation or `dtm delete`.
- The specified namespace is controlled by user, maybe they want to deploy plugins in an existing namespace or other situations, then we should not delete this namespace.
func (*Client) IsNamespaceExists ¶
func (*Client) IsStatefulsetReady ¶
func (c *Client) IsStatefulsetReady(statefulset *appsv1.StatefulSet) bool
func (*Client) ListArgocdApplications ¶
func (c *Client) ListArgocdApplications(namespace string) ([]argocdv1alpha1.Application, error)
func (*Client) ListDaemonsetsWithLabel ¶ added in v0.8.0
func (*Client) ListDeploymentsWithLabel ¶ added in v0.8.0
func (*Client) ListDevstreamNamespace ¶ added in v0.8.0
func (c *Client) ListDevstreamNamespace() (*corev1.NamespaceList, error)
func (*Client) ListServices ¶
func (*Client) ListStatefulsetsWithLabel ¶ added in v0.8.0
type PVCOption ¶ added in v0.8.0
type PVCOption struct { Name string NameSpace string StorageClassName string AccessMode []corev1.PersistentVolumeAccessMode Requirement corev1.ResourceRequirements }
type PVOption ¶
type PVOption struct { Name string StorageClassName string // ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce" // ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany" // ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany" // ReadWriteOncePod PersistentVolumeAccessMode = "ReadWriteOncePod" AccessMode []corev1.PersistentVolumeAccessMode // <binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei // (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html) // <decimalSI> ::= m | "" | k | M | G | T | P | E // (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.) // eg: 10Gi 200Mi Capacity string //PersistentVolumeReclaimRecycle PersistentVolumeReclaimPolicy = "Recycle" //PersistentVolumeReclaimDelete PersistentVolumeReclaimPolicy = "Delete" //PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain" PersistentVolumeReclaimPolicy corev1.PersistentVolumeReclaimPolicy HostPath string }
type ResourceStatus ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.