Implement swift pods and serivces

Note: bootstrap job will come in a separated change since
this change is growing too big.

Change-Id: I4bdd9bc2a1b6ff1af8aac65776ce1235f7c98c4b
Partially-implements: blueprint openstack-services
This commit is contained in:
Liyi Meng 2016-05-23 16:58:28 +02:00
parent 86ffd53d3e
commit cc4cf1631b
10 changed files with 460 additions and 2 deletions

View File

@ -36,7 +36,9 @@ POD_DEFINITIONS = {'mariadb': ['mariadb'],
'glance': ['glance'],
'nova': ['nova-compute', 'nova-control'],
'neutron': ['neutron-compute', 'neutron-control',
'neutron-network']}
'neutron-network'],
'swift': ['swift-account', 'swift-container',
'swift-object', 'swift-proxy']}
# TODO(rhallisey): make container definitions dynamic
# The containers in a pod
@ -55,7 +57,24 @@ CONTAINER_DEFINITIONS = {'mariadb': ['mariadb'],
'neutron-network': ['neutron-l3-agent',
'neutron-dhcp-agent',
'neutron-medadata-agent'],
'neutron-control': ['neutron-server']}
'neutron-control': ['neutron-server'],
'swift-account': ['swift-rsyncd',
'swift-account-server',
'swift-account-auditor',
'swift-account-replicator',
'swift-account-reaper'],
'swift-container': ['swift-rsyncd',
'swift-container-server',
'swift-container-auditor',
'swift-container-replicator',
'swift-container-updater'],
'swift-object': ['swift-rsyncd',
'swift-object-server',
'swift-object-auditor',
'swift-object-replicator',
'swift-object-updater',
'swift-object-expirer'],
'swift-proxy': ['swift-proxy-server']}
def get_pod_definition(service):

View File

@ -0,0 +1,111 @@
apiVersion: v1
kind: Pod
spec:
hostNetwork: True
containers:
- image: "{{ swift_rsyncd_image_full }}"
name: swift-rsyncd
volumeMounts:
- mountPath: {{ container_config_directory }}/
name: swift-rsyncd-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_account_image_full }}"
name: swift-account-server
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-account-server-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_account_image_full }}"
name: swift-account-auditor
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-account-auditor-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_account_image_full }}"
name: swift-account-replicator
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-account-replicator-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_account_image_full }}"
name: swift-account-reaper
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-account-reaper-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
volumes:
- name: swift-rsyncd-config
configMap:
name: swift-rsyncd-configmap
- name: swift-account-server-config
configMap:
name: swift-account-server-configmap
- name: swift-account-auditor-config
configMap:
name: swift-account-auditor-configmap
- name: swift-account-replicator-config
configMap:
name: swift-account-replicator-configmap
- name: swift-account-reaper-config
configMap:
name: swift-account-reaper-configmap
- name: swift-config
hostPath:
path: {{ node_config_directory }}/swift/
- name: swift-devices
hostPath:
path: {{ swift_devices_mount_point }}
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: kolla-logs
emptyDir: {}
metadata:
name: swift-account

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ swift_account_server_port }}
selector:
name: swift-account-server
metadata:
name: swift-account-server

View File

@ -0,0 +1,113 @@
apiVersion: v1
kind: Pod
spec:
hostNetwork: True
containers:
- image: "{{ swift_rsyncd_image_full }}"
name: swift-rsyncd
volumeMounts:
- mountPath: {{ container_config_directory }}/
name: swift-rsyncd-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_container_image_full }}"
name: swift-container-server
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-container-server-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_container_image_full }}"
name: swift-container-auditor
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-container-auditor-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_container_image_full }}"
name: swift-container-replicator
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-container-replicator-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_container_image_full }}"
name: swift-container-updater
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-container-updater-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
volumes:
- name: swift-rsyncd-config
configMap:
name: swift-rsyncd-configmap
- name: swift-container-server-config
configMap:
name: swift-container-server-configmap
- name: swift-container-auditor-config
configMap:
name: swift-container-auditor-configmap
- name: swift-container-replicator-config
configMap:
name: swift-container-replicator-configmap
- name: swift-container-updater-config
configMap:
name: swift-container-updater-configmap
- name: swift-config
hostPath:
path: {{ node_config_directory }}/swift/
- name: swift-devices
hostPath:
path: {{ swift_devices_mount_point }}
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: kolla-logs
emptyDir: {}
metadata:
name: swift-container

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ swift_container_server_port }}
selector:
name: swift-container-server
metadata:
name: swift-container-server

View File

@ -0,0 +1,131 @@
apiVersion: v1
kind: Pod
spec:
hostNetwork: True
containers:
- image: "{{ swift_rsyncd_image_full }}"
name: swift-rsyncd
volumeMounts:
- mountPath: {{ container_config_directory }}/
name: swift-rsyncd-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_object_image_full }}"
name: swift-object-server
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-object-server-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_object_image_full }}"
name: swift-object-auditor
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-object-auditor-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_object_image_full }}"
name: swift-object-replicator
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-object-replicator-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_object_image_full }}"
name: swift-object-updater
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-object-updater-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
- image: "{{ swift_account_image_full }}"
name: swift-object-expirer
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-object-expirer-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
volumes:
- name: swift-rsyncd-config
configMap:
name: swift-rsyncd-configmap
- name: swift-object-server-config
configMap:
name: swift-object-server-configmap
- name: swift-object-auditor-config
configMap:
name: swift-object-auditor-configmap
- name: swift-object-replicator-config
configMap:
name: swift-object-replicator-configmap
- name: swift-object-updater-config
configMap:
name: swift-object-updater-configmap
- name: swift-object-expirer-config
configMap:
name: swift-object-expirer-configmap
- name: swift-config
hostPath:
path: {{ node_config_directory }}/swift/
- name: swift-devices
hostPath:
path: {{ swift_devices_mount_point }}
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: kolla-logs
emptyDir: {}
metadata:
name: swift-object

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ swift_object_server_port }}
selector:
name: swift-object-server
metadata:
name: swift-object-server

View File

@ -0,0 +1,39 @@
apiVersion: v1
kind: Pod
spec:
hostNetwork: True
containers:
- image: "{{ swift_proxy_server_image_full }}"
name: swift-proxy-server
volumeMounts:
- mountPath: /var/lib/kolla/swift/
name: swift-config
readOnly: true
- mountPath: {{ container_config_directory }}/
name: swift-proxy-server-config
readOnly: true
- mountPath: {{ swift_devices_mount_point }}
name: swift-devices
- mountPath: /etc/localtime
name: etc-localtime
readOnly: true
- mountPath: /var/log/kolla/
name: kolla-logs
volumes:
- name: swift-proxy-server-config
configMap:
name: swift-proxy-server-configmap
- name: swift-config
hostPath:
path: {{ node_config_directory }}/swift/
- name: swift-devices
hostPath:
path: {{ swift_devices_mount_point }}
- name: etc-localtime
hostPath:
path: /etc/localtime
- name: kolla-logs
emptyDir: {}
metadata:
name: swift-proxy

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ swift_proxy_server_port }}
selector:
name: swift-proxy-server
metadata:
name: swift-proxy-server

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
spec:
ports:
- port: {{ swift_rsync_port }}
selector:
name: swift-rsyncd
metadata:
name: swift-rsyncd