From ce9343296d206a41f67c1dfac9f1f88ef39d22cb Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Thu, 15 Oct 2020 20:22:34 +0200 Subject: [PATCH] resource requests for all, but hassio ist der hass --- apps/apt-cacher-ng/live-deployment.yaml | 8 ++- apps/home-assistant.yaml | 73 +++++++++++++++++++++++++ apps/mariadb/mariadb-deployment.yaml | 14 +++++ apps/mosquitto/deployment.yaml | 12 ++-- apps/piwigo/deployment.yaml | 14 +++++ 5 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 apps/home-assistant.yaml diff --git a/apps/apt-cacher-ng/live-deployment.yaml b/apps/apt-cacher-ng/live-deployment.yaml index 42305b5..0e92aee 100644 --- a/apps/apt-cacher-ng/live-deployment.yaml +++ b/apps/apt-cacher-ng/live-deployment.yaml @@ -18,7 +18,6 @@ spec: spec: containers: - name: apt-cacher-ng - #image: bkanis/apt-cacher-ng image: docker-registry.lan/apt-cacher-ng:arm64 ports: - containerPort: 3142 @@ -26,6 +25,13 @@ spec: volumeMounts: - mountPath: /var/cache/apt-cacher-ng name: data + resources: + requests: + memory: "24Mi" + cpu: "50m" + limits: + memory: "256Mi" + cpu: "100m" volumes: - name: data persistentVolumeClaim: diff --git a/apps/home-assistant.yaml b/apps/home-assistant.yaml new file mode 100644 index 0000000..5ad4f06 --- /dev/null +++ b/apps/home-assistant.yaml @@ -0,0 +1,73 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hassio + labels: + app: hassio + release: latest +spec: + replicas: 1 + selector: + matchLabels: + app: hassio + release: latest + template: + metadata: + labels: + app: hassio + release: latest + spec: + containers: + - name: hassio + image: "homeassistant/home-assistant:latest" + imagePullPolicy: Always + ports: + - name: http + containerPort: 8123 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "1000Mi" + cpu: "500m" +--- +apiVersion: v1 +kind: Service +metadata: + name: hassio + labels: + app: hassio + release: latest +spec: + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app: hassio + release: latest +--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: hassio +spec: + rules: + - host: hassio.lan + http: + paths: + - backend: + serviceName: hassio + servicePort: http + path: / diff --git a/apps/mariadb/mariadb-deployment.yaml b/apps/mariadb/mariadb-deployment.yaml index 170a95a..b3e940b 100644 --- a/apps/mariadb/mariadb-deployment.yaml +++ b/apps/mariadb/mariadb-deployment.yaml @@ -42,12 +42,26 @@ spec: volumeMounts: - name: mariadb-persistent-storage mountPath: /var/lib/mysql + resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "1500Mi" + cpu: "2000m" - image: docker-registry.lan/mariadb-prometheus-exporter:arm64 name: mariadb-prometheus-exporter imagePullPolicy: Always ports: - containerPort: 9104 name: metrics + resources: + requests: + memory: "24Mi" + cpu: "50m" + limits: + memory: "128Mi" + cpu: "100m" volumes: - name: mariadb-persistent-storage persistentVolumeClaim: diff --git a/apps/mosquitto/deployment.yaml b/apps/mosquitto/deployment.yaml index 13a1997..1b738c3 100644 --- a/apps/mosquitto/deployment.yaml +++ b/apps/mosquitto/deployment.yaml @@ -37,12 +37,9 @@ spec: - containerPort: 1883 name: mqtt protocol: TCP - #- containerPort: 9090 - # name: websocket - # protocol: TCP readinessProbe: failureThreshold: 3 - initialDelaySeconds: 3 + initialDelaySeconds: 5 periodSeconds: 3 successThreshold: 1 tcpSocket: @@ -72,6 +69,13 @@ spec: - containerPort: 9234 name: mqtt-exporter protocol: TCP + resources: + requests: + memory: "20Mi" + cpu: "100m" + limits: + memory: "64Mi" + cpu: "200m" dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler diff --git a/apps/piwigo/deployment.yaml b/apps/piwigo/deployment.yaml index 76031e2..5c22202 100644 --- a/apps/piwigo/deployment.yaml +++ b/apps/piwigo/deployment.yaml @@ -44,6 +44,13 @@ spec: mountPath: /config/www/gallery/galleries - name: piwigo-config mountPath: /config + resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "1500Mi" + cpu: "2000m" volumes: - name: piwigo-persistent-storage persistentVolumeClaim: @@ -105,6 +112,13 @@ spec: - --base_url=http://piwigo.default.svc.cluster.local/ - --username=api - --password=D8Gt4P36q3457Yt + resources: + requests: + memory: "24Mi" + cpu: "20m" + limits: + memory: "100Mi" + cpu: "500m" --- apiVersion: v1 kind: PersistentVolumeClaim