Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCodewindRoleBindings(codewindInstance Codewind, deployOptions *DeployOptions, ...) rbacv1.RoleBinding
- func CreateCodewindRoles(deployOptions *DeployOptions) rbacv1.ClusterRole
- func CreateCodewindServiceAcct(codewind Codewind, deployOptions *DeployOptions) coreV1.ServiceAccount
- func CreateCodewindTektonClusterRoleBindings(codewindInstance Codewind, deployOptions *DeployOptions, ...) rbacv1.ClusterRoleBinding
- func CreateCodewindTektonClusterRoles(deployOptions *DeployOptions) rbacv1.ClusterRole
- func CreateKeycloakServiceAcct(codewind Codewind, deployOptions *DeployOptions) coreV1.ServiceAccount
- func DeployGatekeeper(config *restclient.Config, clientset *kubernetes.Clientset, ...) error
- func DeployKeycloak(config *restclient.Config, clientset *kubernetes.Clientset, ...) error
- func DeployPFE(config *restclient.Config, clientset *kubernetes.Clientset, ...) error
- func DeployPerformance(clientset *kubernetes.Clientset, codewind Codewind, ...) error
- func DeployRemote(remoteDeployOptions *DeployOptions) (*DeploymentResult, *RemInstError)
- func GetExistingDeployments(namespace string, clientset kubernetes.Interface) ([]ExistingDeployment, *RemInstError)
- func GetImages() (string, string, string, string)
- func GetKubeConfig() (*rest.Config, error)
- func RemoveRemote(remoteRemovalOptions *RemoveDeploymentOptions) (*RemovalResult, *RemInstError)
- func RemoveRemoteKeycloak(remoteRemovalOptions *RemoveDeploymentOptions) (*RemovalResult, *RemInstError)
- func SetupKeycloak(codewindInstance Codewind, deployOptions *DeployOptions) error
- func WaitForPodReady(clientset *kubernetes.Clientset, codewindInstance Codewind, ...) bool
- type Codewind
- type DeployOptions
- type DeploymentResult
- type ExistingDeployment
- type ImagePullSecret
- type K8sAPI
- type RemInstError
- type RemovalResult
- type RemoveDeploymentOptions
- type Result
- type ServiceAccountPatch
Constants ¶
const ( // PFEPrefix is the prefix all PFE-related resources: deployment, service, and ingress/route PFEPrefix = "codewind-pfe" // PerformancePrefix is the prefix for all performance-dashboard related resources: deployment and service PerformancePrefix = "codewind-performance" // KeycloakPrefix is the prefix for all keycloak related resources: deployment and service KeycloakPrefix = "codewind-keycloak" // GatekeeperPrefix is the prefix for all gatekeeper related resources: deployment and service GatekeeperPrefix = "codewind-gatekeeper" // PFEImage is the docker image that will be used in the Codewind-PFE pod PFEImage = "eclipse/codewind-pfe-amd64" // PerformanceImage is the docker image that will be used in the Performance dashboard pod PerformanceImage = "eclipse/codewind-performance-amd64" // KeycloakImage is the docker image that will be used in the Codewind-Keycloak pod KeycloakImage = "eclipse/codewind-keycloak-amd64" // GatekeeperImage is the docker image that will be used in the Codewind-Gatekeeper pod GatekeeperImage = "eclipse/codewind-gatekeeper-amd64" // PFEImageTag is the image tag associated with the docker image that's used for Codewind-PFE PFEImageTag = "0.14.0" // PerformanceTag is the image tag associated with the docker image that's used for the Performance dashboard PerformanceTag = "0.14.0" // KeycloakImageTag is the image tag associated with the docker image that's used for Codewind-Keycloak KeycloakImageTag = "0.14.0" // GatekeeperImageTag is the image tag associated with the docker image that's used for Codewind-Gatekeeper GatekeeperImageTag = "0.14.0" // ImagePullPolicy is the pull policy used for all containers in Codewind, defaults to Always ImagePullPolicy = corev1.PullAlways // PFEContainerPort is the port at which Codewind-PFE is exposed PFEContainerPort = 9191 // PerformanceContainerPort is the port at which the Performance dashboard is exposed PerformanceContainerPort = 9095 // KeycloakContainerPort is the port at which Keycloak is exposed KeycloakContainerPort = 8080 // GatekeeperContainerPort is the port at which the Gatekeeper is exposed GatekeeperContainerPort = 9096 // CodewindRolesName will include the workspaceID when deployed CodewindRolesName = "eclipse-codewind-" + appconstants.VersionNum // CodewindRoleBindingNamePrefix will include the workspaceID when deployed CodewindRoleBindingNamePrefix = "codewind-rolebinding" // CodewindTektonClusterRoleBindingName : Tekton, cluster role binding CodewindTektonClusterRoleBindingName = "codewind-tekton-rolebinding" // CodewindTektonClusterRolesName : Tekton, cluster role CodewindTektonClusterRolesName = "codewind-tekton" // ROKSStorageClass references the storage class to use on ROKS (OpenShift on IKS) ROKSStorageClass = "ibmc-file-bronze" )
const ( // ResourceNotProcessed : Resource not processed ResourceNotProcessed = 0 // ResourceFound : Resource located ResourceFound = 1 // ResourceNotFound : Resource could not be located ResourceNotFound = 2 // ResourceRemoved : Resource was successfully removed ResourceRemoved = 3 // ResourceSkipped : Resource was not removed and was skipped ResourceSkipped = 4 // ResourceRemoveFailed : Resource removal failed ResourceRemoveFailed = 5 )
Variables ¶
var MockCodewind = Codewind{ PFEName: "pfe", PerformanceName: "performance", GatekeeperName: "gatekeeper", KeycloakName: "keycloak", PFEImage: "/pfe-image", PerformanceImage: "performance-image", GatekeeperImage: "gatekeeper-image", KeycloakImage: "keycloak-image", Namespace: "testspace", WorkspaceID: "test-id", PVCName: "test-pvc", ServiceAccountName: "test-sa", ServiceAccountKC: "test-sakc", OwnerReferenceName: "test-refname", Privileged: false, Ingress: "ingress", RequestedIngress: "test-requested-ingress", OnOpenShift: false, }
MockCodewind is a standard configuration for a remote Codewind
Functions ¶
func CreateCodewindRoleBindings ¶
func CreateCodewindRoleBindings(codewindInstance Codewind, deployOptions *DeployOptions, codewindRoleBindingName string) rbacv1.RoleBinding
CreateCodewindRoleBindings : create Codewind role bindings in the deployment namespace
func CreateCodewindRoles ¶
func CreateCodewindRoles(deployOptions *DeployOptions) rbacv1.ClusterRole
CreateCodewindRoles : create Codewind roles
func CreateCodewindServiceAcct ¶
func CreateCodewindServiceAcct(codewind Codewind, deployOptions *DeployOptions) coreV1.ServiceAccount
CreateCodewindServiceAcct : Create service account
func CreateCodewindTektonClusterRoleBindings ¶
func CreateCodewindTektonClusterRoleBindings(codewindInstance Codewind, deployOptions *DeployOptions, roleBindingName string) rbacv1.ClusterRoleBinding
CreateCodewindTektonClusterRoleBindings : create Codewind tekton cluster role bindings
func CreateCodewindTektonClusterRoles ¶
func CreateCodewindTektonClusterRoles(deployOptions *DeployOptions) rbacv1.ClusterRole
CreateCodewindTektonClusterRoles : create Codewind tekton cluster roles
func CreateKeycloakServiceAcct ¶
func CreateKeycloakServiceAcct(codewind Codewind, deployOptions *DeployOptions) coreV1.ServiceAccount
CreateKeycloakServiceAcct : Create service account
func DeployGatekeeper ¶
func DeployGatekeeper(config *restclient.Config, clientset *kubernetes.Clientset, codewindInstance Codewind, deployOptions *DeployOptions) error
DeployGatekeeper : Deploy gatekeepers
func DeployKeycloak ¶
func DeployKeycloak(config *restclient.Config, clientset *kubernetes.Clientset, codewindInstance Codewind, deployOptions *DeployOptions, onOpenShift bool) error
DeployKeycloak : Deploy Keycloak instance
func DeployPFE ¶
func DeployPFE(config *restclient.Config, clientset *kubernetes.Clientset, codewindInstance Codewind, deployOptions *DeployOptions) error
DeployPFE : Deploy PFE instance
func DeployPerformance ¶
func DeployPerformance(clientset *kubernetes.Clientset, codewind Codewind, deployOptions *DeployOptions) error
DeployPerformance takes in a `codewind` object and deploys Codewind and the performance dashboard into the specified namespace
func DeployRemote ¶
func DeployRemote(remoteDeployOptions *DeployOptions) (*DeploymentResult, *RemInstError)
DeployRemote : InstallRemote
func GetExistingDeployments ¶
func GetExistingDeployments(namespace string, clientset kubernetes.Interface) ([]ExistingDeployment, *RemInstError)
GetExistingDeployments returns information about the remote installations of codewind, across all namespaces by default
func GetImages ¶
GetImages returns the images that are to be used for PFE and the Performance dashboard in Codewind If environment vars are set (such as $PFE_IMAGE, $PFE_TAG, $PERFORMANCE_IMAGE, or $PERFORMANCE_TAG), it will use those, otherwise it defaults to the constants defined in constants/default.go
func RemoveRemote ¶
func RemoveRemote(remoteRemovalOptions *RemoveDeploymentOptions) (*RemovalResult, *RemInstError)
RemoveRemote : Remove remote install from Kube
func RemoveRemoteKeycloak ¶
func RemoveRemoteKeycloak(remoteRemovalOptions *RemoveDeploymentOptions) (*RemovalResult, *RemInstError)
RemoveRemoteKeycloak : Remove remote keycloak install from Kube
func SetupKeycloak ¶
func SetupKeycloak(codewindInstance Codewind, deployOptions *DeployOptions) error
SetupKeycloak : sets up keycloak with a realm, client and user
func WaitForPodReady ¶
func WaitForPodReady(clientset *kubernetes.Clientset, codewindInstance Codewind, labelSelector string, podName string) bool
WaitForPodReady : Wait for pod to enter the running phase
Types ¶
type Codewind ¶
type Codewind struct { PFEName string PerformanceName string GatekeeperName string KeycloakName string PFEImage string PerformanceImage string GatekeeperImage string KeycloakImage string Namespace string WorkspaceID string PVCName string ServiceAccountName string ServiceAccountKC string OwnerReferenceName string OwnerReferenceUID types.UID Privileged bool Ingress string RequestedIngress string // resolved where possible or set by cli flag OnOpenShift bool }
Codewind represents a Codewind instance: name, namespace, volume, serviceaccount, and pull secrets
type DeployOptions ¶
type DeployOptions struct { Namespace string IngressDomain string KeycloakUser string KeycloakPassword string KeycloakDevUser string KeycloakDevPassword string KeycloakRealm string KeycloakClient string KeycloakSecure bool KeycloakTLSSecure bool KeycloakURL string KeycloakHost string KeycloakOnly bool GateKeeperTLSSecure bool CodewindSessionSecret string ClientSecret string CodewindPVCSize string LogLevel string }
DeployOptions : Keycloak initial config
type DeploymentResult ¶
DeploymentResult : Ingress root URLs
type ExistingDeployment ¶
type ExistingDeployment struct { WorkspaceID string `json:"workspaceID"` Namespace string `json:"namespace"` CodewindURL string `json:"codewindURL"` Version string `json:"codewindVersion"` InstallDate string `json:"installTime"` CodewindAuthRealm string `json:"codewindAuthRealm"` }
ExistingDeployment describes a remote installation of Codewind
type ImagePullSecret ¶
type ImagePullSecret struct {
Name string `json:"name"`
}
ImagePullSecret represents a Kubernetes imagePullSecret
type K8sAPI ¶
type K8sAPI struct {
// contains filtered or unexported fields
}
K8sAPI is the k8s client called by the function
type RemInstError ¶
RemInstError : Deployment package errors
func (*RemInstError) Error ¶
func (se *RemInstError) Error() string
RemInstError : Error formatted in JSON containing an errorOp and a description from either a fault condition in the CLI, or an error payload from a REST request
type RemovalResult ¶
type RemovalResult struct { // Pods StatusPODGatekeeper int StatusPODPFE int StatusPODPerformance int StatusPODKeycloak int // Services StatusServiceGatekeeper int StatusServicePFE int StatusServicePerformance int StatusServiceKeycloak int // Deployments StatusDeploymentGatekeeper int StatusDeploymentPFE int StatusDeploymentPerformance int StatusDeploymentKeycloak int // Secrets StatusSecretsCodewind int StatusSecretsKeycloak int // Service account StatusServiceAccount int // Role bindings StatusRoleBindings int StatusTektonRoleBindings int // Persistent volume claims StatusPVCCodewind int StatusPVCKeycloak int // Ingress/Routes StatusIngressGatekeeper int StatusIngressKeycloak int }
RemovalResult : Status for each component
type RemoveDeploymentOptions ¶
RemoveDeploymentOptions : Deployment removal options
type ServiceAccountPatch ¶
type ServiceAccountPatch struct {
ImagePullSecrets *[]ImagePullSecret `json:"imagePullSecrets"`
}
ServiceAccountPatch contains an array of imagePullSecrets that will be patched into a Kubernetes service account