github.com/alloyci/alloy-runner@v1.0.1-0.20180222164613-925503ccafd6/docs/install/kubernetes.md (about)

     1  # Run AlloyCI Runner on a Kubernetes cluster
     2  
     3  To get started with the AlloyCI Runner on Kubernetes you need to define
     4  resources that you can then push to the cluster with `kubectl`.
     5  
     6  A recommended approach to this is to create a `ConfigMap` in Kubernetes such as
     7  the following:
     8  
     9  ```yaml
    10  apiVersion: v1
    11  kind: ConfigMap
    12  metadata:
    13    name: gitlab-runner
    14    namespace: gitlab
    15  data:
    16    config.toml: |
    17      concurrent = 4
    18  
    19      [[runners]]
    20        name = "Kubernetes Runner"
    21        url = "https://gitlab.com/ci"
    22        token = "...."
    23        executor = "kubernetes"
    24        [runners.kubernetes]
    25          namespace = "gitlab"
    26          image = "busybox"
    27  ```
    28  
    29  Where `image` (optional) is the default Docker image to run jobs on top of.
    30  
    31  >**Note:**
    32  The `token` can be found in `/etc/gitlab-runner/config.toml` and should
    33  have been generated after registering the Runner. It's not to be confused
    34  with the registration token that can be found under your project's
    35  **Settings > CI/CD > Runners settings**.
    36  
    37  
    38  
    39  Then create a `Deployment` or `ReplicationController` which uses the `ConfigMap`.
    40  This is an example of a `Deployment`:
    41  
    42  ```yaml
    43  apiVersion: extensions/v1beta1
    44  kind: Deployment
    45  metadata:
    46    name: gitlab-runner
    47    namespace: gitlab
    48  spec:
    49    replicas: 1
    50    selector:
    51      matchLabels:
    52        name: gitlab-runner
    53    template:
    54      metadata:
    55        labels:
    56          name: gitlab-runner
    57      spec:
    58        containers:
    59        - args:
    60          - run
    61          image: gitlab/gitlab-runner:latest
    62          imagePullPolicy: Always
    63          name: gitlab-runner
    64          volumeMounts:
    65          - mountPath: /etc/gitlab-runner
    66            name: config
    67          - mountPath: /etc/ssl/certs
    68            name: cacerts
    69            readOnly: true
    70        restartPolicy: Always
    71        volumes:
    72        - configMap:
    73            name: gitlab-runner
    74          name: config
    75        - hostPath:
    76            path: /usr/share/ca-certificates/mozilla
    77          name: cacerts
    78  ```
    79  
    80  For more details see [Kubernetes executor](../executors/kubernetes.md)
    81  and the [[runners.kubernetes] section of advanced configuration](../configuration/advanced-configuration.md#the-runners-kubernetes-section).