This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-plane: packet-ccm with cloud-provider-equinix-metal
This commit removes the Packet Cloud Controller Manager a.k.a packet-ccm as part of the migration to Equinix Metal. In its place, `cloud-provider-equinix-metal` is installed. For new Lokomotive clusters there won't be any difference because well the are fresh clusters. However, for existing clusters, users would need to uninstall the `packet-ccm` helm release and then proceed with cluster upgrade using `lokoctl cluster apply ...`. Note: During upgrade the user must pass the flag `--skip-pre-update-health-check`. Execution steps for existing clusters: 1. Uninstall `packet-ccm` helm release ``` helm uninstall packet-ccm --namespace kube-system ``` 2. Upgrade Lokomotive cluster to the latest release Note: Do not forget the `--skip-pre-update-health-check` flag ``` lokoctl cluster apply --skip-components --skip-pre-update-health-check ``` Signed-off-by: Imran Pochi <imran@kinvolk.io>
- Loading branch information
Showing
22 changed files
with
576 additions
and
326 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
assets/charts/control-plane/cloud-provider-equinix-metal/Chart.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v2 | ||
name: cloud-provider-equinix-metal | ||
description: Kubernetes Cloud Provider for Equinix Metal | ||
type: application | ||
version: "0.1.0" | ||
appVersion: "master" | ||
home: https://metal.equinix.com | ||
sources: | ||
- https://github.com/equinix/cloud-provider-equinix-metal | ||
|
84 changes: 84 additions & 0 deletions
84
assets/charts/control-plane/cloud-provider-equinix-metal/templates/_helpers.tpl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.labels" -}} | ||
helm.sh/chart: {{ include "cloud-provider-equinix-metal.chart" . }} | ||
{{ include "cloud-provider-equinix-metal.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "cloud-provider-equinix-metal.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "cloud-provider-equinix-metal.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the secret containing the config file to use | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.configSecretName" -}} | ||
{{- if .Values.configSecret.create }} | ||
{{- default (include "cloud-provider-equinix-metal.fullname" .) .Values.configSecret.name }} | ||
{{- else }} | ||
{{- default "default" .Values.configSecret.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the image version tag | ||
*/}} | ||
{{- define "cloud-provider-equinix-metal.imageTag" -}} | ||
{{- if eq .Chart.AppVersion "master" }} | ||
{{- default "master" .Values.image.tag }} | ||
{{- else }} | ||
{{- default .Values.image.tag }} | ||
{{- end }} | ||
{{- end }} |
84 changes: 84 additions & 0 deletions
84
assets/charts/control-plane/cloud-provider-equinix-metal/templates/clusterrole.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{{- if .Values.clusterRole.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
{{- include "cloud-provider-equinix-metal.labels" . | nindent 4 }} | ||
{{- with .Values.clusterRole.annotations }} | ||
annotations: | ||
rbac.authorization.kubernetes.io/autoupdate: 'true' | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
name: '{{ .Values.clusterRole.name }}' | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- namespaces | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- endpoints | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- nodes | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- nodes/status | ||
verbs: | ||
- patch | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- create | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- services/status | ||
verbs: | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- configmaps | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- patch | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- patch | ||
{{- end }} |
20 changes: 20 additions & 0 deletions
20
assets/charts/control-plane/cloud-provider-equinix-metal/templates/clusterrolebinding.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.clusterRole.create -}} | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: '{{ .Values.clusterRole.name }}' | ||
labels: | ||
{{- include "cloud-provider-equinix-metal.labels" . | nindent 4 }} | ||
{{- with .Values.clusterRole.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: '{{ .Values.clusterRole.name }}' | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "cloud-provider-equinix-metal.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} |
97 changes: 97 additions & 0 deletions
97
assets/charts/control-plane/cloud-provider-equinix-metal/templates/deployment.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "cloud-provider-equinix-metal.fullname" . }} | ||
labels: | ||
{{- include "cloud-provider-equinix-metal.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
{{- include "cloud-provider-equinix-metal.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
scheduler.alpha.kubernetes.io/critical-pod: '' | ||
checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} | ||
labels: | ||
{{- include "cloud-provider-equinix-metal.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
dnsPolicy: Default | ||
hostNetwork: true | ||
serviceAccountName: {{ include "cloud-provider-equinix-metal.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
{{- with .Values.hostAliases }} | ||
hostAliases: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
tolerations: | ||
- key: node.cloudprovider.kubernetes.io/uninitialized | ||
value: 'true' | ||
effect: NoSchedule | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ include "cloud-provider-equinix-metal.imageTag" . }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
command: | ||
- ./cloud-provider-equinix-metal | ||
- '--cloud-provider=equinixmetal' | ||
- '--leader-elect=false' | ||
- '--authentication-skip-lookup=true' | ||
- '--provider-config=/etc/cloud-sa/cloud-sa.json' | ||
{{- with .Values.additionalCommands }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
env: | ||
{{- range $key, $value := .Values.env }} | ||
- name: {{ $key }} | ||
value: {{ $value | quote }} | ||
{{- end }} | ||
{{- with .Values.envFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
volumeMounts: | ||
- name: cloud-sa-volume | ||
readOnly: true | ||
mountPath: /etc/cloud-sa | ||
{{- with .Values.volumeMounts }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumes: | ||
- name: cloud-sa-volume | ||
secret: | ||
secretName: {{ include "cloud-provider-equinix-metal.configSecretName" . }} | ||
{{- with .Values.volumes }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
13 changes: 13 additions & 0 deletions
13
assets/charts/control-plane/cloud-provider-equinix-metal/templates/secret.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ if .Values.configSecret.create }} | ||
{{- $unused := required "You must set an Equinix Metal API key" .Values.config.apiKey -}} | ||
{{- $unused := required "You must set an Equinix Metal project ID" .Values.config.projectID -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "cloud-provider-equinix-metal.configSecretName" . }} | ||
labels: | ||
{{- include "cloud-provider-equinix-metal.labels" . | nindent 4 }} | ||
type: Opaque | ||
data: | ||
cloud-sa.json: {{ .Values.config | toJson | b64enc | quote }} | ||
{{ end }} |
12 changes: 12 additions & 0 deletions
12
assets/charts/control-plane/cloud-provider-equinix-metal/templates/serviceaccount.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "cloud-provider-equinix-metal.serviceAccountName" . }} | ||
labels: | ||
{{- include "cloud-provider-equinix-metal.labels" . | nindent 4 }} | ||
{{- with .Values.serviceAccount.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.