Created
July 9, 2018 03:38
-
-
Save d-nishi/38e3b7051029b5d1a1772f3862f62ce9 to your computer and use it in GitHub Desktop.
admin/cloud/ccm-example.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an example of how to setup cloud-controller-manger as a Daemonset in your cluster. | |
# It assumes that your masters can run pods and has the role node-role.kubernetes.io/master | |
# Note that this Daemonset will not work straight out of the box for your cloud, this is | |
# meant to be a guideline. | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: cloud-controller-manager | |
namespace: kube-system | |
--- | |
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: system:cloud-controller-manager | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: cluster-admin | |
subjects: | |
- kind: ServiceAccount | |
name: cloud-controller-manager | |
namespace: kube-system | |
--- | |
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
labels: | |
k8s-app: cloud-controller-manager | |
name: cloud-controller-manager | |
namespace: kube-system | |
spec: | |
selector: | |
matchLabels: | |
k8s-app: cloud-controller-manager | |
template: | |
metadata: | |
labels: | |
k8s-app: cloud-controller-manager | |
spec: | |
serviceAccountName: cloud-controller-manager | |
containers: | |
- name: cloud-controller-manager | |
# for in-tree providers we use k8s.gcr.io/cloud-controller-manager | |
# this can be replaced with any other image for out-of-tree providers | |
image: k8s.gcr.io/cloud-controller-manager:v1.8.0 | |
command: | |
- /usr/local/bin/cloud-controller-manager | |
- --cloud-provider=<YOUR_CLOUD_PROVIDER> # Add your own cloud provider here! | |
- --leader-elect=true | |
- --use-service-account-credentials | |
# these flags will vary for every cloud provider | |
- --allocate-node-cidrs=true | |
- --configure-cloud-routes=true | |
- --cluster-cidr=172.17.0.0/16 | |
tolerations: | |
# this is required so CCM can bootstrap itself | |
- key: node.cloudprovider.kubernetes.io/uninitialized | |
value: "true" | |
effect: NoSchedule | |
# this is to have the daemonset runnable on master nodes | |
# the taint may vary depending on your cluster setup | |
- key: node-role.kubernetes.io/master | |
effect: NoSchedule | |
# this is to restrict CCM to only run on master nodes | |
# the node selector may vary depending on your cluster setup | |
nodeSelector: | |
node-role.kubernetes.io/master: "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment