Using web kubectl
UK8S provides a web terminal in the console, you can log into the Pod in the cluster through the web terminal and use kubectl to operate and manage the cluster.
This Pod is launched by the Deployment method and is proxied to the UCloud Global console page through a specific security mechanism. If you mistakenly delete this Deployment, you cannot use the kubectl function in the console.
You can restart a Pod using the following yaml file, and here is an example of the yaml.
Note: The image tag of uk8s-kubectl is consistent with the version of your UK8S cluster. If your UK8S version is 1.14.5, you can change the image tag to v1.14.5.
# ------------------- kubectl Deployment ------------------- #
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
k8s-app: uk8s-kubectl
name: uk8s-kubectl
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
k8s-app: uk8s-kubectl
template:
metadata:
labels:
k8s-app: uk8s-kubectl
spec:
serviceAccountName: uk8s-kubectl
containers:
- image: uhub.ucloud-global.com/ucloud/uk8s-kubectl:v1.14.6
imagePullPolicy: IfNotPresent
name: uk8s-kubectl
resources:
requests:
memory: "100Mi"
cpu: "100m"
limits:
memory: "500Mi"
cpu: "500m"
---
# ------------------- Service Account ------------------- #
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: uk8s-kubectl
name: uk8s-kubectl
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: uk8s-kubectl-rolebind
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: uk8s-kubectl
namespace: kube-system