[JIRA] (JENKINS-52530) Kubernetes plugin to provide option to overwrite hostname in podtemplate

2 views
Skip to first unread message

writetovaseem@gmail.com (JIRA)

unread,
Jul 12, 2018, 5:58:02 PM7/12/18
to jenkinsc...@googlegroups.com
NOOR MOHAMED NAINAMOHAMED created an issue
 
Jenkins / Bug JENKINS-52530
Kubernetes plugin to provide option to overwrite hostname in podtemplate
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2018-07-12 21:57
Environment: Jenkins ver. 2.60.3
Kubernetes plugin - 1.8.4
Priority: Major Major
Reporter: NOOR MOHAMED NAINAMOHAMED

if hostname is a added to the specs, container shell couldn't locate the hostname. Since jenkins slave sets pod name as hostname. Keeping both same as same. Is there a way to overwrite only hostname within a podname. Kubernetes support it where podname and hostname can be different. usecase is to have different podname and hostname. Trying to keep hostname as consistent for a build activity trying to avoid rebuild as build records hostname information in its objects.

Detail of the podtemplate used

------------
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(name: "myname", label: label, defaultContainer: "busybox", namespace: "noormohamed", yaml: """
apiVersion: v1
kind: Pod
metadata:
labels:
label: build
spec:
hostname: myhostname
containers:

  • name: maven
    image: maven:alpine
    command:
  • cat
    tty: true
  • name: busybox
    image: busybox
    command:
  • cat
    tty: true
    """
    ) {
    node (label)
    Unknown macro: { container('maven') { sh 'hostname' sh 'mvn -version' } container('busybox') { sh 'hostname' sh '/bin/busybox' } }

    }

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

writetovaseem@gmail.com (JIRA)

unread,
Jul 12, 2018, 6:04:03 PM7/12/18
to jenkinsc...@googlegroups.com

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Jul 13, 2018, 3:45:02 AM7/13/18
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:44:12 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
Change By: Jesse Glick
Assignee: Carlos Sanchez
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages