diff --git a/infra/jenkins-cluster/deployment-jenkins.yaml b/infra/jenkins-cluster/deployment-jenkins.yaml new file mode 100644 index 000000000000..fb89b53d77c7 --- /dev/null +++ b/infra/jenkins-cluster/deployment-jenkins.yaml @@ -0,0 +1,57 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: jenkins-master +spec: + replicas: 1 + template: + metadata: + name: jenkins-master + labels: + app: jenkins-master + spec: + containers: + - name: jenkins + image: jenkinsci/jenkins +# command: +# - "/bin/tini" +# - "--" +# - "/usr/local/bin/jenkins.sh" + env: +# - name: KUB_POD_NAME +# valueFrom: +# fieldRef: +# fieldPath: metadata.name +# - name: KUB_POD_IP +# valueFrom: +# fieldRef: +# fieldPath: status.podIP + - name: JAVA_OPTS + value: "-Duser.timezone=America/Los_Angeles -Dhudson.security.csrf.requestfield=Jenkins-Crumb" + ports: + - containerPort: 8080 + - containerPort: 50000 + volumeMounts: + - name: jenkins-home + mountPath: "/var/jenkins_home" + livenessProbe: + httpGet: + path: "/login" + port: 8080 + initialDelaySeconds: 60 + timeoutSeconds: 15 + resources: + requests: + memory: "4Gi" + cpu: "4" + - name: kubectl-proxy + image: lachlanevenson/k8s-kubectl + args: + - "proxy" + - "-p" + - "8081" + volumes: + - name: jenkins-home + gcePersistentDisk: + pdName: jenkins-home + fsType: ext4 diff --git a/infra/jenkins-cluster/jenkins.yaml b/infra/jenkins-cluster/jenkins.yaml deleted file mode 100644 index e60668c2a71b..000000000000 --- a/infra/jenkins-cluster/jenkins.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: jenkins -spec: - replicas: 1 - template: - metadata: - name: jenkins-master - labels: - app: jenkins-master - spec: - containers: - - name: jenkins - image: gcr.io/meta-iterator-105109/jenkins - env: - - name: KUB_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: KUB_POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: JAVA_OPTS - value: "-Duser.timezone=America/Los_Angeles" - ports: - - containerPort: 8080 - - containerPort: 50000 - volumeMounts: - - name: jenkins-home - mountPath: "/var/jenkins_home" - - name: docker-sock - mountPath: "/var/run/docker.sock" - # - name: dockerhub-login-secret - # mountPath: "/var/secrets/dockerhub-login" - livenessProbe: - httpGet: - path: "/login" - port: 8080 - initialDelaySeconds: 60 - timeoutSeconds: 15 - resources: - requests: - memory: "4Gi" - securityContext: - privileged: true - volumes: - - name: jenkins-home - gcePersistentDisk: - pdName: oss-cluster-jenkins-work - fsType: ext4 - - name: docker-sock - hostPath: - path: /var/run/docker.sock - # - name: dockerhub-login-secret - # secret: - # secretName: dockerhub-login diff --git a/infra/jenkins-cluster/Dockerfile b/infra/jenkins-cluster/server/Dockerfile similarity index 100% rename from infra/jenkins-cluster/Dockerfile rename to infra/jenkins-cluster/server/Dockerfile diff --git a/infra/jenkins-cluster/service-jenkins-master.yaml b/infra/jenkins-cluster/service-jenkins-master.yaml index a9815ddc5ada..1e4d58a44552 100644 --- a/infra/jenkins-cluster/service-jenkins-master.yaml +++ b/infra/jenkins-cluster/service-jenkins-master.yaml @@ -5,11 +5,11 @@ metadata: labels: app: jenkins-master spec: - type: NodePort selector: app: jenkins-master ports: - - port: 50000 - targetPort: 50000 - nodePort: 31001 - protocol: TCP + - name: agent + port: 50000 + - name: http + port: 80 + targetPort: 8080 diff --git a/infra/jenkins-slave/Dockerfile b/infra/jenkins-cluster/slave/Dockerfile similarity index 100% rename from infra/jenkins-slave/Dockerfile rename to infra/jenkins-cluster/slave/Dockerfile diff --git a/infra/jenkins-slave/dockerd-entrypoint.sh b/infra/jenkins-cluster/slave/dockerd-entrypoint.sh similarity index 100% rename from infra/jenkins-slave/dockerd-entrypoint.sh rename to infra/jenkins-cluster/slave/dockerd-entrypoint.sh diff --git a/infra/jenkins-slave/jenkins-slave b/infra/jenkins-cluster/slave/jenkins-slave similarity index 100% rename from infra/jenkins-slave/jenkins-slave rename to infra/jenkins-cluster/slave/jenkins-slave diff --git a/infra/jenkins-slave/startup.sh b/infra/jenkins-cluster/slave/startup.sh similarity index 100% rename from infra/jenkins-slave/startup.sh rename to infra/jenkins-cluster/slave/startup.sh