Documentation
¶
Index ¶
- func BuildResources(vars map[string]string, templateList []string, isReplace bool)
- func CreateResources(vars map[string]string, templateList []string)
- func DBClientFindAndReserve(client *redis.Client, app string, env string, ttl time.Duration) (string, error)
- func DBClientGetAllClusters(client *redis.Client, app string, env string) (string, error)
- func DBClientGetAllClustersDetail(client *redis.Client, app string, env string) (string, error)
- func DBClientGetSingleCluster(client *redis.Client, app string, env string, cluster string) (string, error)
- func DBClientGetSingleClusterDetail(client *redis.Client, app string, env string, cluster string) (string, error)
- func DBClientListClusters(client *redis.Client, app string, env string, cluster string, detail bool) (string, error)
- func DBClientReserveCluster(client *redis.Client, app string, env string, key string, val []byte, ...) error
- func DBGetClusterReservation(client *redis.Client, app string, env string, cluster string) (string, error)
- func DeleteKubernetesJob(resource, namespace string) string
- func ErrorHandler(err error)
- func ExecCmd(cmdName string, cmdArgs []string) ([]byte, error)
- func GetAPIActions(api string, application string, m map[string]interface{}) ([]map[string]interface{}, error)
- func GetClientSet() *kubernetes.Clientset
- func GetDatabaseConnection() *sql.DB
- func GetDockerTag(api string, m map[string]interface{}) (string, error)
- func GetJobAPI(vars map[string]string) (map[string]interface{}, error)
- func GetJobNamespace(vars map[string]string) (string, error)
- func GetLogs(job *batchv1.Job) (string, error)
- func GetResourceStatus(parms map[string]string, resourcePostfix []string) ([]byte, error)
- func IsClusterInList(environment, cluster, m interface{}) bool
- func Keys(m map[string][]string) (keys []string)
- func KubeGetDeployments(filter string) (map[string]interface{}, error)
- func KubeGetServices(filter string) (map[string]interface{}, error)
- func NewDBClient() *redis.Client
- func RunActions(api string, vars map[string]interface{}) (map[string]interface{}, error)
- func RunJobActions(api string, vars map[string]interface{}) (map[string]interface{}, error)
- func SaveEventStatus(eventdata map[string]string) error
- func UpdateResources(vars map[string]string, templateList []string)
- type APIList
- type GitHubData
- type GitHubHook
- type KubeEndpoint
- type KubeServicePort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildResources ¶
BuildResources get Status of specified resources. Iterating over each type of app
func CreateResources ¶
CreateResources creates a list of kubernetes resources specified in the template list
func DBClientFindAndReserve ¶
func DBClientFindAndReserve(client *redis.Client, app string, env string, ttl time.Duration) (string, error)
DBClientFindAndReserve is a wrapper to find a free cluster and update the cache of used clusters
func DBClientGetAllClusters ¶
DBClientGetAllClusters is a wrapper to list the clusters in use and the resources using the clusters
func DBClientGetAllClustersDetail ¶
DBClientGetAllClustersDetail is a wrapper to get details used clusters and resources using the clusters
func DBClientGetSingleCluster ¶
func DBClientGetSingleCluster(client *redis.Client, app string, env string, cluster string) (string, error)
DBClientGetSingleCluster wrapper to get resource using a given cluster
func DBClientGetSingleClusterDetail ¶
func DBClientGetSingleClusterDetail(client *redis.Client, app string, env string, cluster string) (string, error)
DBClientGetSingleClusterDetail wrapper to get details of a resource using a given cluster
func DBClientListClusters ¶
func DBClientListClusters(client *redis.Client, app string, env string, cluster string, detail bool) (string, error)
DBClientListClusters fetches the details of clusters in use and resources using those clusters
func DBClientReserveCluster ¶
func DBClientReserveCluster(client *redis.Client, app string, env string, key string, val []byte, t time.Duration) error
DBClientReserveCluster updates the redis cache and allocates the cluster to the incoming resource
func DBGetClusterReservation ¶
func DBGetClusterReservation(client *redis.Client, app string, env string, cluster string) (string, error)
DBGetClusterReservation ...
func DeleteKubernetesJob ¶
DeleteKubernetesJob - Cleans a job from Kubernetes memory space.
func ExecCmd ¶
ExecCmd executions the input command and argumets on the command line and returns the output
func GetAPIActions ¶
func GetAPIActions(api string, application string, m map[string]interface{}) ([]map[string]interface{}, error)
GetAPIActions loads API definitions from file every time work needs to be done. A future enhancement will be to preload this so that we don't need to keep ready from disk
func GetClientSet ¶
func GetClientSet() *kubernetes.Clientset
GetClientSet returns a clientset object to make API calls
func GetDatabaseConnection ¶
GetDatabaseConnection - opens, tests and returns a new database connection
func GetDockerTag ¶
GetDockerTag fetches the most recent tag of the resource defined in api yaml
func GetJobNamespace ¶
GetJobNamespace retrieves the namespace for the k8s Job from YAML
func GetResourceStatus ¶
GetResourceStatus get Status of specified resources. Iterating over each type of app
func IsClusterInList ¶
func IsClusterInList(environment, cluster, m interface{}) bool
IsClusterInList checks if given cluster is in the given environment in the cluster list definition
func KubeGetDeployments ¶
KubeGetDeployments get details for kubernetes resources names matching the filter
func KubeGetServices ¶
KubeGetServices gets details of services for the given filter
func NewDBClient ¶
NewDBClient establishes a new redis database connection and returns the client connection object
func RunActions ¶
RunActions ...
func RunJobActions ¶
RunJobActions ...
func SaveEventStatus ¶
SaveEventStatus - stores events to database
func UpdateResources ¶
UpdateResources updates the kubernetes resources using the new configuration from the template list
Types ¶
type GitHubData ¶
type GitHubData struct { URL string RepoName string CommitID string Timestamp string RepoID float64 }
GitHubData ...
func ParseGithubPayload ¶
func ParseGithubPayload(m map[string]interface{}) *GitHubData
ParseGithubPayload reads a Hook from an incoming HTTP Request.
func (*GitHubData) CloneAndSymlinkApp ¶
func (ghdata *GitHubData) CloneAndSymlinkApp() (string, string)
CloneAndSymlinkApp downloads the github repo and symlinks it to application/{repo}
type GitHubHook ¶
GitHubHook ...
func ParseGithubHook ¶
func ParseGithubHook(req *http.Request) (*GitHubHook, error)
ParseGithubHook reads a Hook from an incoming HTTP Request.
func (*GitHubHook) SignedBy ¶
func (h *GitHubHook) SignedBy(secret []byte) bool
SignedBy checks that the provided secret matches the hook Signature
type KubeEndpoint ¶
type KubeEndpoint struct { // Hostname, either as a domain name or IP address. Host string `json:"host"` // List of ports opened for this endpoint on the hostname. Ports []KubeServicePort `json:"ports"` }
KubeEndpoint describes an endpoint that is host and a list of available ports for that host.
func GetExternalEndpoints ¶
func GetExternalEndpoints(service *api.Service) []KubeEndpoint
GetExternalEndpoints returns endpoints that are externally reachable for a service.
func GetInternalEndpoint ¶
func GetInternalEndpoint(serviceName, namespace string, ports []api.ServicePort) KubeEndpoint
GetInternalEndpoint returns internal endpoint name for the given service properties, e.g, "my-service.namespace 80/TCP" or "my-service 53/TCP,53/UDP"
type KubeServicePort ¶
type KubeServicePort struct { // Positive port number. Port int32 `json:"port"` // Protocol name, e.g., TCP or UDP. Protocol apiv1.Protocol `json:"protocol"` // The port on each node on which service is exposed. NodePort int32 `json:"nodePort"` }
KubeServicePort is a pair of port and protocol, e.g. a service endpoint.
func GetServicePorts ¶
func GetServicePorts(apiPorts []apiv1.ServicePort) []KubeServicePort
GetServicePorts returns human readable name for the given service ports list.