github.com/yrj2011/jx-test-infra@v0.0.0-20190529031832-7a2065ee98eb/experiment/pod.yaml (about) 1 # Sample file for running e2e jobs in k8s 2 # Steps: 3 # 1. Prepare service-account.json and ssh-keys (priv, pub) 4 # 2. Prepare a cluster (`gcloud container clusters create CLUSTER_NAME`) 5 # 3. `kubectl create secret generic service-account --from-file=service-account.json=/path/to/service-account.json` 6 # `kubectl create secret generic ssh-key-secret --from-file=ssh-private=/path/to/rsa --from-file=ssh-public=/path/to/rsa.pub` 7 # 4. Replace JOB_NAME, PROJECT and --timeout in the yaml 8 # *** Point PROJECT to your own GCP project so that it would not conflict with the running job 9 # 5. kubectl create -f pod.yaml 10 # 11 12 apiVersion: v1 13 kind: Pod 14 metadata: 15 name: k8s-e2e 16 spec: 17 containers: 18 - name: k8s-e2e-test 19 image: gcr.io/k8s-testimages/kubekins-e2e-prow:v20170606-e69a3df0 20 args: 21 - "--timeout=60" 22 env: 23 - name: JOB_NAME 24 value: ci-kubernetes-e2e-prow-canary 25 - name: USER 26 value: prow 27 - name: PROJECT 28 value: k8s-jkns-e2e-prow-canary 29 - name: GOOGLE_APPLICATION_CREDENTIALS 30 value: /etc/service-account/service-account.json 31 - name: JENKINS_GCE_SSH_PRIVATE_KEY_FILE 32 value: /etc/ssh-key-secret/ssh-private 33 - name: JENKINS_GCE_SSH_PUBLIC_KEY_FILE 34 value: /etc/ssh-key-secret/ssh-public 35 volumeMounts: 36 - mountPath: /etc/service-account 37 name: service 38 readOnly: true 39 - mountPath: /etc/ssh-key-secret 40 name: ssh 41 readOnly: true 42 volumes: 43 - name: service 44 secret: 45 secretName: "service-account" 46 defaultMode: 0400 47 - name: ssh 48 secret: 49 secretName: "ssh-key-secret" 50 defaultMode: 0400