Repository navigation
Controller Design CMD List
The design of the deploy command is explicitly designed to support the list command. Kubernetes labels are used to allow the set of deployed application containers to be listed using the client-go library.
To abstract over the Kubernetes components associated with a deployed application container, an Application interface was created. This interface provides all information required to identify a deployed application container.
interface Application {
GetName() string
GetPort() int
GetCreationTimestamp() Time
}
The Kube Client acts as a wrapper around the client-go Kubernetes client. ListApplications was added to give the client the ability to provide a list of all deployed application containers.
ListApplications fetches all application containers that have been deployed using the Express controller. To provide the application information, the deployed Kubernetes services are used. The design of the deploy command enables this by giving all Kubernetes Services the group=services label. Kubernetes services are the only component given this label because they are the only component that provides all the information required by the Application interface. The name, port and creation timestamp are obtained from the Kubernetes Services to create applications which are returned.