Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Add packet-ccm
Browse files Browse the repository at this point in the history
- Add helm chart for packet-ccm.
- Add varibales api_token and project_id to bootkube.
- Run packet-ccm while bootstrapping.

closes: #548
Signed-off-by: knrt10 <[email protected]>
  • Loading branch information
knrt10 committed Nov 3, 2020
1 parent da52633 commit 9cb58e0
Show file tree
Hide file tree
Showing 15 changed files with 622 additions and 13 deletions.
23 changes: 23 additions & 0 deletions assets/charts/control-plane/packet-ccm/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
23 changes: 23 additions & 0 deletions assets/charts/control-plane/packet-ccm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v2
name: packet-ccm
description: A Helm chart for deploying packet-ccm on Packet cluster

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v1.1.0
144 changes: 144 additions & 0 deletions assets/charts/control-plane/packet-ccm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: packet-cloud-controller-manager
namespace: kube-system
labels:
app: packet-cloud-controller-manager
spec:
replicas: 1
selector:
matchLabels:
app: packet-cloud-controller-manager
template:
metadata:
labels:
app: packet-cloud-controller-manager
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
dnsPolicy: Default
hostNetwork: true
serviceAccountName: cloud-controller-manager
tolerations:
# this taint is set by all kubelets running `--cloud-provider=external`
# so we should tolerate it to schedule the packet ccm
- key: "node.cloudprovider.kubernetes.io/uninitialized"
value: "true"
effect: "NoSchedule"
- key: "CriticalAddonsOnly"
operator: "Exists"
# cloud controller manager should be able to run on masters
- key: "node-role.kubernetes.io/master"
effect: NoSchedule
containers:
- image: packethost/packet-ccm:{{.Chart.AppVersion}}
name: packet-cloud-controller-manager
command:
- "./packet-cloud-controller-manager"
- "--cloud-provider=packet"
- "--leader-elect=false"
- "--allow-untagged-cloud=true"
- "--authentication-skip-lookup=true"
- "--provider-config=/etc/cloud-sa/cloud-sa.json"
- "--v=2"
resources:
requests:
cpu: 100m
memory: 50Mi
volumeMounts:
- name: cloud-sa-volume
readOnly: true
mountPath: "/etc/cloud-sa"
volumes:
- name: cloud-sa-volume
secret:
secretName: packet-cloud-config

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cloud-controller-manager
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: system:cloud-controller-manager
rules:
- apiGroups:
# reason: so ccm can monitor and update endpoints, used for control plane loadbalancer
- ""
resources:
- endpoints
verbs:
- create
- get
- list
- watch
- update
- apiGroups:
# reason: so ccm can read and update nodes and annotations
- ""
resources:
- nodes
verbs:
- '*'
- apiGroups:
# reason: so ccm can update the status of nodes
- ""
resources:
- nodes/status
verbs:
- patch
- apiGroups:
# reason: so ccm can manage services for loadbalancer
- ""
resources:
- services
verbs:
- get
- list
- patch
- update
- watch
- create
- apiGroups:
# reason: so ccm can update the status of services for loadbalancer
- ""
resources:
- services/status
verbs:
- list
- patch
- update
- watch
- apiGroups:
# reason: so ccm can read and update configmap/metallb-system:config
- ""
resources:
- configmaps
verbs:
- create
- get
- list
- watch
- update
- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:cloud-controller-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:cloud-controller-manager
subjects:
- kind: ServiceAccount
name: cloud-controller-manager
namespace: kube-system
Loading

0 comments on commit 9cb58e0

Please sign in to comment.