From 566953bce0e30c5c63f256bc4c3851a89eb1dd9e Mon Sep 17 00:00:00 2001 From: Alan Meadows Date: Mon, 30 Jan 2017 11:56:55 -0800 Subject: [PATCH 01/11] Documentation 1.1: add mission document --- docs/README.md | 6 +++--- docs/mission.md | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 docs/mission.md diff --git a/docs/README.md b/docs/README.md index 3d83f9708d..00c6b4b0a0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,9 +4,9 @@ ## Table of Contents ##  1. [Openstack-Helm Design Principals]() -###    1.1 [Mission]() -#####      1.1.1 [Resiliency]() -#####      1.1.2 [Scaling]() +###    1.1 [Mission](mission.md) +#####      1.1.1 [Resiliency](mission.md#resiliency) +#####      1.1.2 [Scaling](mission.md#scaling) ###    1.2 [Helm Overrides]() #####      1.2.1 [Resource Limits]() #####      1.2.2 [Conditionals]() diff --git a/docs/mission.md b/docs/mission.md new file mode 100644 index 0000000000..63b88e67a6 --- /dev/null +++ b/docs/mission.md @@ -0,0 +1,23 @@ +# Mission + +The goal for openstack-helm is to provide an incredibly customizable *framework* for operators and developers alike. This framework will enable end-users to deploy, maintain, and upgrade a fully functioning Openstack environment for both simple and complex environments. Administrators or developers can either deploy all or individual Openstack components along with their required dependancies. It heavily borrows concepts from [Stackanetes](https://github.com/stackanetes/stackanetes) and [other complex Helm application deployments](https://github.com/sapcc/openstack-helm). This project is meant to be a collaborative project that brings Openstack applications into a [Cloud-Native](https://www.cncf.io/about/charter) model. + +## Resiliency + +One of the goals of this project is to produce a set of charts that can be used in a production setting to deploy and upgrade OpenStack. To meet achieve this goal, all components must be resilient. This includes both OpenStack and Infrastructure components leveraged by this project. In addition, this also includes Kubernetes itself. It is part of our mission to ensure that all infrastructure components are highly available and that a deployment can withstand a physical host failure out of the box. This means that: + +- OpenStack components will need to support, and deploy with multiple replicas out of the box (unless development mode is enabled) to make sure this leveraging this chart for production deployments is a first class citizen at all times. +- Infrastructure elements such as Ceph, RabbitMQ, Galera (MariaDB), Memcache, and all others need to support resiliency and leverage multiple replicas for resiliency. These components also need to be validated that their application level configurations (for instance the underlying galera cluster) can tolerate host crashes and withstand physical host failures. +- Scheduling annotations need to be employed to ensure maximum resiliency for multi-host environments. They also need to be flexible to allow all-in-one deployments. To this end, we promote the usage of `podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution` for most infrastructure elements. +- We should be able to depend on a reliable implementation of centralized storage to create PVCs within Kubernetes to support resiliency and application design. Today, this is cheph as there is much work to do making even a single backend production ready and we need to focus. In the future, we would like to support more choice for hardened backends. + +## Scaling + +Scaling is another first class citizen in openstack-helm. We will be working to ensure we support various deployment models that can support hyperscale, such as: + +- Ensure that out of the box, unless development mode is enabled, clusters receive multiple replicas to ensure scaling issues are identified early and often. +- Ensure that every chart can support more then one replica and allowing operators to override those replica counts. For some applications, means ensuring they can support clustering. +- Ensure clustering style applications are not limited to fixed replica counts. For instance, we want to ensure we can support N galera members and have those scale linearly within reason as opposed to only supporting a fixed count. +- Duplicate charts of the same type within the same namespace. For example, deploying rabbitmq twice, to the openstack namespace resulting in two fully functioning clusters. +- Allowing charts to be deployed to a diverse set of namespaces. Allowing infrastructure to be deployed in one namespace, and OpenStack in another, for example or each chart in its own namespace. +- Supporting hyperscale by ensuring we can support configurations that call for per-component infrastructure, such as dedicated database and rabbitmq solely for ceilometer or even dedicated infrastructure for every component you deploy. It is unique large scale deployment designs such as this that only become practical under a Kubernetes/Container framework and we want to ensure that we can support them. \ No newline at end of file From 54557ec90790d1ab8119b1f0c5cdbd1074a38278 Mon Sep 17 00:00:00 2001 From: Alan Meadows Date: Mon, 30 Jan 2017 16:19:08 -0800 Subject: [PATCH 02/11] Update mission document --- docs/mission.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/mission.md b/docs/mission.md index 63b88e67a6..ca7bb9be29 100644 --- a/docs/mission.md +++ b/docs/mission.md @@ -7,17 +7,18 @@ The goal for openstack-helm is to provide an incredibly customizable *framework* One of the goals of this project is to produce a set of charts that can be used in a production setting to deploy and upgrade OpenStack. To meet achieve this goal, all components must be resilient. This includes both OpenStack and Infrastructure components leveraged by this project. In addition, this also includes Kubernetes itself. It is part of our mission to ensure that all infrastructure components are highly available and that a deployment can withstand a physical host failure out of the box. This means that: - OpenStack components will need to support, and deploy with multiple replicas out of the box (unless development mode is enabled) to make sure this leveraging this chart for production deployments is a first class citizen at all times. -- Infrastructure elements such as Ceph, RabbitMQ, Galera (MariaDB), Memcache, and all others need to support resiliency and leverage multiple replicas for resiliency. These components also need to be validated that their application level configurations (for instance the underlying galera cluster) can tolerate host crashes and withstand physical host failures. +- Infrastructure elements such as Ceph, RabbitMQ, Galera (MariaDB), Memcache, and all others need to support resiliency and leverage multiple replicas for resiliency where applicable. These components also need to be validated that their application level configurations (for instance the underlying galera cluster) can tolerate host crashes and withstand physical host failures. - Scheduling annotations need to be employed to ensure maximum resiliency for multi-host environments. They also need to be flexible to allow all-in-one deployments. To this end, we promote the usage of `podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution` for most infrastructure elements. -- We should be able to depend on a reliable implementation of centralized storage to create PVCs within Kubernetes to support resiliency and application design. Today, this is cheph as there is much work to do making even a single backend production ready and we need to focus. In the future, we would like to support more choice for hardened backends. +- We make the assumption that we can depend on a reliable implementation of centralized storage to create PVCs within Kubernetes to support resiliency and complex application design. Today, this is powered by our own cheph chart as there is much work to do making even a single backend production ready and we need to focus bringing that to a production ready state, which includes handling real world deployment scenarios, resiliency, and pool configuration. In the future, we would like to support more choice for hardened backends. +- We will document the best practices for running a resilient Kubernetes cluster in production. This includes the steps necessary to make all components resilient, such as etcd, and skydns where possible, and point out gaps due to missing features. ## Scaling Scaling is another first class citizen in openstack-helm. We will be working to ensure we support various deployment models that can support hyperscale, such as: -- Ensure that out of the box, unless development mode is enabled, clusters receive multiple replicas to ensure scaling issues are identified early and often. -- Ensure that every chart can support more then one replica and allowing operators to override those replica counts. For some applications, means ensuring they can support clustering. -- Ensure clustering style applications are not limited to fixed replica counts. For instance, we want to ensure we can support N galera members and have those scale linearly within reason as opposed to only supporting a fixed count. +- Ensuring that out of the box, unless development mode is enabled, clusters receive multiple replicas to ensure scaling issues are identified early and often. +- Ensuring that every chart can support more then one replica and allowing operators to override those replica counts. For some applications, means ensuring they can support clustering. +- Ensuring clustering style applications are not limited to fixed replica counts. For instance, we want to ensure we can support N galera members and have those scale linearly within reason as opposed to only supporting a fixed count. - Duplicate charts of the same type within the same namespace. For example, deploying rabbitmq twice, to the openstack namespace resulting in two fully functioning clusters. - Allowing charts to be deployed to a diverse set of namespaces. Allowing infrastructure to be deployed in one namespace, and OpenStack in another, for example or each chart in its own namespace. - Supporting hyperscale by ensuring we can support configurations that call for per-component infrastructure, such as dedicated database and rabbitmq solely for ceilometer or even dedicated infrastructure for every component you deploy. It is unique large scale deployment designs such as this that only become practical under a Kubernetes/Container framework and we want to ensure that we can support them. \ No newline at end of file From 1e7203a523541c8a48a45d0f84cad9b2c1af96c4 Mon Sep 17 00:00:00 2001 From: maris-accenture Date: Tue, 31 Jan 2017 02:22:51 +0200 Subject: [PATCH 03/11] #106 CPU and memory resources (#106) * resource requests and limits for cinder, heat, nova --- cinder/templates/deployment-api.yaml | 9 +++ cinder/templates/deployment-scheduler.yaml | 9 +++ cinder/templates/deployment-volume.yaml | 9 +++ cinder/templates/job-db-init.yaml | 9 +++ cinder/templates/job-db-sync.yaml | 9 +++ cinder/templates/job-ks-endpoints.yaml.yaml | 9 +++ cinder/templates/job-ks-service.yaml | 9 +++ cinder/templates/job-ks-user.yaml | 9 +++ cinder/values.yaml | 60 +++++++++++++++ heat/templates/deployment-api.yaml | 9 +++ heat/templates/deployment-cfn.yaml | 9 +++ heat/templates/deployment-cloudwatch.yaml | 9 +++ heat/templates/job-db-init.yaml | 9 +++ heat/templates/job-db-sync.yaml | 9 +++ heat/templates/job-ks-endpoints.yaml.yaml | 9 +++ heat/templates/job-ks-service.yaml | 10 +++ heat/templates/job-ks-user.yaml | 9 +++ heat/templates/statefulset-engine.yaml | 9 +++ heat/values.yaml | 84 ++++++++++++++++++--- nova/templates/daemonset-compute.yaml | 9 +++ nova/templates/daemonset-libvirt.yaml | 9 +++ nova/templates/deployment-api-metadata.yaml | 9 +++ nova/templates/deployment-api-osapi.yaml | 9 +++ nova/templates/deployment-conductor.yaml | 9 +++ nova/templates/deployment-consoleauth.yaml | 9 +++ nova/templates/deployment-scheduler.yaml | 9 +++ nova/templates/job-db-init.yaml | 9 +++ nova/templates/job-db-sync.yaml | 9 +++ nova/templates/job-post.yaml | 9 +++ nova/values.yaml | 73 ++++++++++++++++++ 30 files changed, 451 insertions(+), 10 deletions(-) diff --git a/cinder/templates/deployment-api.yaml b/cinder/templates/deployment-api.yaml index cc3c3f6b19..74b0c59b7a 100644 --- a/cinder/templates/deployment-api.yaml +++ b/cinder/templates/deployment-api.yaml @@ -31,6 +31,15 @@ spec: - name: cinder-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.cinder_api.requests.memory | quote }} + cpu: {{ .Values.resources.cinder_api.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.cinder_api.limits.memory | quote }} + cpu: {{ .Values.resources.cinder_api.limits.cpu | quote }} + {{- end }} command: - cinder-api - --config-dir diff --git a/cinder/templates/deployment-scheduler.yaml b/cinder/templates/deployment-scheduler.yaml index 39663097ef..443cd7f9b2 100644 --- a/cinder/templates/deployment-scheduler.yaml +++ b/cinder/templates/deployment-scheduler.yaml @@ -31,6 +31,15 @@ spec: - name: cinder-scheduler image: {{ .Values.images.scheduler }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.cinder_scheduler.requests.memory | quote }} + cpu: {{ .Values.resources.cinder_scheduler.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.cinder_scheduler.limits.memory | quote }} + cpu: {{ .Values.resources.cinder_scheduler.limits.cpu | quote }} + {{- end }} command: - cinder-scheduler - --config-dir diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index cb6c958ccc..4c064029ab 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -31,6 +31,15 @@ spec: - name: cinder-volume image: {{ .Values.images.volume }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.cinder_volume.requests.memory | quote }} + cpu: {{ .Values.resources.cinder_volume.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.cinder_volume.limits.memory | quote }} + cpu: {{ .Values.resources.cinder_volume.limits.cpu | quote }} + {{- end }} command: - cinder-volume - --config-dir diff --git a/cinder/templates/job-db-init.yaml b/cinder/templates/job-db-init.yaml index 8c8338b0cf..eb057e9af4 100644 --- a/cinder/templates/job-db-init.yaml +++ b/cinder/templates/job-db-init.yaml @@ -19,6 +19,15 @@ spec: - name: cinder-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.cinder_db_init.requests.memory | quote }} + cpu: {{ .Values.resources.cinder_db_init.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.cinder_db_init.limits.memory | quote }} + cpu: {{ .Values.resources.cinder_db_init.limits.cpu | quote }} + {{- end }} env: - name: ANSIBLE_LIBRARY value: /usr/share/ansible/ diff --git a/cinder/templates/job-db-sync.yaml b/cinder/templates/job-db-sync.yaml index 045f46227f..97da3bc262 100644 --- a/cinder/templates/job-db-sync.yaml +++ b/cinder/templates/job-db-sync.yaml @@ -19,6 +19,15 @@ spec: - name: cinder-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.cinder_db_sync.requests.memory | quote }} + cpu: {{ .Values.resources.cinder_db_sync.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.cinder_db_sync.limits.memory | quote }} + cpu: {{ .Values.resources.cinder_db_sync.limits.cpu | quote }} + {{- end }} command: - cinder-manage args: diff --git a/cinder/templates/job-ks-endpoints.yaml.yaml b/cinder/templates/job-ks-endpoints.yaml.yaml index 455c0f3439..242ba42b4b 100644 --- a/cinder/templates/job-ks-endpoints.yaml.yaml +++ b/cinder/templates/job-ks-endpoints.yaml.yaml @@ -22,6 +22,15 @@ spec: - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} + {{- if $envAll.Values.resources.enabled }} + resources: + requests: + memory: {{ $envAll.Values.resources.cinder_ks_endpoints.requests.memory | quote }} + cpu: {{ $envAll.Values.resources.cinder_ks_endpoints.requests.cpu | quote }} + limits: + memory: {{ $envAll.Values.resources.cinder_ks_endpoints.limits.memory | quote }} + cpu: {{ $envAll.Values.resources.cinder_ks_endpoints.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/ks-endpoints.sh diff --git a/cinder/templates/job-ks-service.yaml b/cinder/templates/job-ks-service.yaml index 73934938f2..c63c6103b9 100644 --- a/cinder/templates/job-ks-service.yaml +++ b/cinder/templates/job-ks-service.yaml @@ -21,6 +21,15 @@ spec: - name: {{ $osServiceType }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} + {{- if $envAll.Values.resources.enabled }} + resources: + requests: + memory: {{ $envAll.Values.resources.cinder_ks_service.requests.memory | quote }} + cpu: {{ $envAll.Values.resources.cinder_ks_service.requests.cpu | quote }} + limits: + memory: {{ $envAll.Values.resources.cinder_ks_service.limits.memory | quote }} + cpu: {{ $envAll.Values.resources.cinder_ks_service.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/ks-service.sh diff --git a/cinder/templates/job-ks-user.yaml b/cinder/templates/job-ks-user.yaml index 49bc179a89..cc383e6f0c 100644 --- a/cinder/templates/job-ks-user.yaml +++ b/cinder/templates/job-ks-user.yaml @@ -21,6 +21,15 @@ spec: - name: cinder-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.cinder_ks_user.requests.memory | quote }} + cpu: {{ .Values.resources.cinder_ks_user.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.cinder_ks_user.limits.memory | quote }} + cpu: {{ .Values.resources.cinder_ks_user.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/ks-user.sh diff --git a/cinder/values.yaml b/cinder/values.yaml index 120d4d484f..4f6ebeb5b2 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -183,3 +183,63 @@ endpoints: scheme: 'http' port: api: 8776 + +resources: + enabled: false + cinder_api: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_scheduler: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_volume: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_db_init: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_db_sync: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_ks_endpoints: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_ks_service: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + cinder_ks_user: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + diff --git a/heat/templates/deployment-api.yaml b/heat/templates/deployment-api.yaml index 25197f76ef..dafbba9cda 100755 --- a/heat/templates/deployment-api.yaml +++ b/heat/templates/deployment-api.yaml @@ -21,6 +21,15 @@ spec: - name: heat-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_api.requests.memory | quote }} + cpu: {{ .Values.resources.heat_api.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_api.limits.memory | quote }} + cpu: {{ .Values.resources.heat_api.limits.cpu | quote }} + {{- end }} command: - heat-api - --config-dir diff --git a/heat/templates/deployment-cfn.yaml b/heat/templates/deployment-cfn.yaml index 0cce31b80e..11d25b745a 100644 --- a/heat/templates/deployment-cfn.yaml +++ b/heat/templates/deployment-cfn.yaml @@ -21,6 +21,15 @@ spec: - name: heat-cfn image: {{ .Values.images.cfn }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_cfn.requests.memory | quote }} + cpu: {{ .Values.resources.heat_cfn.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_cfn.limits.memory | quote }} + cpu: {{ .Values.resources.heat_cfn.limits.cpu | quote }} + {{- end }} command: - heat-api-cfn - --config-dir diff --git a/heat/templates/deployment-cloudwatch.yaml b/heat/templates/deployment-cloudwatch.yaml index 6f624a65f4..17b17fecd0 100644 --- a/heat/templates/deployment-cloudwatch.yaml +++ b/heat/templates/deployment-cloudwatch.yaml @@ -21,6 +21,15 @@ spec: - name: heat-cloudwatch image: {{ .Values.images.cloudwatch }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_cloudwatch.requests.memory | quote }} + cpu: {{ .Values.resources.heat_cloudwatch.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_cloudwatch.limits.memory | quote }} + cpu: {{ .Values.resources.heat_cloudwatch.limits.cpu | quote }} + {{- end }} command: - heat-api-cloudwatch - --config-dir diff --git a/heat/templates/job-db-init.yaml b/heat/templates/job-db-init.yaml index a98c571d95..4633c7af9c 100644 --- a/heat/templates/job-db-init.yaml +++ b/heat/templates/job-db-init.yaml @@ -19,6 +19,15 @@ spec: - name: heat-db-init image: {{ .Values.images.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_db_init.requests.memory | quote }} + cpu: {{ .Values.resources.heat_db_init.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_db_init.limits.memory | quote }} + cpu: {{ .Values.resources.heat_db_init.limits.cpu | quote }} + {{- end }} env: - name: ANSIBLE_LIBRARY value: /usr/share/ansible/ diff --git a/heat/templates/job-db-sync.yaml b/heat/templates/job-db-sync.yaml index 5f962a9d3e..0ee761c201 100644 --- a/heat/templates/job-db-sync.yaml +++ b/heat/templates/job-db-sync.yaml @@ -19,6 +19,15 @@ spec: - name: heat-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_db_sync.requests.memory | quote }} + cpu: {{ .Values.resources.heat_db_sync.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_db_sync.limits.memory | quote }} + cpu: {{ .Values.resources.heat_db_sync.limits.cpu | quote }} + {{- end }} command: - heat-manage args: diff --git a/heat/templates/job-ks-endpoints.yaml.yaml b/heat/templates/job-ks-endpoints.yaml.yaml index 6bfcfb7018..c5dfd3aaa1 100644 --- a/heat/templates/job-ks-endpoints.yaml.yaml +++ b/heat/templates/job-ks-endpoints.yaml.yaml @@ -22,6 +22,15 @@ spec: - name: {{ $osServiceName }}-ks-endpoints-{{ $osServiceEndPoint }} image: {{ $envAll.Values.images.ks_endpoints }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} + {{- if $envAll.Values.resources.enabled }} + resources: + requests: + memory: {{ $envAll.Values.resources.heat_ks_endpoints.requests.memory | quote }} + cpu: {{ $envAll.Values.resources.heat_ks_endpoints.requests.cpu | quote }} + limits: + memory: {{ $envAll.Values.resources.heat_ks_endpoints.limits.memory | quote }} + cpu: {{ $envAll.Values.resources.heat_ks_endpoints.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/ks-endpoints.sh diff --git a/heat/templates/job-ks-service.yaml b/heat/templates/job-ks-service.yaml index 8dba89f883..dd3295a5ec 100644 --- a/heat/templates/job-ks-service.yaml +++ b/heat/templates/job-ks-service.yaml @@ -21,6 +21,15 @@ spec: - name: {{ $osServiceName }}-ks-service-registration image: {{ $envAll.Values.images.ks_service }} imagePullPolicy: {{ $envAll.Values.images.pull_policy }} + {{- if $envAll.Values.resources.enabled }} + resources: + requests: + memory: {{ $envAll.Values.resources.heat_ks_service.requests.memory | quote }} + cpu: {{ $envAll.Values.resources.heat_ks_service.requests.cpu | quote }} + limits: + memory: {{ $envAll.Values.resources.heat_ks_service.limits.memory | quote }} + cpu: {{ $envAll.Values.resources.heat_ks_service.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/ks-service.sh @@ -38,6 +47,7 @@ spec: - name: OS_SERVICE_TYPE value: {{ tuple $osServiceName $envAll | include "endpoint_type_lookup" }} {{- end }} + volumes: - name: ks-service-sh configMap: diff --git a/heat/templates/job-ks-user.yaml b/heat/templates/job-ks-user.yaml index 7fd8f6d2f2..a55743ef02 100644 --- a/heat/templates/job-ks-user.yaml +++ b/heat/templates/job-ks-user.yaml @@ -24,6 +24,15 @@ spec: - name: heat-ks-user image: {{ .Values.images.ks_user }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_ks_user.requests.memory | quote }} + cpu: {{ .Values.resources.heat_ks_user.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_ks_user.limits.memory | quote }} + cpu: {{ .Values.resources.heat_ks_user.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/ks-user.sh diff --git a/heat/templates/statefulset-engine.yaml b/heat/templates/statefulset-engine.yaml index 0c5c8f007b..d27bf99665 100644 --- a/heat/templates/statefulset-engine.yaml +++ b/heat/templates/statefulset-engine.yaml @@ -22,6 +22,15 @@ spec: - name: heat-engine image: {{ .Values.images.engine }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.heat_engine.requests.memory | quote }} + cpu: {{ .Values.resources.heat_engine.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.heat_engine.limits.memory | quote }} + cpu: {{ .Values.resources.heat_engine.limits.cpu | quote }} + {{- end }} command: - heat-engine - --config-dir diff --git a/heat/values.yaml b/heat/values.yaml index ecd9c02ccf..9da0dc95f6 100644 --- a/heat/values.yaml +++ b/heat/values.yaml @@ -97,16 +97,6 @@ memcached: host: memcached port: 11211 -resources: - api: - workers: 8 - cfn: - workers: 8 - cloudwatch: - workers: 8 - engine: - workers: 8 - misc: debug: true @@ -206,3 +196,77 @@ endpoints: scheme: 'http' port: api: 8003 + +resources: + enabled: false + heat_api: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_cfn: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_cloudwatch: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_db_init: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_db_sync: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_ks_endpoints: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_ks_service: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_ks_user: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + heat_engine: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + api: + workers: 8 + cfn: + workers: 8 + cloudwatch: + workers: 8 + engine: + workers: 8 diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index 896739cfba..2553c79406 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -27,6 +27,15 @@ spec: - name: nova-compute image: {{ .Values.images.compute }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_compute.requests.memory | quote }} + cpu: {{ .Values.resources.nova_compute.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_compute.limits.memory | quote }} + cpu: {{ .Values.resources.nova_compute.limits.cpu | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/nova/templates/daemonset-libvirt.yaml b/nova/templates/daemonset-libvirt.yaml index bb461bc4da..bc104e7144 100644 --- a/nova/templates/daemonset-libvirt.yaml +++ b/nova/templates/daemonset-libvirt.yaml @@ -26,6 +26,15 @@ spec: - name: nova-libvirt image: {{ .Values.images.libvirt }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_libvirt.requests.memory | quote }} + cpu: {{ .Values.resources.nova_libvirt.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_libvirt.limits.memory | quote }} + cpu: {{ .Values.resources.nova_libvirt.limits.cpu | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/nova/templates/deployment-api-metadata.yaml b/nova/templates/deployment-api-metadata.yaml index 5ca429e8ca..1b93605837 100644 --- a/nova/templates/deployment-api-metadata.yaml +++ b/nova/templates/deployment-api-metadata.yaml @@ -32,6 +32,15 @@ spec: image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} # https://bugs.launchpad.net/kolla-mesos/+bug/1546007 + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_api_metadata.requests.memory | quote }} + cpu: {{ .Values.resources.nova_api_metadata.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_api_metadata.limits.memory | quote }} + cpu: {{ .Values.resources.nova_api_metadata.limits.cpu | quote }} + {{- end }} securityContext: capabilities: add: diff --git a/nova/templates/deployment-api-osapi.yaml b/nova/templates/deployment-api-osapi.yaml index f0940a524c..52b6a13ec2 100644 --- a/nova/templates/deployment-api-osapi.yaml +++ b/nova/templates/deployment-api-osapi.yaml @@ -35,6 +35,15 @@ spec: capabilities: add: - NET_ADMIN + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_osapi.requests.memory | quote }} + cpu: {{ .Values.resources.nova_osapi.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_osapi.limits.memory | quote }} + cpu: {{ .Values.resources.nova_osapi.limits.cpu | quote }} + {{- end }} command: - nova-api - --config-file=/etc/nova/nova.conf diff --git a/nova/templates/deployment-conductor.yaml b/nova/templates/deployment-conductor.yaml index 8879851371..7e9fe02b6e 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -31,6 +31,15 @@ spec: - name: nova-conductor image: {{ .Values.images.conductor }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_conductor.requests.memory | quote }} + cpu: {{ .Values.resources.nova_conductor.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_conductor.limits.memory | quote }} + cpu: {{ .Values.resources.nova_conductor.limits.cpu | quote }} + {{- end }} command: - nova-conductor - --config-file diff --git a/nova/templates/deployment-consoleauth.yaml b/nova/templates/deployment-consoleauth.yaml index c62de2559d..fa96113129 100644 --- a/nova/templates/deployment-consoleauth.yaml +++ b/nova/templates/deployment-consoleauth.yaml @@ -31,6 +31,15 @@ spec: - name: nova-consoleauth image: {{ .Values.images.consoleauth }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_consoleauth.requests.memory | quote }} + cpu: {{ .Values.resources.nova_consoleauth.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_consoleauth.limits.memory | quote }} + cpu: {{ .Values.resources.nova_consoleauth.limits.cpu | quote }} + {{- end }} command: - nova-consoleauth - --config-file diff --git a/nova/templates/deployment-scheduler.yaml b/nova/templates/deployment-scheduler.yaml index 14f12e2c29..9ace4262bf 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -31,6 +31,15 @@ spec: - name: nova-scheduler image: {{ .Values.images.scheduler }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_scheduler.requests.memory | quote }} + cpu: {{ .Values.resources.nova_scheduler.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_scheduler.limits.memory | quote }} + cpu: {{ .Values.resources.nova_scheduler.limits.cpu | quote }} + {{- end }} command: - nova-scheduler - --config-file diff --git a/nova/templates/job-db-init.yaml b/nova/templates/job-db-init.yaml index dce9a652a7..e43982359a 100644 --- a/nova/templates/job-db-init.yaml +++ b/nova/templates/job-db-init.yaml @@ -19,6 +19,15 @@ spec: - name: nova-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_init.requests.memory | quote }} + cpu: {{ .Values.resources.nova_init.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_init.limits.memory | quote }} + cpu: {{ .Values.resources.nova_init.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/init.sh diff --git a/nova/templates/job-db-sync.yaml b/nova/templates/job-db-sync.yaml index 94befb39e2..81bff35b94 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -19,6 +19,15 @@ spec: - name: nova-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_db_sync.requests.memory | quote }} + cpu: {{ .Values.resources.nova_db_sync.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_db_sync.limits.memory | quote }} + cpu: {{ .Values.resources.nova_db_sync.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/db-sync.sh diff --git a/nova/templates/job-post.yaml b/nova/templates/job-post.yaml index c91e752117..7fddbaf6a7 100644 --- a/nova/templates/job-post.yaml +++ b/nova/templates/job-post.yaml @@ -19,6 +19,15 @@ spec: - name: nova-post image: {{ .Values.images.post }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + requests: + memory: {{ .Values.resources.nova_post.requests.memory | quote }} + cpu: {{ .Values.resources.nova_post.requests.cpu | quote }} + limits: + memory: {{ .Values.resources.nova_post.limits.memory | quote }} + cpu: {{ .Values.resources.nova_post.limits.cpu | quote }} + {{- end }} command: - bash - /tmp/post.sh diff --git a/nova/values.yaml b/nova/values.yaml index 6cc3baa28f..7edba952ba 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -217,3 +217,76 @@ endpoints: scheme: 'http' port: api: 9696 + +resources: + enabled: false + nova_compute: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_libvirt: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_api_metadata: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_osapi: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_conductor: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_consoleauth: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_scheduler: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_db_sync: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_init: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + nova_post: + requests: + memory: "124Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" From b8d74f724158b4a92ef314d6bd156f23d7c41f18 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Tue, 31 Jan 2017 14:35:06 -0600 Subject: [PATCH 04/11] Add OWNERS file to openstack-helm Add the OWNERS file to openstack-helm to match other similar repos --- OWNERS | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 OWNERS diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000000..5881adfb1d --- /dev/null +++ b/OWNERS @@ -0,0 +1,10 @@ +reviewers: + - alanmeadows + - v1k0d3n + - intlabs + - wilkers-steve + - DTadrzak + - larryrensing +approvers: + - alanmeadows + - v1k0d3n From 27453ccc4d9c94621375ddbfb589e4dfd80d4ce9 Mon Sep 17 00:00:00 2001 From: Alan Meadows Date: Tue, 31 Jan 2017 16:14:17 -0800 Subject: [PATCH 05/11] Update mission document with feedback --- docs/mission.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/mission.md b/docs/mission.md index ca7bb9be29..b39a809f90 100644 --- a/docs/mission.md +++ b/docs/mission.md @@ -1,24 +1,24 @@ # Mission -The goal for openstack-helm is to provide an incredibly customizable *framework* for operators and developers alike. This framework will enable end-users to deploy, maintain, and upgrade a fully functioning Openstack environment for both simple and complex environments. Administrators or developers can either deploy all or individual Openstack components along with their required dependancies. It heavily borrows concepts from [Stackanetes](https://github.com/stackanetes/stackanetes) and [other complex Helm application deployments](https://github.com/sapcc/openstack-helm). This project is meant to be a collaborative project that brings Openstack applications into a [Cloud-Native](https://www.cncf.io/about/charter) model. +The goal for openstack-helm is to provide an incredibly customizable *framework* for operators and developers alike. This framework will enable end-users to deploy, maintain, and upgrade a fully functioning OpenStack environment for both simple and complex environments. Administrators or developers can either deploy all or individual OpenStack components along with their required dependencies. It heavily borrows concepts from [Stackanetes](https://github.com/stackanetes/stackanetes) and [other complex Helm application deployments](https://github.com/sapcc/openstack-helm). This project is meant to be a collaborative project that brings Openstack applications into a [Cloud-Native](https://www.cncf.io/about/charter) model. ## Resiliency -One of the goals of this project is to produce a set of charts that can be used in a production setting to deploy and upgrade OpenStack. To meet achieve this goal, all components must be resilient. This includes both OpenStack and Infrastructure components leveraged by this project. In addition, this also includes Kubernetes itself. It is part of our mission to ensure that all infrastructure components are highly available and that a deployment can withstand a physical host failure out of the box. This means that: +One of the goals of this project is to produce a set of charts that can be used in a production setting to deploy and upgrade OpenStack. To achieve this goal, all components must be resilient, including both OpenStack and Infrastructure components leveraged by this project. In addition, this also includes Kubernetes itself. It is part of our mission to ensure that all infrastructure components are highly available and that a deployment can withstand a physical host failure out of the box. This means that: -- OpenStack components will need to support, and deploy with multiple replicas out of the box (unless development mode is enabled) to make sure this leveraging this chart for production deployments is a first class citizen at all times. -- Infrastructure elements such as Ceph, RabbitMQ, Galera (MariaDB), Memcache, and all others need to support resiliency and leverage multiple replicas for resiliency where applicable. These components also need to be validated that their application level configurations (for instance the underlying galera cluster) can tolerate host crashes and withstand physical host failures. +- OpenStack components need to support and deploy with multiple replicas out of the box to ensure that each chart is deployed as a single-unit production ready first class citizen (unless development mode is enabled). +- Infrastructure elements such as Ceph, RabbitMQ, Galera (MariaDB), Memcached, and all others need to support resiliency and leverage multiple replicas for resiliency where applicable. These components also need to validate that their application level configurations (for instance the underlying Galera cluster) can tolerate host crashes and withstand physical host failures. - Scheduling annotations need to be employed to ensure maximum resiliency for multi-host environments. They also need to be flexible to allow all-in-one deployments. To this end, we promote the usage of `podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution` for most infrastructure elements. -- We make the assumption that we can depend on a reliable implementation of centralized storage to create PVCs within Kubernetes to support resiliency and complex application design. Today, this is powered by our own cheph chart as there is much work to do making even a single backend production ready and we need to focus bringing that to a production ready state, which includes handling real world deployment scenarios, resiliency, and pool configuration. In the future, we would like to support more choice for hardened backends. -- We will document the best practices for running a resilient Kubernetes cluster in production. This includes the steps necessary to make all components resilient, such as etcd, and skydns where possible, and point out gaps due to missing features. +- We make the assumption that we can depend on a reliable implementation of centralized storage to create PVCs within Kubernetes to support resiliency and complex application design. Today, this is provided by the included Ceph chart. There is much work to do when making even a single backend production ready. We have chosen to focus on bringing Ceph into a production ready state, which includes handling real world deployment scenarios, resiliency, and pool configurations. In the future we would like to support more options for hardened backend PVC's. In the future, we would like to offer flexibility in choosing a hardened backend. +- We will document the best practices for running a resilient Kubernetes cluster in production. This includes documenting the steps necessary to make all components resilient, such as Etcd and SkyDNS where possible, and point out gaps due to missing features. ## Scaling -Scaling is another first class citizen in openstack-helm. We will be working to ensure we support various deployment models that can support hyperscale, such as: +Scaling is another first class citizen in openstack-helm. We will be working to ensure that we support various deployment models that can support hyperscale, such as: -- Ensuring that out of the box, unless development mode is enabled, clusters receive multiple replicas to ensure scaling issues are identified early and often. -- Ensuring that every chart can support more then one replica and allowing operators to override those replica counts. For some applications, means ensuring they can support clustering. -- Ensuring clustering style applications are not limited to fixed replica counts. For instance, we want to ensure we can support N galera members and have those scale linearly within reason as opposed to only supporting a fixed count. +- Ensuring that by default, clusters include multiple replicas to verify that scaling issues are identified early and often (unless development mode is enabled). +- Ensuring that every chart can support more then one replica and allowing operators to override those replica counts. For some applications, this means that they support clustering. +- Ensuring clustering style applications are not limited to fixed replica counts. For instance, we want to ensure that we can support n=Galera members and have those scale linearly, within reason, as opposed to only supporting a fixed count. - Duplicate charts of the same type within the same namespace. For example, deploying rabbitmq twice, to the openstack namespace resulting in two fully functioning clusters. -- Allowing charts to be deployed to a diverse set of namespaces. Allowing infrastructure to be deployed in one namespace, and OpenStack in another, for example or each chart in its own namespace. -- Supporting hyperscale by ensuring we can support configurations that call for per-component infrastructure, such as dedicated database and rabbitmq solely for ceilometer or even dedicated infrastructure for every component you deploy. It is unique large scale deployment designs such as this that only become practical under a Kubernetes/Container framework and we want to ensure that we can support them. \ No newline at end of file +- Allowing charts to be deployed to a diverse set of namespaces. For example, allowing infrastructure to be deployed in one namespace and OpenStack in another, or deploying each chart in its own namespace. +- Supporting hyperscale configurations that call for per-component infrastructure, such as a dedicated database and RabbitMQ solely for Ceilometer, or even dedicated infrastructure(s) for every component you deploy. It is unique, large scale deployment designs such as this that only become practical under a Kubernetes/Container framework and we want to ensure that we can support them. From aa400cca7403bf5fb463a363985fc7bd48530aa7 Mon Sep 17 00:00:00 2001 From: "Eiden, Elise (ee550x)" Date: Wed, 1 Feb 2017 08:44:18 -0600 Subject: [PATCH 06/11] Resolves issue #165 --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 00c6b4b0a0..fe214b6d85 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ ## Table of Contents -##  1. [Openstack-Helm Design Principals]() +##  1. [Openstack-Helm Design Principles]() ###    1.1 [Mission](mission.md) #####      1.1.1 [Resiliency](mission.md#resiliency) #####      1.1.2 [Scaling](mission.md#scaling) From fc21a2e92411f167bcc8ad22f11a08ce030ee87a Mon Sep 17 00:00:00 2001 From: Marcellin Tchassem Date: Wed, 1 Feb 2017 21:47:59 -0600 Subject: [PATCH 07/11] Add resources limits and requests for some charts (#163) * Add resources limits and requests for each chart * Refactor the resources limits and requests to follow a patern * Fix some coding issues * fix issues resulting from feedback on the resources PR * Reset some variables to a static value in the neutron chart. * Substituting variable entrypoint by dependency_check in the concerned files * Few adjustments * Update deploy-region.yaml * Update deployment.yaml * Add resources limits and requests for each chart Squah all commits in one. * Add resources limits and requests for some charts * cleaning * Fix indendation issue * Update deployment.yaml * Update daemonset-ovs-vswitchd.yaml --- glance/templates/deployment-api.yaml | 9 +++ glance/templates/deployment-registry.yaml | 9 +++ glance/templates/job-db-init.yaml | 9 +++ glance/templates/job-db-sync.yaml | 9 +++ glance/templates/job-post.yaml | 9 +++ glance/values.yaml | 41 +++++++++- horizon/templates/deployment.yaml | 9 +++ horizon/values.yaml | 14 +++- keystone/templates/deployment.yaml | 9 +++ keystone/templates/job-db-init.yaml | 9 +++ keystone/templates/job-db-sync.yaml | 9 +++ keystone/values.yaml | 25 ++++++ maas/templates/deploy-rack.yaml | 11 ++- maas/templates/deploy-region.yaml | 11 ++- maas/values.yaml | 20 ++++- mariadb/templates/deployment.yaml | 9 +++ mariadb/templates/job-seed.yaml | 9 +++ mariadb/values.yaml | 18 +++++ memcached/templates/deployment.yaml | 9 +++ memcached/values.yaml | 8 ++ neutron/templates/daemonset-dhcp-agent.yaml | 9 +++ neutron/templates/daemonset-l3-agent.yaml | 9 +++ .../templates/daemonset-metadata-agent.yaml | 9 +++ neutron/templates/daemonset-ovs-agent.yaml | 9 +++ neutron/templates/daemonset-ovs-db.yaml | 9 +++ neutron/templates/daemonset-ovs-vswitchd.yaml | 9 +++ neutron/templates/deployment-server.yaml | 9 +++ neutron/templates/job-db-sync.yaml | 9 +++ neutron/templates/job-post.yaml | 9 +++ neutron/values.yaml | 78 ++++++++++++++++++- rabbitmq/templates/deployment.yaml | 9 +++ rabbitmq/values.yaml | 10 +++ 32 files changed, 427 insertions(+), 7 deletions(-) diff --git a/glance/templates/deployment-api.yaml b/glance/templates/deployment-api.yaml index d998fb5ded..aea5b40841 100644 --- a/glance/templates/deployment-api.yaml +++ b/glance/templates/deployment-api.yaml @@ -35,6 +35,15 @@ spec: - name: glance-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.api.limits.cpu | quote }} + memory: {{ .Values.resources.api.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.api.requests.cpu | quote }} + memory: {{ .Values.resources.api.requests.memory | quote }} + {{- end }} command: - glance-api - --config-file diff --git a/glance/templates/deployment-registry.yaml b/glance/templates/deployment-registry.yaml index 2d1f023b35..f83530a1bf 100644 --- a/glance/templates/deployment-registry.yaml +++ b/glance/templates/deployment-registry.yaml @@ -27,6 +27,15 @@ spec: - name: glance-registry image: {{ .Values.images.registry }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.registry.limits.cpu | quote }} + memory: {{ .Values.resources.registry.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.registry.requests.cpu | quote }} + memory: {{ .Values.resources.registry.requests.memory | quote }} + {{- end }} command: - glance-registry - --config-file diff --git a/glance/templates/job-db-init.yaml b/glance/templates/job-db-init.yaml index c66375c96e..20bff8ce26 100644 --- a/glance/templates/job-db-init.yaml +++ b/glance/templates/job-db-init.yaml @@ -19,6 +19,15 @@ spec: - name: glance-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.init.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.init.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.init.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.init.requests.memory | quote }} + {{- end }} env: - name: ANSIBLE_LIBRARY value: /usr/share/ansible/ diff --git a/glance/templates/job-db-sync.yaml b/glance/templates/job-db-sync.yaml index 3ecfb6af7b..23914b2dbe 100644 --- a/glance/templates/job-db-sync.yaml +++ b/glance/templates/job-db-sync.yaml @@ -19,6 +19,15 @@ spec: - name: glance-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.db.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.db.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.db.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.db.requests.memory | quote }} + {{- end }} command: - glance-manage - db_sync diff --git a/glance/templates/job-post.yaml b/glance/templates/job-post.yaml index bbb53d760a..fbb011ae55 100644 --- a/glance/templates/job-post.yaml +++ b/glance/templates/job-post.yaml @@ -19,6 +19,15 @@ spec: - name: glance-post image: {{ .Values.images.post }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.post.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.post.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.post.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.post.requests.memory | quote }} + {{- end }} command: - bash - /tmp/post.sh diff --git a/glance/values.yaml b/glance/values.yaml index e8ab2f70a2..75678b5439 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -1,4 +1,4 @@ -# Default values for keystone. +# Default values for glance. # This is a YAML-formatted file. # Declare name/value pairs to be passed into your templates. # name: value @@ -72,6 +72,45 @@ misc: workers: 8 debug: false +resources: + enabled: false + api: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + registry: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + jobs: + db: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + init: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + post: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + dependencies: api: jobs: diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index 9d97e9cdfe..25b90efb0c 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -31,6 +31,15 @@ spec: - name: horizon image: {{ .Values.images.horizon }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.dashboard.limits.cpu | quote }} + memory: {{ .Values.resources.dashboard.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.dashboard.requests.cpu | quote }} + memory: {{ .Values.resources.dashboard.requests.memory | quote }} + {{- end }} command: - bash - /tmp/start.sh diff --git a/horizon/values.yaml b/horizon/values.yaml index 84caa6d950..500c727d72 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -1,4 +1,4 @@ -# Default values for memcached. +# Default values for horizon. # This is a YAML-formatted file. # Declare name/value pairs to be passed into your templates. # name: value @@ -36,7 +36,17 @@ dependencies: - memcached - keystone-api -# typically overriden by environmental +resources: + enabled: false + dashboard: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + +# mits:typically overriden by environmental # values, but should include all endpoints # required by this chart endpoints: diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 21321c994b..9b1c58b2f5 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -31,6 +31,15 @@ spec: - name: keystone-api image: {{ .Values.images.api }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.api.limits.cpu | quote }} + memory: {{ .Values.resources.api.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.api.requests.cpu | quote }} + memory: {{ .Values.resources.api.requests.memory | quote }} + {{- end }} command: - bash - /tmp/start.sh diff --git a/keystone/templates/job-db-init.yaml b/keystone/templates/job-db-init.yaml index b0443a5931..332ed2e1b6 100644 --- a/keystone/templates/job-db-init.yaml +++ b/keystone/templates/job-db-init.yaml @@ -19,6 +19,15 @@ spec: - name: keystone-db-init image: {{ .Values.images.db_init }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.init.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.init.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.init.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.init.requests.memory | quote }} + {{- end }} command: - bash - /tmp/init.sh diff --git a/keystone/templates/job-db-sync.yaml b/keystone/templates/job-db-sync.yaml index d38bbc9e66..0b98976172 100644 --- a/keystone/templates/job-db-sync.yaml +++ b/keystone/templates/job-db-sync.yaml @@ -19,6 +19,15 @@ spec: - name: keystone-db-sync image: {{ .Values.images.db_sync }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.db_sync.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.db_sync.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.db_sync.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.db_sync.requests.memory | quote }} + {{- end }} command: - bash - /tmp/db-sync.sh diff --git a/keystone/values.yaml b/keystone/values.yaml index 1aa064a1d0..48683a96f5 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -77,6 +77,31 @@ dependencies: service: - mariadb +resources: + enabled: false + api: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + jobs: + db_sync: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + init: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + # typically overriden by environmental # values, but should include all endpoints # required by this chart diff --git a/maas/templates/deploy-rack.yaml b/maas/templates/deploy-rack.yaml index bd89d6b935..e2c6af2478 100644 --- a/maas/templates/deploy-rack.yaml +++ b/maas/templates/deploy-rack.yaml @@ -14,6 +14,15 @@ spec: containers: - name: maas-rack image: {{ .Values.images.maas_rack }} - imagePullPolicy: Always + imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.maas_rack_controller.limits.cpu | quote }} + memory: {{ .Values.resources.maas_rack_controller.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.maas_rack_controller.requests.cpu | quote }} + memory: {{ .Values.resources.maas_rack_controller.requests.memory | quote }} + {{- end }} securityContext: privileged: true diff --git a/maas/templates/deploy-region.yaml b/maas/templates/deploy-region.yaml index 31567170f2..18cf77578a 100644 --- a/maas/templates/deploy-region.yaml +++ b/maas/templates/deploy-region.yaml @@ -51,7 +51,16 @@ spec: containers: - name: maas-region image: {{ .Values.images.maas_region }} - imagePullPolicy: Always + imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.maas_region.limits.cpu | quote }} + memory: {{ .Values.resources.maas_region.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.maas_region.requests.cpu | quote }} + memory: {{ .Values.resources.maas_region.requests.memory | quote}} + {{- end }} ports: - containerPort: {{ .Values.network.port.region_container }} readinessProbe: diff --git a/maas/values.yaml b/maas/values.yaml index 8a7862ec89..421e66ca6d 100644 --- a/maas/values.yaml +++ b/maas/values.yaml @@ -5,6 +5,7 @@ images: maas_region: quay.io/attcomdev/maas-region:2.1.2-1 maas_rack: quay.io/attcomdev/maas-rack:2.1.2-1 + pull_policy: Always labels: node_selector_key: openstack-control-plane @@ -18,4 +19,21 @@ network: service_proxy: 8000 service_proxy_target: 8000 -service_name: maas-region-ui +service_name: maas-region-ui + +resources: + enabled: false + maas_rack_controller: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + maas_region: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" diff --git a/mariadb/templates/deployment.yaml b/mariadb/templates/deployment.yaml index 8a456ee3ba..341e3f238e 100644 --- a/mariadb/templates/deployment.yaml +++ b/mariadb/templates/deployment.yaml @@ -43,6 +43,15 @@ spec: - name: {{ .Values.service_name }} image: {{ .Values.images.mariadb }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.api.limits.cpu | quote }} + memory: {{ .Values.resources.api.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.api.requests.cpu | quote }} + memory: {{ .Values.resources.api.requests.memory | quote }} + {{- end }} env: - name: INTERFACE_NAME value: "eth0" diff --git a/mariadb/templates/job-seed.yaml b/mariadb/templates/job-seed.yaml index c8930621a0..762801e19d 100644 --- a/mariadb/templates/job-seed.yaml +++ b/mariadb/templates/job-seed.yaml @@ -16,6 +16,15 @@ spec: - name: mariadb-init image: {{ .Values.images.mariadb }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.job.seed.limits.cpu | quote }} + memory: {{ .Values.resources.job.seed.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.job.seed.requests.cpu | quote }} + memory: {{ .Values.resources.job.seed.requests.memory | quote }} + {{- end }} env: - name: INTERFACE_NAME value: "eth0" diff --git a/mariadb/values.yaml b/mariadb/values.yaml index 0a13e96581..df015f6569 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -21,6 +21,24 @@ development: enabled: false storage_path: /data/openstack-helm/mariadb +resources: + enabled: false + api: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + job: + seed: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + # this drives the service name, and statefulset name service_name: mariadb diff --git a/memcached/templates/deployment.yaml b/memcached/templates/deployment.yaml index 020265758e..4bbe9cb4a0 100644 --- a/memcached/templates/deployment.yaml +++ b/memcached/templates/deployment.yaml @@ -23,6 +23,15 @@ spec: - name: memcached image: {{ .Values.images.memcached }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.api.limits.cpu | quote }} + memory: {{ .Values.resources.api.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.api.requests.cpu | quote }} + memory: {{ .Values.resources.api.requests.memory | quote }} + {{- end }} command: ["sh", "-xec"] args: - | diff --git a/memcached/values.yaml b/memcached/values.yaml index 8b993d9cc9..ea03a7cae4 100644 --- a/memcached/values.yaml +++ b/memcached/values.yaml @@ -26,5 +26,13 @@ memcached: max_connections: 8192 resources: + enabled: false memcached: replicas: 1 + api: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" diff --git a/neutron/templates/daemonset-dhcp-agent.yaml b/neutron/templates/daemonset-dhcp-agent.yaml index 4a56ee6ed1..452d7ab76d 100644 --- a/neutron/templates/daemonset-dhcp-agent.yaml +++ b/neutron/templates/daemonset-dhcp-agent.yaml @@ -26,6 +26,15 @@ spec: - name: neutron-dhcp-agent image: {{ .Values.images.dhcp }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.agent.dhcp.limits.cpu | quote }} + memory: {{ .Values.resources.agent.dhcp.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.agent.dhcp.requests.cpu | quote }} + memory: {{ .Values.resources.agent.dhcp.requests.memory | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/neutron/templates/daemonset-l3-agent.yaml b/neutron/templates/daemonset-l3-agent.yaml index c73ba0da3c..32779333b0 100644 --- a/neutron/templates/daemonset-l3-agent.yaml +++ b/neutron/templates/daemonset-l3-agent.yaml @@ -26,6 +26,15 @@ spec: - name: neutron-l3-agent image: {{ .Values.images.l3 }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.agent.l3.limits.cpu | quote }} + memory: {{ .Values.resources.agent.l3.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.agent.l3.requests.cpu | quote }} + memory: {{ .Values.resources.agent.l3.requests.memory | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/neutron/templates/daemonset-metadata-agent.yaml b/neutron/templates/daemonset-metadata-agent.yaml index 6d1804aec8..3a0474a9ee 100644 --- a/neutron/templates/daemonset-metadata-agent.yaml +++ b/neutron/templates/daemonset-metadata-agent.yaml @@ -26,6 +26,15 @@ spec: - name: neutron-metadata-agent image: {{ .Values.images.metadata }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.agent.metadata.limits.cpu | quote }} + memory: {{ .Values.resources.agent.metadata.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.agent.metadata.requests.cpu | quote }} + memory: {{ .Values.resources.agent.metadata.requests.memory | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/neutron/templates/daemonset-ovs-agent.yaml b/neutron/templates/daemonset-ovs-agent.yaml index a0e173c7ce..0d21319504 100644 --- a/neutron/templates/daemonset-ovs-agent.yaml +++ b/neutron/templates/daemonset-ovs-agent.yaml @@ -26,6 +26,15 @@ spec: - name: ovs-agent image: {{ .Values.images.neutron_openvswitch_agent }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.ovs.agent.limits.cpu | quote }} + memory: {{ .Values.resources.ovs.agent.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.ovs.agent.requests.cpu | quote }} + memory: {{ .Values.resources.ovs.agent.requests.memory | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/neutron/templates/daemonset-ovs-db.yaml b/neutron/templates/daemonset-ovs-db.yaml index f503231c71..a65af8813b 100644 --- a/neutron/templates/daemonset-ovs-db.yaml +++ b/neutron/templates/daemonset-ovs-db.yaml @@ -21,6 +21,15 @@ spec: - name: ovs-db image: {{ .Values.images.openvswitch_db_server }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.ovs.db.limits.cpu | quote }} + memory: {{ .Values.resources.ovs.db.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.ovs.db.requests.cpu | quote }} + memory: {{ .Values.resources.ovs.db.requests.memory | quote }} + {{- end }} securityContext: privileged: true command: diff --git a/neutron/templates/daemonset-ovs-vswitchd.yaml b/neutron/templates/daemonset-ovs-vswitchd.yaml index da33099bd8..3ab6f550f1 100644 --- a/neutron/templates/daemonset-ovs-vswitchd.yaml +++ b/neutron/templates/daemonset-ovs-vswitchd.yaml @@ -21,6 +21,15 @@ spec: - name: ovs-vswitchd image: {{ .Values.images.openvswitch_vswitchd }} imagePullPolicy: {{ .Values.images.pull_policy }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.ovs.vswitchd.limits.cpu | quote }} + memory: {{ .Values.resources.ovs.vswitchd.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.ovs.vswitchd.requests.cpu | quote }} + memory: {{ .Values.resources.ovs.vswitchd.requests.memory | quote }} + {{- end }} securityContext: privileged: true # ensures this container can speak to the ovs database diff --git a/neutron/templates/deployment-server.yaml b/neutron/templates/deployment-server.yaml index 95abe45084..81ae81313c 100644 --- a/neutron/templates/deployment-server.yaml +++ b/neutron/templates/deployment-server.yaml @@ -37,6 +37,15 @@ spec: - /etc/neutron/neutron.conf - --config-file - /etc/neutron/plugins/ml2/ml2-conf.ini + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.server.limits.cpu | quote }} + memory: {{ .Values.resources.server.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.server.requests.cpu | quote }} + memory: {{ .Values.resources.server.requests.memory | quote }} + {{- end }} ports: - containerPort: {{ .Values.network.port.server }} readinessProbe: diff --git a/neutron/templates/job-db-sync.yaml b/neutron/templates/job-db-sync.yaml index 1070a2da58..ea9d30bc99 100644 --- a/neutron/templates/job-db-sync.yaml +++ b/neutron/templates/job-db-sync.yaml @@ -27,6 +27,15 @@ spec: - /etc/neutron/plugins/ml2/ml2-conf.ini - upgrade - head + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.db_sync.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.db_sync.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.db_sync.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.db_sync.requests.memory | quote }} + {{- end }} volumeMounts: - name: pod-etc-neutron mountPath: /etc/neutron diff --git a/neutron/templates/job-post.yaml b/neutron/templates/job-post.yaml index 80dc94f2b8..9901e57e42 100644 --- a/neutron/templates/job-post.yaml +++ b/neutron/templates/job-post.yaml @@ -22,6 +22,15 @@ spec: command: - bash - /tmp/post.sh + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.jobs.post.limits.cpu | quote }} + memory: {{ .Values.resources.jobs.post.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.jobs.post.requests.cpu | quote }} + memory: {{ .Values.resources.jobs.post.requests.memory | quote }} + {{- end }} env: - name: ANSIBLE_LIBRARY value: /usr/share/ansible/ diff --git a/neutron/values.yaml b/neutron/values.yaml index 4502fe0d8c..4b55dcbfb1 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -1,4 +1,4 @@ -# Default values for memcached. +# Default values for neutron. # This is a YAML-formatted file. # Declare name/value pairs to be passed into your templates. # name: value @@ -199,6 +199,82 @@ dependencies: jobs: - neutron-db-sync +resources: + enabled: false + agent: + dhcp: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + l3: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + metadata: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + ovs: + agent: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + db: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + vswitchd: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + server: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + jobs: + db_sync: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + init: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + post: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + # typically overriden by environmental # values, but should include all endpoints # required by this chart diff --git a/rabbitmq/templates/deployment.yaml b/rabbitmq/templates/deployment.yaml index d622f8c56e..bd8815fda3 100644 --- a/rabbitmq/templates/deployment.yaml +++ b/rabbitmq/templates/deployment.yaml @@ -30,6 +30,15 @@ spec: containers: - name: rabbitmq image: {{ .Values.images.rabbitmq }} + {{- if .Values.resources.enabled }} + resources: + limits: + cpu: {{ .Values.resources.api.limits.cpu | quote }} + memory: {{ .Values.resources.api.limits.memory | quote }} + requests: + cpu: {{ .Values.resources.api.requests.cpu | quote }} + memory: {{ .Values.resources.api.requests.memory | quote }} + {{- end }} command: - bash - /tmp/start_rabbitmq.sh diff --git a/rabbitmq/values.yaml b/rabbitmq/values.yaml index 8d44741b0b..6cf4699908 100644 --- a/rabbitmq/values.yaml +++ b/rabbitmq/values.yaml @@ -5,6 +5,16 @@ replicas: "1" # this must be quoted to deal with atoi +resources: + enabled: false + api: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "500m" + labels: node_selector_key: openstack-control-plane node_selector_value: enabled From bdc556454295e31ee72e6907636dbe9b987ecdbf Mon Sep 17 00:00:00 2001 From: "Brandon B. Jozsa" Date: Fri, 3 Feb 2017 09:48:17 -0500 Subject: [PATCH 08/11] adding apache-lic header for ceph --- ceph/Chart.yaml | 14 +++++++++++ ceph/requirements.yaml | 15 +++++++++++- ceph/templates/daemonset-osd.yaml | 14 +++++++++++ ceph/templates/deployment-mds.yaml | 14 +++++++++++ ceph/templates/deployment-moncheck.yaml | 16 ++++++++++++- ceph/templates/deployment-rgw.yaml | 16 ++++++++++++- ceph/templates/secrets.yaml | 14 +++++++++++ ceph/templates/service.yaml | 14 +++++++++++ ceph/templates/statefulset-mon.yaml | 18 ++++++++++++-- ceph/templates/storage.yaml | 14 +++++++++++ ceph/values.yaml | 31 ++++++++++++++----------- 11 files changed, 162 insertions(+), 18 deletions(-) diff --git a/ceph/Chart.yaml b/ceph/Chart.yaml index 008a2cb43b..c5d6e4f8f3 100755 --- a/ceph/Chart.yaml +++ b/ceph/Chart.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + description: A Helm chart for Kubernetes name: ceph version: 0.1.0 diff --git a/ceph/requirements.yaml b/ceph/requirements.yaml index 5a6564045d..7a29aad448 100644 --- a/ceph/requirements.yaml +++ b/ceph/requirements.yaml @@ -1,5 +1,18 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + dependencies: - name: common repository: http://localhost:8879/charts version: 0.1.0 - diff --git a/ceph/templates/daemonset-osd.yaml b/ceph/templates/daemonset-osd.yaml index 9f85d599c1..0092830c17 100644 --- a/ceph/templates/daemonset-osd.yaml +++ b/ceph/templates/daemonset-osd.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- kind: DaemonSet apiVersion: extensions/v1beta1 diff --git a/ceph/templates/deployment-mds.yaml b/ceph/templates/deployment-mds.yaml index e2f7181193..b45b4d7569 100644 --- a/ceph/templates/deployment-mds.yaml +++ b/ceph/templates/deployment-mds.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- kind: Deployment apiVersion: extensions/v1beta1 diff --git a/ceph/templates/deployment-moncheck.yaml b/ceph/templates/deployment-moncheck.yaml index d2d93333b5..e0fe838878 100644 --- a/ceph/templates/deployment-moncheck.yaml +++ b/ceph/templates/deployment-moncheck.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- kind: Deployment apiVersion: extensions/v1beta1 @@ -16,7 +30,7 @@ spec: daemon: moncheck spec: nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} serviceAccount: default volumes: - name: ceph-conf diff --git a/ceph/templates/deployment-rgw.yaml b/ceph/templates/deployment-rgw.yaml index 72069d43d5..430113beb5 100644 --- a/ceph/templates/deployment-rgw.yaml +++ b/ceph/templates/deployment-rgw.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + {{- if .Values.rgw.enabled }} --- kind: Deployment @@ -5,7 +19,7 @@ apiVersion: extensions/v1beta1 metadata: labels: app: ceph - daemon: rgw + daemon: rgw name: ceph-rgw spec: replicas: {{ .Values.replicas.rgw }} diff --git a/ceph/templates/secrets.yaml b/ceph/templates/secrets.yaml index 63a5b9e111..8c11ec2f7d 100644 --- a/ceph/templates/secrets.yaml +++ b/ceph/templates/secrets.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + {{- if .Values.secrets.use_common_secrets -}} --- apiVersion: v1 diff --git a/ceph/templates/service.yaml b/ceph/templates/service.yaml index 1a5f85b88e..2015ee7ae6 100644 --- a/ceph/templates/service.yaml +++ b/ceph/templates/service.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- kind: Service apiVersion: v1 diff --git a/ceph/templates/statefulset-mon.yaml b/ceph/templates/statefulset-mon.yaml index 265dafbaaa..5aa86a1564 100644 --- a/ceph/templates/statefulset-mon.yaml +++ b/ceph/templates/statefulset-mon.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- apiVersion: apps/v1beta1 kind: StatefulSet @@ -37,7 +51,7 @@ spec: } spec: nodeSelector: - {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} + {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} serviceAccount: default volumes: - name: ceph-conf @@ -53,7 +67,7 @@ spec: secret: secretName: ceph-bootstrap-rgw-keyring - name: ceph-monfs - hostPath: + hostPath: path: {{ .Values.storage.mon_directory }} containers: - name: ceph-mon diff --git a/ceph/templates/storage.yaml b/ceph/templates/storage.yaml index b60221c10a..084a75e9e3 100644 --- a/ceph/templates/storage.yaml +++ b/ceph/templates/storage.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # note that these secrets are handled by the common chart, not the ceph # chart, as we likely want them "everywhere" --- diff --git a/ceph/values.yaml b/ceph/values.yaml index aa55e6444a..e865f7d06e 100644 --- a/ceph/values.yaml +++ b/ceph/values.yaml @@ -1,11 +1,16 @@ -# Default values for ceph. -# This is a YAML-formatted file. -# Declare name/value pairs to be passed into your templates. -# name: value +# Copyright 2017 The Openstack-Helm Authors. # -# alanmeadows(NOTE): this is merely a sample of the potential -# tunables available - parameterizing more of the elements -# in the manifests is a work in progress +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. replicas: mon: 3 @@ -26,7 +31,7 @@ labels: network: public: "10.25.0.0/16" - port: + port: mon: 6789 rgw_ingress: 80 rgw_target: 8088 @@ -78,22 +83,22 @@ resources: cpu: "250m" limits: memory: "50Mi" - cpu: "500m" + cpu: "500m" # Setting this to false will assume you will -# setup and orchestrate your own secrets and +# setup and orchestrate your own secrets and # configmaps outside of this helm chart -# +# # The list below is in the format of # # configMapName: # elementKeyName # -# ceph.conf: +# ceph.conf: # ceph.conf # ceph.client.admin.keyring # ceph.client.admin.keyring -# ceph.mon.keyring: +# ceph.mon.keyring: # ceph.mon.keyring # ceph-bootstrap-rgw-keyring: # ceph.keyring From a5c2e9d4891b4aa8e90b812415ce4e8e7d6d17f4 Mon Sep 17 00:00:00 2001 From: "Brandon B. Jozsa" Date: Fri, 3 Feb 2017 10:24:31 -0500 Subject: [PATCH 09/11] adding apache-lic header for mariadb --- mariadb/Chart.yaml | 14 ++++++++++++ mariadb/requirements.yaml | 14 ++++++++++++ mariadb/templates/bin/_bootstrap-db.sh.tpl | 13 +++++++++++ mariadb/templates/bin/_peer-finder.py.tpl | 15 ++++++++++++- mariadb/templates/bin/_readiness.py.tpl | 14 ++++++++++++ mariadb/templates/bin/_seed.sh.tpl | 13 +++++++++++ mariadb/templates/bin/_start.sh.tpl | 16 ++++++++++++- mariadb/templates/configmap-bin.yaml | 20 ++++++++++++++--- mariadb/templates/configmap-etc.yaml | 26 +++++++++++++++++----- mariadb/templates/deployment.yaml | 24 +++++++++++++++----- mariadb/templates/etc/_charsets.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_engine.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_galera-my.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_log.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_networking.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_pid.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_tuning.cnf.tpl | 14 ++++++++++++ mariadb/templates/etc/_wsrep.cnf.tpl | 14 ++++++++++++ mariadb/templates/job-seed.yaml | 18 +++++++++++++-- mariadb/templates/service.yaml | 14 ++++++++++++ mariadb/values.yaml | 23 +++++++++++++------ 21 files changed, 311 insertions(+), 25 deletions(-) diff --git a/mariadb/Chart.yaml b/mariadb/Chart.yaml index 4cb81e13b7..4711e51292 100644 --- a/mariadb/Chart.yaml +++ b/mariadb/Chart.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 description: A helm chart for mariadb name: mariadb diff --git a/mariadb/requirements.yaml b/mariadb/requirements.yaml index 2350b1facb..65cf88221f 100644 --- a/mariadb/requirements.yaml +++ b/mariadb/requirements.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + dependencies: - name: common repository: http://localhost:8879/charts diff --git a/mariadb/templates/bin/_bootstrap-db.sh.tpl b/mariadb/templates/bin/_bootstrap-db.sh.tpl index 6e491d6423..bc1b7d5880 100644 --- a/mariadb/templates/bin/_bootstrap-db.sh.tpl +++ b/mariadb/templates/bin/_bootstrap-db.sh.tpl @@ -1,4 +1,17 @@ #!/bin/sh +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. set -ex diff --git a/mariadb/templates/bin/_peer-finder.py.tpl b/mariadb/templates/bin/_peer-finder.py.tpl index ceff6751ef..bceab182a5 100644 --- a/mariadb/templates/bin/_peer-finder.py.tpl +++ b/mariadb/templates/bin/_peer-finder.py.tpl @@ -1,4 +1,18 @@ #!/usr/bin/env python +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import os import urllib2 @@ -88,4 +102,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/mariadb/templates/bin/_readiness.py.tpl b/mariadb/templates/bin/_readiness.py.tpl index d0ecd881ce..5261b87490 100644 --- a/mariadb/templates/bin/_readiness.py.tpl +++ b/mariadb/templates/bin/_readiness.py.tpl @@ -1,4 +1,18 @@ #!/usr/bin/env python +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import sys import time diff --git a/mariadb/templates/bin/_seed.sh.tpl b/mariadb/templates/bin/_seed.sh.tpl index 95f2b80fb7..51a1e1c69d 100644 --- a/mariadb/templates/bin/_seed.sh.tpl +++ b/mariadb/templates/bin/_seed.sh.tpl @@ -1,4 +1,17 @@ #!/bin/sh +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. set -ex diff --git a/mariadb/templates/bin/_start.sh.tpl b/mariadb/templates/bin/_start.sh.tpl index f46d6cfc9e..1a747cf00e 100644 --- a/mariadb/templates/bin/_start.sh.tpl +++ b/mariadb/templates/bin/_start.sh.tpl @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -ex trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT @@ -24,7 +38,7 @@ fi if [ "$REPLICAS" -eq 1 ] ; then if [[ ! -f ${INIT_MARKER} ]]; then - cd /var/lib/mysql + cd /var/lib/mysql echo "Creating one-instance MariaDB." bash /tmp/bootstrap-db.sh touch ${INIT_MARKER} diff --git a/mariadb/templates/configmap-bin.yaml b/mariadb/templates/configmap-bin.yaml index e9c7131207..7c459790e0 100644 --- a/mariadb/templates/configmap-bin.yaml +++ b/mariadb/templates/configmap-bin.yaml @@ -1,15 +1,29 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 kind: ConfigMap metadata: name: mariadb-bin data: start.sh: | -{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }} +{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }} peer-finder.py: | {{ tuple "bin/_peer-finder.py.tpl" . | include "template" | indent 4 }} readiness.py: | -{{ tuple "bin/_readiness.py.tpl" . | include "template" | indent 4 }} +{{ tuple "bin/_readiness.py.tpl" . | include "template" | indent 4 }} bootstrap-db.sh: | {{ tuple "bin/_bootstrap-db.sh.tpl" . | include "template" | indent 4 }} seed.sh: | -{{ tuple "bin/_seed.sh.tpl" . | include "template" | indent 4 }} +{{ tuple "bin/_seed.sh.tpl" . | include "template" | indent 4 }} diff --git a/mariadb/templates/configmap-etc.yaml b/mariadb/templates/configmap-etc.yaml index 5bd2595771..006357b6d7 100644 --- a/mariadb/templates/configmap-etc.yaml +++ b/mariadb/templates/configmap-etc.yaml @@ -1,21 +1,35 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 kind: ConfigMap metadata: name: mariadb-etc data: charsets.cnf: | -{{ tuple "etc/_charsets.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_charsets.cnf.tpl" . | include "template" | indent 4 }} engine.cnf: | {{ tuple "etc/_engine.cnf.tpl" . | include "template" | indent 4 }} my.cnf: | -{{ tuple "etc/_galera-my.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_galera-my.cnf.tpl" . | include "template" | indent 4 }} log.cnf: | {{ tuple "etc/_log.cnf.tpl" . | include "template" | indent 4 }} pid.cnf: | -{{ tuple "etc/_pid.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_pid.cnf.tpl" . | include "template" | indent 4 }} tuning.cnf: | -{{ tuple "etc/_tuning.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_tuning.cnf.tpl" . | include "template" | indent 4 }} networking.cnf: | -{{ tuple "etc/_networking.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_networking.cnf.tpl" . | include "template" | indent 4 }} wsrep.cnf: | -{{ tuple "etc/_wsrep.cnf.tpl" . | include "template" | indent 4 }} \ No newline at end of file +{{ tuple "etc/_wsrep.cnf.tpl" . | include "template" | indent 4 }} diff --git a/mariadb/templates/deployment.yaml b/mariadb/templates/deployment.yaml index 341e3f238e..2a7669c123 100644 --- a/mariadb/templates/deployment.yaml +++ b/mariadb/templates/deployment.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- apiVersion: apps/v1beta1 kind: StatefulSet @@ -99,19 +113,19 @@ spec: mountPath: /mariadb-readiness.py subPath: readiness.py - name: charsets - mountPath: /etc/my.cnf.d/charsets.cnf + mountPath: /etc/my.cnf.d/charsets.cnf subPath: charsets.cnf - name: engine mountPath: /etc/my.cnf.d/engine.cnf subPath: engine.cnf - name: log - mountPath: /etc/my.cnf.d/log.cnf + mountPath: /etc/my.cnf.d/log.cnf subPath: log.cnf - name: mycnf - mountPath: /etc/my.cnf + mountPath: /etc/my.cnf subPath: my.cnf - name: networking - mountPath: /etc/my.cnf.d/networking.cnf + mountPath: /etc/my.cnf.d/networking.cnf subPath: networking.cnf - name: pid mountPath: /etc/my.cnf.d/pid.cnf @@ -123,7 +137,7 @@ spec: mountPath: /etc/my.cnf.d/wsrep.cnf subPath: wsrep.cnf - name: mysql-data - mountPath: /var/lib/mysql + mountPath: /var/lib/mysql volumes: - name: mycnfd emptyDir: {} diff --git a/mariadb/templates/etc/_charsets.cnf.tpl b/mariadb/templates/etc/_charsets.cnf.tpl index ae30a83278..9f9f61cba4 100644 --- a/mariadb/templates/etc/_charsets.cnf.tpl +++ b/mariadb/templates/etc/_charsets.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] character_set_server=utf8 collation_server=utf8_unicode_ci diff --git a/mariadb/templates/etc/_engine.cnf.tpl b/mariadb/templates/etc/_engine.cnf.tpl index 78f7815bc3..7ec3f21a7d 100644 --- a/mariadb/templates/etc/_engine.cnf.tpl +++ b/mariadb/templates/etc/_engine.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] default-storage-engine=InnoDB innodb=FORCE diff --git a/mariadb/templates/etc/_galera-my.cnf.tpl b/mariadb/templates/etc/_galera-my.cnf.tpl index 9a515fd9d6..818f575863 100644 --- a/mariadb/templates/etc/_galera-my.cnf.tpl +++ b/mariadb/templates/etc/_galera-my.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] datadir=/var/lib/mysql basedir=/usr diff --git a/mariadb/templates/etc/_log.cnf.tpl b/mariadb/templates/etc/_log.cnf.tpl index 0aeeaad8ec..2fb854050e 100644 --- a/mariadb/templates/etc/_log.cnf.tpl +++ b/mariadb/templates/etc/_log.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] slow_query_log=off slow_query_log_file=/var/log/mysql/mariadb-slow.log diff --git a/mariadb/templates/etc/_networking.cnf.tpl b/mariadb/templates/etc/_networking.cnf.tpl index f1f768124f..41bdda9ca7 100644 --- a/mariadb/templates/etc/_networking.cnf.tpl +++ b/mariadb/templates/etc/_networking.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] bind_address=0.0.0.0 port={{ .Values.network.port.mariadb }} diff --git a/mariadb/templates/etc/_pid.cnf.tpl b/mariadb/templates/etc/_pid.cnf.tpl index ed2a80ed5a..aeb9cc6d6e 100644 --- a/mariadb/templates/etc/_pid.cnf.tpl +++ b/mariadb/templates/etc/_pid.cnf.tpl @@ -1,2 +1,16 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] pid_file=/var/lib/mysql/mariadb.pid diff --git a/mariadb/templates/etc/_tuning.cnf.tpl b/mariadb/templates/etc/_tuning.cnf.tpl index 8f308dbafb..52022373c7 100644 --- a/mariadb/templates/etc/_tuning.cnf.tpl +++ b/mariadb/templates/etc/_tuning.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] user=mysql max_allowed_packet=256M diff --git a/mariadb/templates/etc/_wsrep.cnf.tpl b/mariadb/templates/etc/_wsrep.cnf.tpl index ca999790eb..f5eb0f76f3 100644 --- a/mariadb/templates/etc/_wsrep.cnf.tpl +++ b/mariadb/templates/etc/_wsrep.cnf.tpl @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [mysqld] wsrep_cluster_name="{{ .Values.database.cluster_name }}" wsrep_provider=/usr/lib/galera/libgalera_smm.so diff --git a/mariadb/templates/job-seed.yaml b/mariadb/templates/job-seed.yaml index 762801e19d..77a0eca18c 100644 --- a/mariadb/templates/job-seed.yaml +++ b/mariadb/templates/job-seed.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- apiVersion: batch/v1 kind: Job @@ -35,7 +49,7 @@ spec: - name: POD_IP valueFrom: fieldRef: - fieldPath: status.podIP + fieldPath: status.podIP - name: NAMESPACE valueFrom: fieldRef: @@ -91,7 +105,7 @@ spec: - name: bootstrapdb configMap: name: mariadb-bin - - name: peerfinder + - name: peerfinder configMap: name: mariadb-bin - name: charsets diff --git a/mariadb/templates/service.yaml b/mariadb/templates/service.yaml index 7cadcaadc7..38cf6fcecf 100644 --- a/mariadb/templates/service.yaml +++ b/mariadb/templates/service.yaml @@ -1,3 +1,17 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 kind: Service metadata: diff --git a/mariadb/values.yaml b/mariadb/values.yaml index df015f6569..b5943c6d0c 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -1,7 +1,16 @@ -# Default values for mariadb. -# This is a YAML-formatted file. -# Declare name/value pairs to be passed into your templates. -# name: value +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # note that you need to update the gcomm member list # below when changing this value @@ -57,12 +66,12 @@ labels: network: port: - wsrep: 4567 - mariadb: 3306 + wsrep: 4567 + mariadb: 3306 ist: 4444 dns: kubernetes_domain: cluster.local - + database: root_password: password cluster_name: mariadb From 7fd9b75cdb136dc0abbbe2654fb8cd4b9d44b2e0 Mon Sep 17 00:00:00 2001 From: mattmceuen Date: Sat, 4 Feb 2017 10:47:05 -0600 Subject: [PATCH 10/11] Adds "helm repo add" to minikube.md TLDR Fix for issue #172 --- docs/developer/minikube.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/developer/minikube.md b/docs/developer/minikube.md index 7833ceb7a0..77b7f7439b 100644 --- a/docs/developer/minikube.md +++ b/docs/developer/minikube.md @@ -37,6 +37,7 @@ git checkout 0.1.0 # Start a local Helm Server: helm serve & +helm repo add local http://localhost:8879/charts # You may need to change these params for your environment. Look up use of --iso-url if needed: minikube start \ From 79ea40383d9448589485583d8dea99e8a69347f2 Mon Sep 17 00:00:00 2001 From: mattmceuen Date: Sun, 5 Feb 2017 11:22:53 -0600 Subject: [PATCH 11/11] Clarifies MariaDB hostPath info in minikube.md Fix for issue #174 --- docs/developer/minikube.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/minikube.md b/docs/developer/minikube.md index 77b7f7439b..108876c002 100644 --- a/docs/developer/minikube.md +++ b/docs/developer/minikube.md @@ -167,7 +167,7 @@ After following the instructions above your environment is in a state where you Consider the following when using Minikube and development mode: * Persistent Storage used for Minikube development mode is `hostPath`. The Ceph PVC's included with this project are not intended to work with Minikube. * There is *no need* to install the `common` `ceph` or `bootstrap` charts. These charts are required for deploying Ceph PVC's. -* Familiarize yourself with `values.yaml` included with the MariaDB chart. You will want to have the `hostPath` directory created prior to deploying MariaDB. +* Familiarize yourself with `values.yaml` included with the MariaDB chart. You will want to have the `storage_path` directory created prior to deploying MariaDB. This value will be used as the deployment's `hostPath`. * If Ceph development is required, you will need to follow the [getting started guide](https://github.com/att-comdev/openstack-helm/blob/master/docs/installation/getting-started.md) rather than this development mode documentation. To deploy Openstack-Helm in development mode, ensure you've created a minikube-approved `hostPath` volume. Minikube is very specific about what is expected for `hostPath` volumes. The following volumes are acceptable for minikube deployments: