-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend manifests to work properly with kubeadm (#22)
* Add ServiceAccount to kube-router manifest When initializing a local single-node Kubernetes cluster with kubeadm, kube-router is not able to access certaub resources and fails to start. This commit adds a ServiceAccount and a ClusterRoleBinding to the kube-router manifest. This manifest comes from the official kube-router repository: (daemonset/kubeadm-kuberouter-all-features.yaml). * Add checkpoint-rbac.yaml This allows the kubectl checkpoint plugin to create the container checkpoint. * Run curl with sudo in kubectl-checkpoint Previously, the curl command could not access the kubelet's client certificate and key. * Update README.md with kubeadm instructions - Updated with specific instructions for kubeadm - Added instruction to apply the RBAC manifest - Updated the commands of step 9 to run as root - Added a note that the local registry is optional * Add comment to describe the purpose of checkpoint-rbac.yaml * Replace system:node:codingbeast with generic name to fill in * Update README to mention replacing machine name
- Loading branch information
Showing
4 changed files
with
262 additions
and
106 deletions.
There are no files selected for viewing
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 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
44 changes: 44 additions & 0 deletions
44
examples/container_migration_in_kubernetes/manifests/checkpoint-rbac.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,44 @@ | ||
# When running the `kubectl checkpoint` command, you may see the following error: | ||
# Forbidden (user=system:node:<your_machine_name>, verb=create, resource=nodes, subresource=checkpoint) | ||
# This ClusterRole allows the create verb on the nodes resource and the nodes/checkpoint subresource. | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: checkpoint-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
verbs: ["list", "get", "watch", "create"] | ||
- apiGroups: [""] | ||
resources: ["nodes/checkpoint"] | ||
verbs: ["create"] | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: checkpoint-role-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: checkpoint-role | ||
subjects: | ||
- kind: User | ||
# Replace <your_machine_name> with the name of your machine | ||
name: system:node:<your_machine_name> | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kube-router-checkpoint-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: checkpoint-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kube-router | ||
namespace: kube-system |
Oops, something went wrong.