Documentation ¶
Overview ¶
Package resources contains Kubernetes resources required by Jenkins
Index ¶
- Constants
- func BuildLabelsForWatchedResources(jenkins v1alpha1.Jenkins) map[string]string
- func BuildResourceLabels(jenkins *v1alpha1.Jenkins) map[string]string
- func ConvertJenkinsContainerToKubernetesContainer(container v1alpha1.Container) corev1.Container
- func GetBaseConfigurationConfigMapName(jenkins *v1alpha1.Jenkins) string
- func GetInitConfigurationConfigMapName(jenkins *v1alpha1.Jenkins) string
- func GetJenkinsHTTPServiceName(jenkins *v1alpha1.Jenkins) string
- func GetJenkinsMasterContainerBaseVolumeMounts() []corev1.VolumeMount
- func GetJenkinsMasterPodBaseEnvs() []corev1.EnvVar
- func GetJenkinsMasterPodBaseVolumes(jenkins *v1alpha1.Jenkins) []corev1.Volume
- func GetJenkinsSlavesServiceName(jenkins *v1alpha1.Jenkins) string
- func GetOperatorCredentialsSecretName(jenkins *v1alpha1.Jenkins) string
- func GetResourceName(jenkins *v1alpha1.Jenkins) string
- func GetUserConfigurationConfigMapName(jenkinsCRName string) string
- func GetUserConfigurationConfigMapNameFromJenkins(jenkins *v1alpha1.Jenkins) string
- func GetUserConfigurationSecretName(jenkinsCRName string) string
- func GetUserConfigurationSecretNameFromJenkins(jenkins *v1alpha1.Jenkins) string
- func NewBaseConfigurationConfigMap(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) *corev1.ConfigMap
- func NewInitConfigurationConfigMap(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) (*corev1.ConfigMap, error)
- func NewJenkinsMasterContainer(jenkins *v1alpha1.Jenkins) corev1.Container
- func NewJenkinsMasterPod(objectMeta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) *corev1.Pod
- func NewOperatorCredentialsSecret(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) *corev1.Secret
- func NewResourceObjectMeta(jenkins *v1alpha1.Jenkins) metav1.ObjectMeta
- func NewRole(meta metav1.ObjectMeta) *v1.Role
- func NewRoleBinding(meta metav1.ObjectMeta) *v1.RoleBinding
- func NewScriptsConfigMap(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) (*corev1.ConfigMap, error)
- func NewServiceAccount(meta metav1.ObjectMeta) *v1.ServiceAccount
- func NewUserConfigurationConfigMap(jenkins *v1alpha1.Jenkins) *corev1.ConfigMap
- func NewUserConfigurationSecret(jenkins *v1alpha1.Jenkins) *corev1.Secret
- func UpdateService(actual corev1.Service, config v1alpha1.Service) corev1.Service
- func VerifyIfLabelsAreSet(object metav1.Object, requiredLabels map[string]string) bool
Constants ¶
const ( // OperatorUserName defines username for Jenkins API calls OperatorUserName = "jenkins-operator" // OperatorCredentialsSecretUserNameKey defines key of username in operator credentials secret OperatorCredentialsSecretUserNameKey = "user" // OperatorCredentialsSecretPasswordKey defines key of password in operator credentials secret OperatorCredentialsSecretPasswordKey = "password" // OperatorCredentialsSecretTokenKey defines key of token in operator credentials secret OperatorCredentialsSecretTokenKey = "token" // OperatorCredentialsSecretTokenCreationKey defines key of token creation time in operator credentials secret OperatorCredentialsSecretTokenCreationKey = "tokenCreationTime" )
const ( // JenkinsMasterContainerName is the Jenkins master container name in pod JenkinsMasterContainerName = "jenkins-master" // JenkinsHomeVolumeName is the Jenkins home volume name JenkinsHomeVolumeName = "home" // JenkinsBaseConfigurationVolumePath is a path where are groovy scripts used to configure Jenkins // this scripts are provided by jenkins-operator JenkinsBaseConfigurationVolumePath = jenkinsPath + "/base-configuration" // JenkinsUserConfigurationVolumePath is a path where are groovy scripts and CasC configs used to configure Jenkins // this script is provided by user JenkinsUserConfigurationVolumePath = jenkinsPath + "/user-configuration" // UserConfigurationSecretVolumePath is a path where are secrets used for groovy scripts and CasC configs UserConfigurationSecretVolumePath = jenkinsPath + "/user-configuration-secrets" // HTTPPortInt defines Jenkins master HTTP port HTTPPortInt = 8080 )
Variables ¶
This section is empty.
Functions ¶
func BuildLabelsForWatchedResources ¶ added in v0.0.4
BuildLabelsForWatchedResources returns labels for Kubernetes resources which operator want to watch resources with that labels should not be deleted after Jenkins CR deletion, to prevent this situation don't set any owner
func BuildResourceLabels ¶
BuildResourceLabels returns labels for all Kubernetes resources created by operator
func ConvertJenkinsContainerToKubernetesContainer ¶ added in v0.0.10
ConvertJenkinsContainerToKubernetesContainer converts Jenkins container to Kubernetes container
func GetBaseConfigurationConfigMapName ¶
GetBaseConfigurationConfigMapName returns name of Kubernetes config map used to base configuration
func GetInitConfigurationConfigMapName ¶
GetInitConfigurationConfigMapName returns name of Kubernetes config map used to init configuration
func GetJenkinsHTTPServiceName ¶ added in v0.0.7
GetJenkinsHTTPServiceName returns Kubernetes service name used for expose Jenkins HTTP endpoint
func GetJenkinsMasterContainerBaseVolumeMounts ¶ added in v0.0.10
func GetJenkinsMasterContainerBaseVolumeMounts() []corev1.VolumeMount
GetJenkinsMasterContainerBaseVolumeMounts returns Jenkins master pod volume mounts required by operator
func GetJenkinsMasterPodBaseEnvs ¶ added in v0.0.8
GetJenkinsMasterPodBaseEnvs returns Jenkins master pod envs required by operator
func GetJenkinsMasterPodBaseVolumes ¶ added in v0.0.10
GetJenkinsMasterPodBaseVolumes returns Jenkins master pod volumes required by operator
func GetJenkinsSlavesServiceName ¶ added in v0.0.7
GetJenkinsSlavesServiceName returns Kubernetes service name used for expose Jenkins slave endpoint
func GetOperatorCredentialsSecretName ¶
GetOperatorCredentialsSecretName returns name of Kubernetes secret used to store jenkins operator credentials to allow calls to Jenkins API
func GetResourceName ¶
GetResourceName returns name of Kubernetes resource base on Jenkins CR
func GetUserConfigurationConfigMapName ¶
GetUserConfigurationConfigMapName returns name of Kubernetes config map used to user configuration
func GetUserConfigurationConfigMapNameFromJenkins ¶ added in v0.0.5
GetUserConfigurationConfigMapNameFromJenkins returns name of Kubernetes config map used to user configuration
func GetUserConfigurationSecretName ¶ added in v0.0.6
GetUserConfigurationSecretName returns name of Kubernetes secret used to store jenkins operator credentials
func GetUserConfigurationSecretNameFromJenkins ¶ added in v0.0.6
GetUserConfigurationSecretNameFromJenkins returns name of Kubernetes secret used to store jenkins operator credentials
func NewBaseConfigurationConfigMap ¶
func NewBaseConfigurationConfigMap(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) *corev1.ConfigMap
NewBaseConfigurationConfigMap builds Kubernetes config map used to base configuration
func NewInitConfigurationConfigMap ¶
func NewInitConfigurationConfigMap(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) (*corev1.ConfigMap, error)
NewInitConfigurationConfigMap builds Kubernetes config map used to init configuration
func NewJenkinsMasterContainer ¶ added in v0.0.10
NewJenkinsMasterContainer returns Jenkins master Kubernetes container
func NewJenkinsMasterPod ¶
NewJenkinsMasterPod builds Jenkins Master Kubernetes Pod resource
func NewOperatorCredentialsSecret ¶
NewOperatorCredentialsSecret builds the Kubernetes secret used to store jenkins operator credentials to allow calls to Jenkins API
func NewResourceObjectMeta ¶
func NewResourceObjectMeta(jenkins *v1alpha1.Jenkins) metav1.ObjectMeta
NewResourceObjectMeta builds ObjectMeta for all Kubernetes resources created by operator
func NewRole ¶
func NewRole(meta metav1.ObjectMeta) *v1.Role
NewRole returns rbac role for jenkins master
func NewRoleBinding ¶
func NewRoleBinding(meta metav1.ObjectMeta) *v1.RoleBinding
NewRoleBinding returns rbac role binding for jenkins master
func NewScriptsConfigMap ¶
func NewScriptsConfigMap(meta metav1.ObjectMeta, jenkins *v1alpha1.Jenkins) (*corev1.ConfigMap, error)
NewScriptsConfigMap builds Kubernetes config map used to store scripts
func NewServiceAccount ¶
func NewServiceAccount(meta metav1.ObjectMeta) *v1.ServiceAccount
NewServiceAccount return kubernetes service account
func NewUserConfigurationConfigMap ¶
NewUserConfigurationConfigMap builds Kubernetes config map used to user configuration
func NewUserConfigurationSecret ¶ added in v0.0.6
NewUserConfigurationSecret builds the Kubernetes secret resource which is used to store user sensitive data for Jenkins configuration
func UpdateService ¶ added in v0.0.7
UpdateService returns new service with override fields from config
Types ¶
This section is empty.