- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将kubernetes从Google GKE移到了自己的机架中。我应该使用什么持久性存储?
Kubernetes Local Persistent仅在2018年4月13日成为beta版本
https://kubernetes.io/blog/2018/04/13/local-persistent-volumes-beta/
我看到了很多选择:
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes
不知道该选择什么。 GKE部署文件会解决一些问题吗?
最佳答案
在GKE的部署文件中,您需要根据“持久卷”设置更改spec.volumes
设置。
我建议您选择以下选项之一:
HostPath
。它将主机节点文件系统中的文件或目录装载到Pod中。请注意,在这种情况下,如果没有其他配置,则无法从另一个节点访问一个节点上的数据。 Kubernetes中的用法示例:apiVersion: v1
kind: Pod
metadata:
name: test-pd
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: test-container
volumeMounts:
- mountPath: /test-pd
name: test-volume
volumes:
- name: test-volume
hostPath:
# directory location on host
path: /data
# this field is optional
type: Directory
NFS
。您需要配置NFS服务器,然后可以通过持久卷声明在“部署”中使用其卷。 Kubernetes中的用法示例:apiVersion: v1
kind: Deployment
metadata:
name: nfs-busybox
spec:
replicas: 2
selector:
name: nfs-busybox
template:
metadata:
labels:
name: nfs-busybox
spec:
containers:
- image: busybox
command:
- sh
- -c
- 'while true; do date > /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); done'
imagePullPolicy: IfNotPresent
name: busybox
volumeMounts:
# name must match the volume name below
- name: nfs
mountPath: "/mnt"
volumes:
- name: nfs
persistentVolumeClaim:
claimName: nfs
GlusterFS
。您需要配置自己的GlusterFS安装,然后才能在Deployments中使用其卷。 Kubernetes中的用法示例:apiVersion: v1
kind: Deployment
metadata:
name: nfs-busybox
spec:
replicas: 2
selector:
name: nfs-busybox
template:
metadata:
labels:
name: nfs-busybox
spec:
containers:
- image: busybox
command:
- sh
- -c
- 'while true; do date > /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); done'
imagePullPolicy: IfNotPresent
name: busybox
volumeMounts:
# name must match the volume name below
- name: nfs
mountPath: "/mnt"
volumes:
- name: glusterfsvol
glusterfs:
endpoints: glusterfs-cluster
path: kube_vol
readOnly: true
关于kubernetes - Kubernetes自己机架上的持久卷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51176145/
Kafka引入了rack-id,以便在整个机架发生故障时提供冗余功能。有一个最小同步副本设置,用于指定生产者收到确认之前需要同步的最小副本数量(-1/所有配置)。有一个不干净的领导者选举设置,用于指定
Kafka引入了rack-id,以便在整个机架发生故障时提供冗余功能。有一个最小同步副本设置,用于指定生产者收到确认之前需要同步的最小副本数量(-1/所有配置)。有一个不干净的领导者选举设置,用于指定
我正在尝试使用 Sinatra、Ruby、rack、haml、pony 和 SendGrid 构建一个应用程序,并使用 git 和 RVM 部署在 Heroku 上。该应用程序是一个博客变体,应该发送
我正在尝试将 Rack OAuth-2 server 集成到我的 sinatra 应用程序中,以便在 web-server flow implementation 中使用它,但我无法使其工作:(。我在
我按照这些说明为 Rails 3.07 安装了 rack ssl:http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-http
我在我的 Rails 3.1 应用程序中使用 Rack::SSL 来启用 SSL 连接。 我已将 gem 'rack-ssl' 添加到我的 Gemfile 和 require 'rack/ssl' c
当我尝试将未分配的辅助分片分配给节点时出现错误。 { "error": { "root_cause": [ { "type": "remote_transpor
我是一名优秀的程序员,十分优秀!