Files
nodepool/nodepool/tests/fixtures/config_validate/good.yaml
Matthieu Huin 7a072ade9a Openshift/pods drivers: refactor, fix doc
the openshiftpods driver had some duplicated code from
the openshift driver that wasn't working as expected; the
main issues being:

1. the 'max-pods' config field wasn't taken into account
2. the 'max-servers' config field didn't pass the config validator
   despite being correct

This refactor fixes both issues and removes redundant code, which
should improve maintainability in the future.

Add validation to ensure aliases are mutually exclusive in these
providers' configurations.

Add testing to validate this behavior.

Change-Id: Iea8c898c4c2ce61d138d280bd2fadd9cbe8e8b61
2024-11-25 18:44:39 +01:00

307 lines
7.3 KiB
YAML

elements-dir: /etc/nodepool/elements
images-dir: /opt/nodepool_dib
webapp:
port: %(NODEPOOL_PORT)
listen_address: '0.0.0.0'
zookeeper-servers:
- host: zk1.openstack.org
port: 2181
chroot: /test
labels:
- name: trusty
max-ready-age: 3600
min-ready: 1
- name: trusty-2-node
min-ready: 0
- name: trusty-external
min-ready: 1
- name: trusty-static
- name: kubernetes-namespace
- name: pod-fedora
- name: pod-custom
- name: openshift-project
- name: openshift-pod
- name: centos-ami
- name: winrm
- name: winssh
providers:
- name: cloud1
driver: openstack
cloud: vanilla-cloud
region-name: 'vanilla'
boot-timeout: 120
max-concurrency: 10
launch-retries: 3
port-cleanup-interval: 600
rate: 1
diskimages:
- name: trusty
pools:
- name: main
max-servers: 184
auto-floating-ip: True
host-key-checking: True
node-attributes:
key1: value1
key2: value2
networks:
- public
- private
labels:
- name: trusty
diskimage: trusty
min-ram: 8192
console-log: True
networks:
- public
- name: trusty-2-node
diskimage: trusty
min-ram: 8192
boot-from-volume: True
volume-size: 100
instance-properties:
a_key: a_value
b_key: b_value
userdata: |
#cloud-config
password: password
chpasswd: { expire: False }
ssh_pwauth: True
hostname: test
- name: cloud2
driver: openstack
cloud: chocolate-cloud
region-name: 'chocolate'
boot-timeout: 120
rate: 0.001
port-cleanup-interval: 0
post-upload-hook: /usr/bin/upload-hook
launch-timeout: 1500
diskimages:
- name: trusty
pause: False
connection-type: ssh
connection-port: 22
cloud-images:
- name: trusty-unmanaged
config-drive: true
- name: windows-unmanaged
username: winzuul
python-path: A:/python3.7.exe
connection-type: winrm
connection-port: 5986
pools:
- name: main
max-servers: 184
auto-floating-ip: False
host-key-checking: False
security-groups:
- zuul_sg
labels:
- name: trusty
diskimage: trusty
min-ram: 8192
networks:
- public
- private
- name: trusty-2-node
diskimage: trusty
min-ram: 8192
- name: trusty-external
cloud-image: trusty-unmanaged
min-ram: 8192
- name: static-rack
driver: static
pools:
- name: main
nodes:
- name: trusty.example.com
labels: trusty-static
host-key: fake-key
timeout: 13
connection-port: 22022
username: zuul
max-parallel-jobs: 1
- name: windows.example.com
labels: winrm
username: zuul
connection-type: winrm
connection-port: 5986
- name: windows-ssh.example.com
labels: winssh
username: zuul
shell-type: cmd
- name: kubespray
driver: kubernetes
context: admin-cluster.local
pools:
- name: main
labels:
- name: kubernetes-namespace
type: namespace
- name: pod-custom
type: pod
spec:
k8s: goes here
- name: pod-fedora
type: pod
image: docker.io/fedora:28
cpu: 2
memory: 512
env:
- name: FOO
value: hello
- name: BAR
value: world
node-selector:
storageType: ssd
privileged: true
volumes:
- name: my-csi-inline-vol
csi:
driver: inline.storage.kubernetes.io
volume-mounts:
- mountPath: "/data"
name: my-csi-inline-vol
scheduler-name: niftyScheduler
labels:
environment: qa
- name: openshift
driver: openshift
context: "/hostname:8443/self-provisioner-service-account"
pools:
- name: main
labels:
- name: openshift-project
type: project
- name: openshift-pod
type: pod
image: docker.io/fedora:28
python-path: /usr/bin/python3
memory: 512
cpu: 2
env:
- name: FOO
value: hello
- name: BAR
value: world
node-selector:
storageType: ssd
privileged: true
volumes:
- name: my-csi-inline-vol
csi:
driver: inline.storage.kubernetes.io
volume-mounts:
- mountPath: "/data"
name: my-csi-inline-vol
scheduler-name: niftyScheduler
labels:
environment: qa
- name: ec2-us-east-2
driver: aws
region-name: us-east-2
profile-name: default
launch-timeout: 1500
launch-retries: 5
boot-timeout: 120
cloud-images:
- name: centos-ami
image-id: ami-cfdafaaa
username: centos
pools:
- name: main
max-servers: 42
security-group-id: sg-8bfe86352e334a80a
subnet-id: subnet-bb3605b5f0fa40e1b
labels:
- name: centos-ami
cloud-image: centos-ami
instance-type: t2.micro
key-name: zuul
volume-type: gp2
volume-size: 80
- name: gce-uscentral1
driver: gce
project: nodepool-123456
region: us-central1
zone: us-central1-a
launch-timeout: 1500
launch-retries: 5
boot-timeout: 120
cloud-images:
- name: debian-stretch
image-project: debian-cloud
image-family: debian-9
username: zuul
key: ssh-rsa ...
pools:
- name: main
max-servers: 8
labels:
- name: debian-stretch
instance-type: f1-micro
cloud-image: debian-stretch
volume-type: standard
volume-size: 10
- name: meta-provider
driver: metastatic
launch-timeout: 1500
launch-retries: 5
boot-timeout: 120
pools:
- name: main
max-servers: 10
labels:
- name: small-node
backing-label: large-node
max-parallel-jobs: 2
grace-time: 600
- name: openshift-single-project
driver: openshiftpods
context: "/hostname:8443/developer"
max-pods: 30
pools:
- name: project-name
labels:
- name: openshift-pod
image: docker.io/fedora:28
env:
- name: FOO
value: bar
diskimages:
- name: trusty
formats:
- tar
pause: False
elements:
- ubuntu
- vm
- openstack-repos
- puppet
- nodepool-base
- cache-devstack
release: trusty
rebuild-age: 3600
build-timeout: 3600
python-path: /bin/python3.6
env-vars:
TMPDIR: /opt/dib_tmp
DIB_IMAGE_CACHE: /opt/dib_cache
QEMU_IMG_OPTIONS: compat=0.10