Add k8s config and credential
Fix gerrit-trigger and credentials
Change-Id: I038cf98717d7617eb7baf25cd2caceccc1a93908
diff --git a/clouds/k8s-infra.yaml.example b/clouds/k8s-infra.yaml.example
deleted file mode 100644
index 927fa19..0000000
--- a/clouds/k8s-infra.yaml.example
+++ /dev/null
@@ -1,53 +0,0 @@
----
-jenkins:
- clouds:
- - kubernetes:
- name: k8s-infra
- connectTimeout: 5
- containerCapStr: 10
- credentialsId: k8s-infra-config
- maxRequestsPerHostStr: 32
- readTimeout: 15
- skipTlsVerify: true
- webSocket: true
- templates:
- - name: dind-infra
- showRawYaml: false
- containers:
- - name: docker
- args: 99d
- command: sleep
- envVars:
- - envVar:
- key: DOCKER_HOST
- value: tcp://localhost:2375
- image: docker:19.03.1
- livenessProbe:
- failureThreshold: 0
- initialDelaySeconds: 0
- periodSeconds: 0
- successThreshold: 0
- timeoutSeconds: 0
- workingDir: /home/jenkins/agent
- - name: docker-daemon
- envVars:
- - envVar:
- key: DOCKER_TLS_CERTDIR
- image: docker:19.03.1-dind
- livenessProbe:
- failureThreshold: 0
- initialDelaySeconds: 0
- periodSeconds: 0
- successThreshold: 0
- timeoutSeconds: 0
- privileged: true
-
-credentials:
- system:
- domainCredentials:
- - credentials:
- - file:
- id: k8s-infra-config
- fileName: k8s-re-jenkins-us-prod.yaml
- secretBytes: ${CRED_K8S_RE_JENKINS_CONFIG_CONTENT}
-
diff --git a/clouds/kubernetes.yaml b/clouds/kubernetes.yaml
new file mode 100644
index 0000000..54a0447
--- /dev/null
+++ b/clouds/kubernetes.yaml
@@ -0,0 +1,67 @@
+---
+jenkins:
+ clouds:
+ - kubernetes:
+ name: "k8s-sandbox"
+ connectTimeout: 5
+ containerCapStr: "10"
+ credentialsId: "k8s-sandbox-token"
+ maxRequestsPerHostStr: "32"
+ readTimeout: 15
+ serverUrl: ${K8S_SERVICE_URL}
+ skipTlsVerify: true
+ webSocket: true
+ templates:
+ - name: "dind1"
+ showRawYaml: true
+ containers:
+ - name: "docker"
+ args: "99d"
+ command: "sleep"
+ envVars:
+ - envVar:
+ key: "DOCKER_HOST"
+ value: "tcp://localhost:2375"
+ image: "docker:19.03.1"
+ livenessProbe:
+ failureThreshold: 0
+ initialDelaySeconds: 0
+ periodSeconds: 0
+ successThreshold: 0
+ timeoutSeconds: 0
+ workingDir: "/home/jenkins/agent"
+ - name: "docker-daemon"
+ envVars:
+ - envVar:
+ key: "DOCKER_TLS_CERTDIR"
+ image: "docker:19.03.1-dind"
+ livenessProbe:
+ failureThreshold: 0
+ initialDelaySeconds: 0
+ periodSeconds: 0
+ successThreshold: 0
+ timeoutSeconds: 0
+ privileged: true
+ - name: "dind2"
+ showRawYaml: false
+ yaml: |
+ apiVersion: v1
+ kind: Pod
+ spec:
+ containers:
+ - name: docker
+ image: docker:19.03.1
+ command:
+ - sleep
+ args:
+ - 99d
+ env:
+ - name: DOCKER_HOST
+ value: tcp://localhost:2375
+ - name: docker-daemon
+ image: docker:19.03.1-dind
+ securityContext:
+ privileged: true
+ env:
+ - name: DOCKER_TLS_CERTDIR
+ value: ""
diff --git a/credentials/infra.yaml b/credentials/infra.yaml
index 32da38e..6e9afca 100644
--- a/credentials/infra.yaml
+++ b/credentials/infra.yaml
@@ -5,7 +5,7 @@
- credentials:
- basicSSHUserPrivateKey:
id: sandbox-jenkins
- username: sandbox-jenkins
+ username: sandbox
description: >
Jenkins Sandbox master SSH key
privateKeySource:
@@ -48,7 +48,10 @@
privateKey: ${CRED_SANDBOX_CI_SSH_KEY}
- usernamePassword:
id: jjb-update
- username: sandbox-jenkins
- password: ${CRED_JJB_UPDATE_PASSWORD}
+ username: sandbox
+ password: password
description: |
Credentials to update jenkins-jobs
+ - string:
+ id: k8s-sandbox-token
+ secret: ${CRED_JENKINS_KUBERNETES_TOKEN}
diff --git a/jenkins.yaml b/jenkins.yaml
index 72b8d08..a04d53f 100644
--- a/jenkins.yaml
+++ b/jenkins.yaml
@@ -37,7 +37,7 @@
- envVars:
env:
- key: K8S_CLUSTER
- value: 'k8s-infra'
+ value: 'k8s-sandbox'
- key: GIT_AUTHOR_NAME
value: 'Sandbox CI'
- key: GIT_AUTHOR_EMAIL
diff --git a/plugins/gerrit-trigger.syml b/plugins/gerrit-trigger.syml
index 8ea7d47..2a21214 100644
--- a/plugins/gerrit-trigger.syml
+++ b/plugins/gerrit-trigger.syml
@@ -5,7 +5,7 @@
numberOfSendingWorkerThreads: 1
replicationCacheExpirationInMinutes: 360
servers:
- mcp-gerrit:
+ sandbox-gerrit:
noConnectionOnStartup: false
gerritHostName: sandbox-gerrit
gerritFrontEndUrl: https://sandbox-gerrit/