Documentation ¶
Overview ¶
Copyright © 2021 Antoine Martin <antoine@openance.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Antoine Martin <antoine@openance.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func AreWorkloadsReady(config *Config, callback WorkloadStateCallbackFunc) wait.ConditionFunc
- func CleanConfig() (err error)
- func GetIkniteConfigMap(client *kubernetes.Clientset) (cm *corev1.ConfigMap, err error)
- func OkString(b bool) string
- func RunKubeadm(parameters []string) (err error)
- func RunKubeadmInit(ip net.IP) error
- func StatusViewerFor(kind schema.GroupKind) (polymorphichelpers.StatusViewer, error)
- func WriteIkniteConfigMap(client *kubernetes.Clientset, cm *corev1.ConfigMap) (res *corev1.ConfigMap, err error)
- type Application
- type ApplicationStatus
- type ApplicationStatusViewer
- type Config
- func (config *Config) CheckClusterRunning(retries, okresponses, waittime int) error
- func (config *Config) Client() (client *kubernetes.Clientset, err error)
- func (config *Config) IsConfigServerAddress(ip net.IP) bool
- func (config *Config) RESTClient() *RESTClientGetter
- func (c *Config) RenameConfig(newName string) *Config
- func (config *Config) RestartProxy() (err error)
- func (config *Config) WaitForWorkloads(timeout time.Duration, callback WorkloadStateCallbackFunc) error
- func (config *Config) WriteToFile(filename string) error
- type HealthStatus
- type RESTClientGetter
- func (client *RESTClientGetter) AllWorkloadStates() (result []*WorkloadState, err error)
- func (client *RESTClientGetter) HasApplications() (has bool, err error)
- func (r *RESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (r *RESTClientGetter) ToRESTConfig() (*rest.Config, error)
- func (r *RESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)
- func (r *RESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
- type SyncStatus
- type WorkloadState
- type WorkloadStateCallbackFunc
Constants ¶
This section is empty.
Variables ¶
var ApplicationSchemaGroupVersionKind = schema.GroupVersionKind{Group: "argoproj.io", Version: "v1alpha1", Kind: "Application"}
var KubernetesVersion = "1.24.3"
Functions ¶
func AreWorkloadsReady ¶ added in v0.1.19
func AreWorkloadsReady(config *Config, callback WorkloadStateCallbackFunc) wait.ConditionFunc
func CleanConfig ¶
func CleanConfig() (err error)
func GetIkniteConfigMap ¶ added in v0.1.20
func GetIkniteConfigMap(client *kubernetes.Clientset) (cm *corev1.ConfigMap, err error)
func RunKubeadm ¶
func RunKubeadmInit ¶
func StatusViewerFor ¶ added in v0.1.19
func StatusViewerFor(kind schema.GroupKind) (polymorphichelpers.StatusViewer, error)
func WriteIkniteConfigMap ¶ added in v0.1.20
Types ¶
type Application ¶ added in v0.1.19
type Application struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` Status ApplicationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` }
type ApplicationStatus ¶ added in v0.1.19
type ApplicationStatus struct { Sync SyncStatus `json:"sync,omitempty" protobuf:"bytes,2,opt,name=sync"` Health HealthStatus `json:"health,omitempty" protobuf:"bytes,3,opt,name=health"` }
type ApplicationStatusViewer ¶ added in v0.1.19
type ApplicationStatusViewer struct{}
func (*ApplicationStatusViewer) Status ¶ added in v0.1.19
func (s *ApplicationStatusViewer) Status(obj runtime.Unstructured, revision int64) (string, bool, error)
type Config ¶
func LoadFromDefault ¶
LoadFromDefault loads the configuration from the default admin.conf file, usually located at /etc/kubernetes/admin.conf.
func LoadFromFile ¶ added in v0.1.15
LoadFromFile loads the configuration from the file specified by filename.
func (*Config) CheckClusterRunning ¶
CheckClusterRunning checks that the cluster is running by requesting the API server /readyz endpoint. It checks retries times and waits for waittime seconds between each check. It needs at least okresponses good responses from the server.
func (*Config) Client ¶
func (config *Config) Client() (client *kubernetes.Clientset, err error)
Client returns a clientset for config.
func (*Config) IsConfigServerAddress ¶
IsConfigServerAddress checks that config points to the server at ip IP address
func (*Config) RESTClient ¶ added in v0.1.19
func (config *Config) RESTClient() *RESTClientGetter
func (*Config) RenameConfig ¶
RenameConfig changes the name of the cluster and the context from the default (kubernetes) to newName in c.
func (*Config) RestartProxy ¶
RestartProxy restarts kube-proxy after config has been updated. This needs to be done after an IP address change. The restart method is taken from kubectl: https://github.com/kubernetes/kubectl/blob/652881798563c00c1895ded6ced819030bfaa4d7/pkg/polymorphichelpers/objectrestarter.go#L81
func (*Config) WaitForWorkloads ¶ added in v0.1.19
func (config *Config) WaitForWorkloads(timeout time.Duration, callback WorkloadStateCallbackFunc) error
func (*Config) WriteToFile ¶
WriteToFile writes the config configuration to the file pointed by filename. it returns the appropriate error in case of failure.
type HealthStatus ¶ added in v0.1.19
type HealthStatus struct { // Status holds the status code of the application or resource Status string `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"` // Message is a human-readable informational message describing the health status Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` }
type RESTClientGetter ¶ added in v0.1.19
type RESTClientGetter struct {
// contains filtered or unexported fields
}
func (*RESTClientGetter) AllWorkloadStates ¶ added in v0.1.19
func (client *RESTClientGetter) AllWorkloadStates() (result []*WorkloadState, err error)
func (*RESTClientGetter) HasApplications ¶ added in v0.1.19
func (client *RESTClientGetter) HasApplications() (has bool, err error)
func (*RESTClientGetter) ToDiscoveryClient ¶ added in v0.1.19
func (r *RESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
func (*RESTClientGetter) ToRESTConfig ¶ added in v0.1.19
func (r *RESTClientGetter) ToRESTConfig() (*rest.Config, error)
func (*RESTClientGetter) ToRESTMapper ¶ added in v0.1.19
func (r *RESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)
func (*RESTClientGetter) ToRawKubeConfigLoader ¶ added in v0.1.19
func (r *RESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
type SyncStatus ¶ added in v0.1.19
type SyncStatus struct {
Status string `json:"status" protobuf:"bytes,1,opt,name=status,casttype=SyncStatusCode"`
}
type WorkloadState ¶ added in v0.1.19
func (*WorkloadState) LongString ¶ added in v0.1.19
func (r *WorkloadState) LongString() string
func (*WorkloadState) String ¶ added in v0.1.19
func (r *WorkloadState) String() string
type WorkloadStateCallbackFunc ¶ added in v0.1.19
type WorkloadStateCallbackFunc func(state bool, total int, ready []*WorkloadState, unready []*WorkloadState)