Minikube 服务未显示
Minikube Service Not Showing up
你好,我目前正在 Windows 10 上使用 minikube 运行ning 设置 rook-cephfs 测试环境。
到目前为止,我有 运行 crds.yaml、common.yaml、operator.yaml 和 cluster-test.yaml。我按照 https://github.com/kubernetes/kubernetes/tree/release-1.9/cluster/addons/registry 处的指南设置存储。
根据本指南,我创建了 ReplicationController 和服务。我遇到的问题是,当我 运行 kubectl 获取 svc 时,我没有看到该服务。知道为什么它没有出现吗?谢谢
service.yaml
apiVersion: v1
kind: Service
metadata:
name: kube-registry
namespace: kube-system
labels:
k8s-app: kube-registry-upstream
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeRegistry"
spec:
selector:
k8s-app: kube-registry-upstream
ports:
- name: registry
port: 5000
protocol: TCP
Docker 注册表
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry-upstream
version: v0
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
k8s-app: kube-registry-upstream
version: v0
template:
metadata:
labels:
k8s-app: kube-registry-upstream
version: v0
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: registry
image: registry:2
resources:
limits:
cpu: 100m
memory: 100Mi
env:
- name: REGISTRY_HTTP_ADDR
value: :5000
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /var/lib/registry
volumeMounts:
- name: image-store
mountPath: /var/lib/registry
ports:
- containerPort: 5000
name: registry
protocol: TCP
volumes:
- name: image-store
emptyDir: {}
根据您分享的服务yaml,服务正在kube-system命名空间中创建。
可以使用-n选项指定命名空间
查看服务
kubectl get svc kube-registry -n kube-system
你好,我目前正在 Windows 10 上使用 minikube 运行ning 设置 rook-cephfs 测试环境。 到目前为止,我有 运行 crds.yaml、common.yaml、operator.yaml 和 cluster-test.yaml。我按照 https://github.com/kubernetes/kubernetes/tree/release-1.9/cluster/addons/registry 处的指南设置存储。 根据本指南,我创建了 ReplicationController 和服务。我遇到的问题是,当我 运行 kubectl 获取 svc 时,我没有看到该服务。知道为什么它没有出现吗?谢谢
service.yaml
apiVersion: v1
kind: Service
metadata:
name: kube-registry
namespace: kube-system
labels:
k8s-app: kube-registry-upstream
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeRegistry"
spec:
selector:
k8s-app: kube-registry-upstream
ports:
- name: registry
port: 5000
protocol: TCP
Docker 注册表
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry-upstream
version: v0
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
k8s-app: kube-registry-upstream
version: v0
template:
metadata:
labels:
k8s-app: kube-registry-upstream
version: v0
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: registry
image: registry:2
resources:
limits:
cpu: 100m
memory: 100Mi
env:
- name: REGISTRY_HTTP_ADDR
value: :5000
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /var/lib/registry
volumeMounts:
- name: image-store
mountPath: /var/lib/registry
ports:
- containerPort: 5000
name: registry
protocol: TCP
volumes:
- name: image-store
emptyDir: {}
根据您分享的服务yaml,服务正在kube-system命名空间中创建。 可以使用-n选项指定命名空间
查看服务kubectl get svc kube-registry -n kube-system