Fix: Rename tox job and remove pre-commit
[releng/global-jjb.git] / docs / jjb / lf-openstack-kubernetes.rst
1 #############################
2 OpenStack Magnum (Kubernetes)
3 #############################
4
5 This section contains a series of macros for projects that need to spin up
6 kubernetes clusters using JJB.
7
8 Job Setup
9 =========
10
11 The two macros :ref:`lf-kubernetes-create` & :ref:`lf-kubernetes-delete` are
12 companion macros and used together when constructing a job template that needs
13 a kubernetes cluster.
14
15 Example Usage:
16
17 .. code-block:: yaml
18
19    - job-template:
20        name: k8s-test
21
22        #####################
23        # Default variables #
24        #####################
25
26        base-image: Fedora Atomic 29 [2019-08-20]
27        boot-volume-size: 10
28        cluster-settle-time: 1m
29        docker-volume-size: 10
30        fixed-network: ecompci
31        fixed-subnet: ecompci-subnet1
32        keypair: jenkins
33        kubernetes-version: v1.16.0
34        master-count: 1
35        master-flavor: v2-standard-1
36        node-count: 2
37        node-flavor: v2-highcpu-8
38        openstack-cloud: vex
39
40        #####################
41        # Job configuration #
42        #####################
43
44        builders:
45          - lf-infra-pre-build
46          - lf-kubernetes-create:
47              openstack-cloud: "{openstack-cloud}"
48              base-image: "{base-image}"
49              boot-volume-size: "{boot-volume-size}"
50              cluster-settle-time: "{cluster-settle-time}"
51              docker-volume-size: "{docker-volume-size}"
52              fixed-network: "{fixed-network}"
53              fixed-subnet: "{fixed-subnet}"
54              keypair: "{keypair}"
55              kubernetes-version: "{kubernetes-version}"
56              master-count: "{master-count}"
57              master-flavor: "{master-flavor}"
58              node-count: "{node-count}"
59              node-flavor: "{node-flavor}"
60        publishers:
61          - lf-kubernetes-delete
62
63
64 Macros
65 ======
66
67 .. _lf-kubernetes-create:
68
69 lf-kubernetes-create
70 --------------------
71
72 Creates an OpenStack Kubernetes cluster as configured by the job. Name pattern
73 of stack is ``$SILO-$JOB_NAME-$BUILD_NUMBER``.
74
75 Requires ``lf-infra-pre-build`` macro to run first to install the
76 ``openstack`` and ``lftools`` packages.
77
78 Requires a Config File Provider configuration for clouds.yaml named
79 ``clouds-yaml``.
80
81 :Required Parameters:
82
83     :openstack-cloud: The ``OS_CLOUD`` variable to pass to OpenStack client.
84         (Docs: https://docs.openstack.org/python-openstackclient)
85     :base-image: The base image to use for building the cluster. LF is
86         using the Fedora Atomic images.
87     :boot-volume-size: The size of the operating system disk for each node.
88     :cluster-settle-time: A parameter that controls the buffer time after
89         cluster creation before we start querying the API for status.
90     :docker-volume-size: The size of the Docker volume.
91     :fixed-network: The private network to build the cluster on.
92     :fixed-subnet: The subnet to use from the above private network
93     :keypair: The ssh keypair to inject into the nodes for access.
94     :kubernetes-version: The version of kubernetes to use for the cluster.
95         Available versions are v1.14, v1.15, and v1.16
96     :master-count: The number of masters for the cluster (configuring more than
97         one master automatically triggers the creation of a load-balancer).
98     :master-flavor: The flavor (size) of the master node.
99     :node-count: The number of kubernetes nodes for the cluster.
100     :node-flavor: The flavor (size) of the worker nodes.
101
102
103 .. _lf-kubernetes-delete:
104
105 lf-kubernetes-delete
106 --------------------
107
108 Deletes the stack associated with this job. Name pattern of stack is
109 ``$SILO-$JOB_NAME-$BUILD_NUMBER``.
110
111 Requires ``lf-infra-pre-build`` macro to run first to install the
112 ``openstack`` and ``lftools`` packages.
113
114 Requires a Config File Provider configuration for clouds.yaml named
115 ``clouds-yaml``.