IBM / ibmcloud-object-storage-plugin

IBM Cloud Object Storage plugin is a Kubernetes volume plugin that enables Kubernetes pods to access IBM Cloud Object Storage buckets. The plugin has two components: a dynamic provisioner and a FlexVolume driver for mounting the buckets using s3fs-fuse on a worker node.
Apache License 2.0
56 stars 42 forks source link

Allow specifying container limits and requests in Helm chart #38

Closed allen-servedio closed 3 years ago

allen-servedio commented 4 years ago

We are seeing very frequent throttling of the driver container for our object storage daemonset from your helm chart:

repository: https://icr.io/helm/ibm
name: ibmcloud-block-storage-plugin
version: 1.5.0
Message: 37% throttling of CPU in namespace kube-system for container ibmcloud-object-storage-driver-container in pod ibmcloud-object-storage-driver-2vbp6.

We need to be able to define values for the limits and requests for the container that the daemonset runs (it does not seem to have that section):

$ cat templates/ibmcloud-block-storage-driver-DS.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ template "drivername" . }}
  namespace: kube-system
  labels:
    app: {{ template "drivername" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  selector:
    matchLabels:
      app: {{ template "drivername" . }}
      release: {{ .Release.Name }}
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: {{ template "drivername" . }}
        chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
        release: {{ .Release.Name }}
        heritage: {{ .Release.Service }}
      annotations:
        productID: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
        productName: {{ .Chart.Name }}
        productVersion: {{ .Chart.Version }}
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - {key: "ibm-cloud.kubernetes.io/iaas-provider", operator: In, values: [softlayer]}
              - {key: beta.kubernetes.io/arch, operator: In, values: [amd64]}
      containers:
        - name: {{ template "drivername" . }}-container
          image: "{{ .Values.image.flexrepository }}:{{ .Values.image.driverBuild }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          env:
            - name: HOST_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.hostIP
          volumeMounts:
             - mountPath: /host/usr
               name: host-usr
             - mountPath: /run/systemd
               name: sysd-run
             - mountPath: /host/etc
               name: host-etc
             - mountPath: /host/lib
               name: host-lib
             - mountPath: /host/var/log
               name: host-var-log
          livenessProbe:
            exec:
              command:
              - ls
              - /host/usr/libexec/kubernetes/kubelet-plugins/volume/exec/ibm~ibmc-block/ibmc-block
            initialDelaySeconds: 30
            periodSeconds: 60
            timeoutSeconds: 5
            failureThreshold: 3
      hostNetwork: true
      serviceAccountName: ibmcloud-block-storage-plugin
      tolerations:
      - operator: "Exists"
      volumes:
        - name: host-usr
          hostPath:
             path: /usr/
        - name: sysd-run
          hostPath:
             path: /run/systemd
        - name: host-etc
          hostPath:
             path: /etc/
        - name: host-lib
          hostPath:
             path: /lib/
        - name: host-var-log
          hostPath:
             path: /var/log

When I describe the container for the daemonset they are actually set (perhaps some default?):

    Limits:
      cpu:     400m
      memory:  128Mi
    Requests:
      cpu:        200m
      memory:     128Mi
nkkashyap commented 3 years ago

ibm-object-storage-plugin Chart version >= 1.0.8 provides option to set CPU and Memory limit using resource.memory and resource.cpu