我看到 2 个可以在 GCP 上运行 K8S 集群的命令。一个是gcloud container clusters,另一个是kubectl。
谁能告诉我它们之间有什么区别?
google-cloud-platform google-kubernetes-engine google-cloud-sdk
尝试在 Pod 内的两个容器之间共享文件,我必须使用卷并在该卷的口路径中创建文件。
apiVersion: v1
kind: Pod
metadata:
name: pod-5
spec:
containers:
- name: busybox
image: busybox
command: ["sh", "-c", "if [ -f /workdir/foo ]; then sleep 3600; else exit; fi"]
volumeMounts:
- name: workdir
mountPath: "/workdir"
initContainers:
- name: install
image: busybox
command: ["sh", "-c", "touch /workdir/foo; hostname > /workdir/foo"]
volumeMounts:
- name: workdir
mountPath: "/workdir"
volumes:
- name: workdir
emptyDir: {}
Run Code Online (Sandbox Code Playgroud)
如果我不使用卷并在 init 容器中创建一个文件并尝试从其他容器中读取它,它将无法工作。
apiVersion: v1
kind: Pod
metadata:
name: pod-5
spec:
containers:
- name: busybox
image: busybox …Run Code Online (Sandbox Code Playgroud) static pod 和 DaemonSet 之间的关系可以类比 pod 和 RelicaSet 之间的关系吗?
kube-apiserver 是由 kubeadm init 创建的配置中的containerd.service启动的,如何检查containerd.service的配置以及它如何知道如何启动kube-apiserver?
\n\nytong@controller-4135505:~$ systemctl status containerd.service\n\xe2\x97\x8f containerd.service - containerd container runtime\n Loaded: loaded (/lib/systemd/system/containerd.service; enabled; vendor preset: enabled)\n Active: active (running) since Tue 2020-06-09 04:34:04 GMT+7; 3min 24s ago\n Docs: https://containerd.io\n Process: 5135 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)\n Main PID: 5138 (containerd)\n Tasks: 228\n CGroup: /system.slice/containerd.service\n \xe2\x94\x9c\xe2\x94\x805138 /usr/bin/containerd\n \xe2\x94\x9c\xe2\x94\x805821 etcd --advertise-client-urls=https://10.169.97.0:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-\n \xe2\x94\x9c\xe2\x94\x805847 kube-scheduler --authentication-kubeconfig=/etc/kubernetes/scheduler.conf --authorization-kubeconfig=/etc/kubernetes/scheduler.conf --bind-address=127.0.0.1 --kubeconfig=/\n * \xe2\x94\x9c\xe2\x94\x805868 kube-apiserver --advertise-address=10.169.97.0 --allow-privileged=true --authorization-mode=Node,RBAC --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugin\n \xe2\x94\x94\xe2\x94\x807587 kube-controller-manager --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-addre```\nAnd it is not …Run Code Online (Sandbox Code Playgroud)