Hello guys, first thanks for the plugin!!!
So I am using the GoCD Chart to deploy my cluster and also elastic actors, I've followed the steps to configure the plugin and it was working with the demo that comes with the chart that uses elastic agents
So I created the following profile, name jdk-8-mvn-helm which is the bundle I need.
`apiVersion: v1
kind: Pod
metadata:
name: jdk8-{{ POD_POSTFIX }}
labels:
app: web
spec:
containers:
- name: gocd-agent-container-{{ CONTAINER_POSTFIX }}
image: travix/gocd-agent-gcloud-jdk-8:18.6.0
securityContext:
privileged: true
volumeMounts:
- name: ssh-secrets
mountPath: /var/go/.ssh
readOnly: false
- name: m2
mountPath: /var/go/.m2/repository
subPath: repository
readOnly: false
- name: m2-config-volume
mountPath: /var/go/.m2
readOnly: false
volumes:
- name: m2-config-volume
configMap:
name: m2-config
items:
- key: settings.xml
path: settings.xml
mode: 511
- name: m2
emptyDir: {}
- name: ssh-secrets
secret:
secretName: gocd-ssh
defaultMode: 384`
And added it to my Job, so it now shows Elastic Profile Id as jdk-8-mvn-helm
When it is started, I see the creation of the container in my minikube, but my job never runs and just hang forever in an unassigned state.
In the server logs I get this exception
2018-07-19 14:00:04,674 WARN [qtp32863545-29] HttpChannel:568 - /go java.lang.IllegalStateException: Committed at org.eclipse.jetty.server.HttpChannel.resetBuffer(HttpChannel.java:841) at org.eclipse.jetty.server.HttpOutput$Interceptor.resetBuffer(HttpOutput.java:116) at org.eclipse.jetty.server.HttpOutput.resetBuffer(HttpOutput.java:928) at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1312) at org.eclipse.jetty.server.Response.sendRedirect(Response.java:720) at org.eclipse.jetty.server.Response.sendRedirect(Response.java:729) at org.eclipse.jetty.server.handler.ContextHandler.checkContext(ContextHandler.java:1048) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1100) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:527) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:530) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626) at java.lang.Thread.run(Thread.java:748) 2018-07-19 14:00:05,047 WARN [qtp32863545-25] HttpChannel:568 - /go java.lang.IllegalStateException: Committed at org.eclipse.jetty.server.HttpChannel.resetBuffer(HttpChannel.java:841) at org.eclipse.jetty.server.HttpOutput$Interceptor.resetBuffer(HttpOutput.java:116) at org.eclipse.jetty.server.HttpOutput.resetBuffer(HttpOutput.java:928) at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1312) at org.eclipse.jetty.server.Response.sendRedirect(Response.java:720) at org.eclipse.jetty.server.Response.sendRedirect(Response.java:729) at org.eclipse.jetty.server.handler.ContextHandler.checkContext(ContextHandler.java:1048) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1100) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:527) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:530) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626) at java.lang.Thread.run(Thread.java:748)
here is the log before this exception on a manual start
`2018-07-19 13:59:57,124 INFO [qtp32863545-23] PipelineTriggerService:44 - [Pipeline Schedule] [Requested] Manual trigger of pipeline 'StocksCash' requested by anonymous
2018-07-19 13:59:57,127 INFO [qtp32863545-23] PipelineTriggerService:47 - [Pipeline Schedule] [Accepted] Manual trigger of pipeline 'StocksCash' accepted for user anonymous
2018-07-19 13:59:57,131 INFO [qtp32863545-23] PipelineTriggerService:49 - [Pipeline Schedule] [Processed] Manual trigger of pipeline 'StocksCash' processed with result 'com.thoughtworks.go.serverhealth.ServerHealthState@1ede2708[healthStateLevel=OK,type=<HealthStateType ARTIFACTS_DISK_FULL LogScope[GLOBAL, scope=GLOBAL]>,message=,description=,expiryTime=,timestamp=Thu Jul 19 13:59:57 GMT 2018]'
2018-07-19 13:59:59,884 INFO [ThreadPoolTaskScheduler-10] ScheduleService:155 - [Pipeline Schedule] Scheduling pipeline StocksCash with build cause [ManualForcedBuildCause: Forced by anonymous]
2018-07-19 13:59:59,889 INFO [ThreadPoolTaskScheduler-10] PipelineRepository:86 - Start updating pipeline timeline
2018-07-19 13:59:59,893 INFO [ThreadPoolTaskScheduler-10] PipelineRepository:92 - Pipeline timeline updated
2018-07-19 14:00:00,569 INFO [152@MessageListener for ServerPingListener] p.c.g.c.e.k.c.g.c.e.KubernetesPlugin:73 [plugin-cd.go.contrib.elasticagent.kubernetes] - [refresh-pod-state] Pod information successfully synced. All(Running/Pending) pod count is 4.
2018-07-19 14:00:03,749 INFO [149@MessageListener for CreateAgentListener] p.c.g.c.e.k.c.g.c.e.KubernetesPlugin:73 [plugin-cd.go.contrib.elasticagent.kubernetes] - [refresh-pod-state] Pod information successfully synced. All(Running/Pending) pod count is 4.
2018-07-19 14:00:03,759 INFO [149@MessageListener for CreateAgentListener] p.c.g.c.e.k.c.g.c.e.KubernetesPlugin:73 [plugin-cd.go.contrib.elasticagent.kubernetes] - [Create Agent] Creating K8s pod with spec: Pod(apiVersion=v1, kind=Pod, metadata=ObjectMeta(annotations={Privileged=true, MaxCPU=, Environment=GO_SERVER_URL=https://10.98.122.134:8154/go
GO_EA_SERVER_URL=https://10.98.122.134:8154/go, Elastic-Agent-Job-Identifier={"pipeline_name":"StocksCash","pipeline_counter":34,"pipeline_label":"34","stage_name":"Build","stage_counter":"1","job_name":"Test","job_id":74}, Image=travix/gocd-agent-gcloud-jdk-8:18.6.0, PodConfiguration=apiVersion: v1
kind: Pod
metadata:
name: jdk8-{{ POD_POSTFIX }}
labels:
app: web
spec:
containers:
- name: gocd-agent-container-{{ CONTAINER_POSTFIX }}
image: travix/gocd-agent-gcloud-jdk-8:18.6.0
securityContext:
privileged: true
volumeMounts:
- name: ssh-secrets
mountPath: /var/go/.ssh
readOnly: false
- name: m2
mountPath: /var/go/.m2/repository
subPath: repository
readOnly: false
- name: m2-config-volume
mountPath: /var/go/.m2
readOnly: false
volumes:
- name: m2-config-volume
configMap:
name: m2-config
items:
- key: settings.xml
path: settings.xml
mode: 511
- name: m2
emptyDir: {}
- name: ssh-secrets
secret:
secretName: gocd-ssh
defaultMode: 384, SpecifiedUsingPodConfiguration=true, MaxMemory=512M}, clusterName=null, creationTimestamp=2018-07-19T14:00:03Z, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, initializers=null, labels={app=web, Elastic-Agent-Created-By=cd.go.contrib.elasticagent.kubernetes, Elastic-Agent-Job-Id=74, kind=kubernetes-elastic-agent, Elastic-Agent-Environment-Name=Local}, name=jdk8-7026b4f2-bd3e-429d-ad5e-347e2faefc24, namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=PodSpec(activeDeadlineSeconds=null, affinity=null, automountServiceAccountToken=null, containers=[Container(args=[], command=[], env=[EnvVar(name=GO_EA_SERVER_URL, value=https://gocd-server:8154/go, valueFrom=null, additionalProperties={}), EnvVar(name=GO_SERVER_URL, value=https://10.98.122.134:8154/go, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_SERVER_URL, value=https://10.98.122.134:8154/go, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_KEY, value=2f490bd3-7efe-4b82-aa5a-9ac02d428e3a, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_ENVIRONMENT, value=Local, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_ELASTIC_AGENT_ID, value=jdk8-7026b4f2-bd3e-429d-ad5e-347e2faefc24, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_ELASTIC_PLUGIN_ID, value=cd.go.contrib.elasticagent.kubernetes, valueFrom=null, additionalProperties={})], envFrom=[], image=travix/gocd-agent-gcloud-jdk-8:18.6.0, imagePullPolicy=null, lifecycle=null, livenessProbe=null, name=gocd-agent-container-ef11c349-256e-4dd4-943e-5e5374bec29c, ports=[], readinessProbe=null, resources=null, securityContext=SecurityContext(capabilities=null, privileged=true, readOnlyRootFilesystem=null, runAsNonRoot=null, runAsUser=null, seLinuxOptions=null, additionalProperties={}), stdin=null, stdinOnce=null, terminationMessagePath=null, terminationMessagePolicy=null, tty=null, volumeMounts=[VolumeMount(mountPath=/var/go/.ssh, name=ssh-secrets, readOnly=false, subPath=null, additionalProperties={}), VolumeMount(mountPath=/var/go/.m2/repository, name=m2, readOnly=false, subPath=repository, additionalProperties={}), VolumeMount(mountPath=/var/go/.m2, name=m2-config-volume, readOnly=false, subPath=null, additionalProperties={})], workingDir=null, additionalProperties={})], dnsPolicy=null, hostAliases=[], hostIPC=null, hostNetwork=null, hostPID=null, hostname=null, imagePullSecrets=[], initContainers=[], nodeName=null, nodeSelector=null, restartPolicy=null, schedulerName=null, securityContext=null, serviceAccount=null, serviceAccountName=null, subdomain=null, terminationGracePeriodSeconds=null, tolerations=[], volumes=[Volume(awsElasticBlockStore=null, azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=ConfigMapVolumeSource(defaultMode=null, items=[KeyToPath(key=settings.xml, mode=511, path=settings.xml, additionalProperties={})], name=m2-config, optional=null, additionalProperties={}), downwardAPI=null, emptyDir=null, fc=null, flexVolume=null, flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, hostPath=null, iscsi=null, name=m2-config-volume, nfs=null, persistentVolumeClaim=null, photonPersistentDisk=null, portworxVolume=null, projected=null, quobyte=null, rbd=null, scaleIO=null, secret=null, storageos=null, vsphereVolume=null, additionalProperties={}), Volume(awsElasticBlockStore=null, azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=null, downwardAPI=null, emptyDir=EmptyDirVolumeSource(medium=null, sizeLimit=null, additionalProperties={}), fc=null, flexVolume=null, flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, hostPath=null, iscsi=null, name=m2, nfs=null, persistentVolumeClaim=null, photonPersistentDisk=null, portworxVolume=null, projected=null, quobyte=null, rbd=null, scaleIO=null, secret=null, storageos=null, vsphereVolume=null, additionalProperties={}), Volume(awsElasticBlockStore=null, azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=null, downwardAPI=null, emptyDir=null, fc=null, flexVolume=null, flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, hostPath=null, iscsi=null, name=ssh-secrets, nfs=null, persistentVolumeClaim=null, photonPersistentDisk=null, portworxVolume=null, projected=null, quobyte=null, rbd=null, scaleIO=null, secret=SecretVolumeSource(defaultMode=384, items=[], optional=null, secretName=gocd-ssh, additionalProperties={}), storageos=null, vsphereVolume=null, additionalProperties={})], additionalProperties={}), status=null, additionalProperties={}).
2018-07-19 14:00:03,777 INFO [148@MessageListener for CreateAgentListener] p.c.g.c.e.k.c.g.c.e.KubernetesPlugin:73 [plugin-cd.go.contrib.elasticagent.kubernetes] - [refresh-pod-state] Pod information successfully synced. All(Running/Pending) pod count is 5.
2018-07-19 14:00:03,788 INFO [148@MessageListener for CreateAgentListener] p.c.g.c.e.k.c.g.c.e.KubernetesPlugin:73 [plugin-cd.go.contrib.elasticagent.kubernetes] - [Create Agent] Creating K8s pod with spec: Pod(apiVersion=v1, kind=Pod, metadata=ObjectMeta(annotations={Privileged=true, MaxCPU=, Environment=GO_SERVER_URL=https://10.98.122.134:8154/go
GO_EA_SERVER_URL=https://10.98.122.134:8154/go, Elastic-Agent-Job-Identifier={"pipeline_name":"StocksCash","pipeline_counter":34,"pipeline_label":"34","stage_name":"Build","stage_counter":"1","job_name":"Build","job_id":73}, Image=travix/gocd-agent-gcloud-jdk-8:18.6.0, PodConfiguration=apiVersion: v1
kind: Pod
metadata:
name: jdk8-{{ POD_POSTFIX }}
labels:
app: web
spec:
containers:
- name: gocd-agent-container-{{ CONTAINER_POSTFIX }}
image: travix/gocd-agent-gcloud-jdk-8:18.6.0
securityContext:
privileged: true
volumeMounts:
- name: ssh-secrets
mountPath: /var/go/.ssh
readOnly: false
- name: m2
mountPath: /var/go/.m2/repository
subPath: repository
readOnly: false
- name: m2-config-volume
mountPath: /var/go/.m2
readOnly: false
volumes:
- name: m2-config-volume
configMap:
name: m2-config
items:
- key: settings.xml
path: settings.xml
mode: 511
- name: m2
emptyDir: {}
- name: ssh-secrets
secret:
secretName: gocd-ssh
defaultMode: 384, SpecifiedUsingPodConfiguration=true, MaxMemory=512M}, clusterName=null, creationTimestamp=2018-07-19T14:00:03Z, deletionGracePeriodSeconds=null, deletionTimestamp=null, finalizers=[], generateName=null, generation=null, initializers=null, labels={app=web, Elastic-Agent-Created-By=cd.go.contrib.elasticagent.kubernetes, Elastic-Agent-Job-Id=73, kind=kubernetes-elastic-agent, Elastic-Agent-Environment-Name=Local}, name=jdk8-8fdb7961-8346-4113-a502-78f3a9ed64a7, namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null, uid=null, additionalProperties={}), spec=PodSpec(activeDeadlineSeconds=null, affinity=null, automountServiceAccountToken=null, containers=[Container(args=[], command=[], env=[EnvVar(name=GO_EA_SERVER_URL, value=https://gocd-server:8154/go, valueFrom=null, additionalProperties={}), EnvVar(name=GO_SERVER_URL, value=https://10.98.122.134:8154/go, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_SERVER_URL, value=https://10.98.122.134:8154/go, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_KEY, value=2f490bd3-7efe-4b82-aa5a-9ac02d428e3a, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_ENVIRONMENT, value=Local, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_ELASTIC_AGENT_ID, value=jdk8-8fdb7961-8346-4113-a502-78f3a9ed64a7, valueFrom=null, additionalProperties={}), EnvVar(name=GO_EA_AUTO_REGISTER_ELASTIC_PLUGIN_ID, value=cd.go.contrib.elasticagent.kubernetes, valueFrom=null, additionalProperties={})], envFrom=[], image=travix/gocd-agent-gcloud-jdk-8:18.6.0, imagePullPolicy=null, lifecycle=null, livenessProbe=null, name=gocd-agent-container-f3dfb3b4-a78d-427d-b185-6a3af58a476d, ports=[], readinessProbe=null, resources=null, securityContext=SecurityContext(capabilities=null, privileged=true, readOnlyRootFilesystem=null, runAsNonRoot=null, runAsUser=null, seLinuxOptions=null, additionalProperties={}), stdin=null, stdinOnce=null, terminationMessagePath=null, terminationMessagePolicy=null, tty=null, volumeMounts=[VolumeMount(mountPath=/var/go/.ssh, name=ssh-secrets, readOnly=false, subPath=null, additionalProperties={}), VolumeMount(mountPath=/var/go/.m2/repository, name=m2, readOnly=false, subPath=repository, additionalProperties={}), VolumeMount(mountPath=/var/go/.m2, name=m2-config-volume, readOnly=false, subPath=null, additionalProperties={})], workingDir=null, additionalProperties={})], dnsPolicy=null, hostAliases=[], hostIPC=null, hostNetwork=null, hostPID=null, hostname=null, imagePullSecrets=[], initContainers=[], nodeName=null, nodeSelector=null, restartPolicy=null, schedulerName=null, securityContext=null, serviceAccount=null, serviceAccountName=null, subdomain=null, terminationGracePeriodSeconds=null, tolerations=[], volumes=[Volume(awsElasticBlockStore=null, azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=ConfigMapVolumeSource(defaultMode=null, items=[KeyToPath(key=settings.xml, mode=511, path=settings.xml, additionalProperties={})], name=m2-config, optional=null, additionalProperties={}), downwardAPI=null, emptyDir=null, fc=null, flexVolume=null, flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, hostPath=null, iscsi=null, name=m2-config-volume, nfs=null, persistentVolumeClaim=null, photonPersistentDisk=null, portworxVolume=null, projected=null, quobyte=null, rbd=null, scaleIO=null, secret=null, storageos=null, vsphereVolume=null, additionalProperties={}), Volume(awsElasticBlockStore=null, azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=null, downwardAPI=null, emptyDir=EmptyDirVolumeSource(medium=null, sizeLimit=null, additionalProperties={}), fc=null, flexVolume=null, flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, hostPath=null, iscsi=null, name=m2, nfs=null, persistentVolumeClaim=null, photonPersistentDisk=null, portworxVolume=null, projected=null, quobyte=null, rbd=null, scaleIO=null, secret=null, storageos=null, vsphereVolume=null, additionalProperties={}), Volume(awsElasticBlockStore=null, azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=null, downwardAPI=null, emptyDir=null, fc=null, flexVolume=null, flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, hostPath=null, iscsi=null, name=ssh-secrets, nfs=null, persistentVolumeClaim=null, photonPersistentDisk=null, portworxVolume=null, projected=null, quobyte=null, rbd=null, scaleIO=null, secret=SecretVolumeSource(defaultMode=384, items=[], optional=null, secretName=gocd-ssh, additionalProperties={}), storageos=null, vsphereVolume=null, additionalProperties={})], additionalProperties={}), status=null, additionalProperties={}).
`