Marcellin Tchassem fc21a2e924 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
2017-02-01 19:47:59 -08:00

113 lines
3.6 KiB
YAML

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: maas-region
spec:
serviceName: "{{ .Values.service_name }}"
template:
metadata:
labels:
app: maas-region
annotations:
pod.beta.kubernetes.io/init-containers: '[
{
"name": "init",
"image": "{{ .Values.images.maas_region }}",
"imagePullPolicy": "Always",
"command": ["bash", "/tmp/start.sh"],
"volumeMounts": [
{
"name": "maas-config",
"mountPath": "/etc/maas/"
},
{
"name": "postgresql-config",
"mountPath": "/etc/postgresql"
},
{
"name": "postgresql-data",
"mountPath": "/var/lib/postgresql"
},
{
"name": "postgresql-run",
"mountPath": "/var/run/postgresql"
},
{
"name": "startsh",
"mountPath": "/tmp/start.sh",
"subPath": "start.sh"
},
{
"name": "maasregionpostinst",
"mountPath": "/var/lib/dpkg/info/maas-region-controller.postinst",
"subPath": "maas-region-controller.postinst"
}
]
}
]'
spec:
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
containers:
- name: maas-region
image: {{ .Values.images.maas_region }}
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:
tcpSocket:
port: {{ .Values.network.port.region_container }}
securityContext:
privileged: true
volumeMounts:
- name: postgresql-data
mountPath: /var/lib/postgresql
- name: postgresql-run
mountPath: /var/run/postgresql
- name: maas-lib
mountPath: /var/lib/maas
- name: maas-region-secret
mountPath: /var/lib/maas/secret
subPath: secret
- name: postgresql-config
mountPath: /etc/postgresql
- name: maas-dns-config
mountPath: /etc/bind/named.conf.options
subPath: named.conf.options
- name: maas-config
mountPath: /etc/maas/regiond.conf
subPath: regiond.conf
volumes:
- name: postgresql-data
hostPath:
path: /var/lib/postgresql
- name: postgresql-run
emptyDir: {}
- name: postgresql-config
emptyDir: {}
- name: maas-lib
emptyDir: {}
- name: maas-region-secret
configMap:
name: maas-region-etc
- name: maas-config
emptyDir: {}
- name: maas-dns-config
configMap:
name: maas-region-etc
- name: startsh
configMap:
name: maas-region-bin
- name: maasregionpostinst
configMap:
name: maas-region-bin