Skip to content

Instantly share code, notes, and snippets.

@makanijatin
Last active September 26, 2018 04:44
Show Gist options
  • Save makanijatin/183c5b78cbc3650fe139a858d514a27c to your computer and use it in GitHub Desktop.
Save makanijatin/183c5b78cbc3650fe139a858d514a27c to your computer and use it in GitHub Desktop.

If you want to explicitly reserve resources for non-pod processes, you can create a placeholder pod. Use the following template:

apiVersion: v1
kind: Pod
metadata:
  name: resource-reserver
spec:
  containers:
  - name: sleep-forever
    image: k8s.gcr.io/pause:0.8.0
    resources:
      requests:
        cpu: 100m
        memory: 100Mi

Set the cpu and memory values to the amount of resources you want to reserve. Place the file in the manifest directory (--config=DIR flag of kubelet). Do this on each kubelet where you want to reserve resources.

The RBAC ClusterRole for the CCM(Cloud Control Manager) looks like this:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cloud-controller-manager
rules:
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
  - update
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - nodes/status
  verbs:
  - patch
- apiGroups:
  - ""
  resources:
  - services
  verbs:
  - list
  - patch
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - serviceaccounts
  verbs:
  - create
- apiGroups:
  - ""
  resources:
  - persistentvolumes
  verbs:
  - get
  - list
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - endpoints
  verbs:
  - create
  - get
  - list
  - watch
  - update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment