- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在谷歌云上的 3 节点集群上部署了 ravendb。但是,无法从浏览器访问它。这是我遵循的过程和配置。您能帮我解决服务和部署问题吗?当我运行 get pods 和 get svc 命令时,pod 和服务正在运行,但无法从浏览器访问数据库。
遵循的程序:
I suggest you first run the setup wizard on your local dev machine and get the Let's Encrypt certificate. Just use 127.0.0.1:8080 as the IP, it's not important at the moment.
(Even better will be to get your own domain + certificate for production use)
You need to convert both the pfx file and the license.json file to base64, In c# for example:
Convert.ToBase64String(File.ReadAllBytes(@"C:\work\certs\cluster.server.certificate.iftah.pfx"))
Convert.ToBase64String(File.ReadAllBytes(@"C:\work\license.json"))
1. Create a GKE standard cluster with 3 nodes, no special settings. Let's call it raven-cluster
2. Install gcloud and kubectl (follow the getting started guide: https://cloud.google.com/kubernetes-engine/docs/quickstart)
run:
3. > gcloud container clusters get-credentials raven-cluster
4. > kubectl create clusterrolebinding my-cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account)
Now you're ready to deploy.
Edit the cluster.yaml file to include the base64 certificate (name: raven-ssl)
Edit the license.secret.yaml file to include the base64 license (name: ravendb-license)
4a) kubectl label node role=ingress-controller --all
5. kubectl create -f license.secret.yaml
6. kubectl create -f haproxy.yaml
7. kubectl create -f cluster.yaml
9. kubectl get pod
8. kubectl get svc
ravendb 规范 YAML:
apiVersion: v1
items:
- apiVersion: v1
data:
raven-0: "{\r\n \"Setup.Mode\": \"None\",\r\n \"DataDir\": \"/data/RavenData\",\r\n
\ \"Security.Certificate.Path\": \"/ssl/ssl\",\r\n \"ServerUrl\": \"https://0.0.0.0\",\r\n
\ \"ServerUrl.Tcp\": \"tcp://0.0.0.0:38888\",\r\n \"PublicServerUrl\": \"https://a.tej-test001.ravendb.community\",\r\n
\ \"PublicServerUrl.Tcp\": \"tcp://tcp-a.tej-test001.ravendb.community:443\",\r\n
\ \"License.Path\": \"/license/license.json\",\r\n \"License.Eula.Accepted\":
\"true\",\r\n \"License.CanActivate\": \"false\",\r\n \"License.CanForceUpdate\":
\"false\",\r\n \"Server.AllowedDestinations\": \"Azure\",\r\n}"
raven-1: "{\r\n \"Setup.Mode\": \"None\",\r\n \"DataDir\": \"/data/RavenData\",\r\n
\ \"Security.Certificate.Path\": \"/ssl/ssl\",\r\n \"ServerUrl\": \"https://0.0.0.0\",\r\n
\ \"ServerUrl.Tcp\": \"tcp://0.0.0.0:38888\",\r\n \"PublicServerUrl\": \"https://b.tej-test001.ravendb.community\",\r\n
\ \"PublicServerUrl.Tcp\": \"tcp://tcp-b.tej-test001.ravendb.community:443\",\r\n
\ \"License.Path\": \"/license/license.json\",\r\n \"License.Eula.Accepted\":
\"true\",\r\n \"License.CanActivate\": \"false\",\r\n \"License.CanForceUpdate\":
\"false\",\r\n \"Server.AllowedDestinations\": \"Azure\",\r\n}"
raven-2: "{\r\n \"Setup.Mode\": \"None\",\r\n \"DataDir\": \"/data/RavenData\",\r\n
\ \"Security.Certificate.Path\": \"/ssl/ssl\",\r\n \"ServerUrl\": \"https://0.0.0.0\",\r\n
\ \"ServerUrl.Tcp\": \"tcp://0.0.0.0:38888\",\r\n \"PublicServerUrl\": \"https://c.tej-test001.ravendb.community\",\r\n
\ \"PublicServerUrl.Tcp\": \"tcp://tcp-c.tej-test001.ravendb.community:443\",\r\n
\ \"License.Path\": \"/license/license.json\",\r\n \"License.Eula.Accepted\":
\"true\",\r\n \"License.CanActivate\": \"false\",\r\n \"License.CanForceUpdate\":
\"false\",\r\n \"Server.AllowedDestinations\": \"Azure\",\r\n}"
kind: ConfigMap
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
name: raven-settings
namespace: default
- apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
name: raven
namespace: default
spec:
podManagementPolicy: OrderedReady
replicas: 3
revisionHistoryLimit: 10
selector:
matchLabels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
serviceName: raven
template:
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: cluster
operator: In
values:
- ee632d20-0a5f-40e4-a84a-5294da32d6d5
topologyKey: kubernetes.io/hostname
containers:
- command:
- /bin/sh
- -c
- /opt/RavenDB/Server/Raven.Server --config-path /config/$HOSTNAME
image: ravendb/ravendb:latest
imagePullPolicy: Always
name: ravendb
ports:
- containerPort: 443
name: http-api
protocol: TCP
- containerPort: 38888
name: tcp-server
protocol: TCP
- containerPort: 161
name: snmp
protocol: TCP
resources:
limits:
cpu: 256m
memory: 1900Mi
requests:
cpu: 256m
memory: 1900Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /data
name: data
- mountPath: /ssl
name: ssl
- mountPath: /license
name: license
- mountPath: /config
name: config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 120
volumes:
- name: ssl
secret:
defaultMode: 420
secretName: raven-ssl
- configMap:
defaultMode: 420
name: raven-settings
name: config
- name: license
secret:
defaultMode: 420
secretName: ravendb-license
updateStrategy:
rollingUpdate:
partition: 0
type: RollingUpdate
volumeClaimTemplates:
- metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-passthrough: "true"
kubernetes.io/ingress.class: "haproxy"
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
name: raven
namespace: default
spec:
rules:
- host: a.tej-test001.ravendb.community
http:
paths:
- backend:
serviceName: raven-0
servicePort: 443
path: /
- host: tcp-a.tej-test001.ravendb.community
http:
paths:
- backend:
serviceName: raven-0
servicePort: 38888
path: /
- host: b.tej-test001.ravendb.community
http:
paths:
- backend:
serviceName: raven-1
servicePort: 443
path: /
- host: tcp-b.tej-test001.ravendb.community
http:
paths:
- backend:
serviceName: raven-1
servicePort: 38888
path: /
- host: c.tej-test001.ravendb.community
http:
paths:
- backend:
serviceName: raven-2
servicePort: 443
path: /
- host: tcp-c.tej-test001.ravendb.community
http:
paths:
- backend:
serviceName: raven-2
servicePort: 38888
path: /
- apiVersion: v1
data:
ssl: dfdjfdkljfdkjdkjd;kfjdkfjdklfj
kind: Secret
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
name: raven-ssl
namespace: default
type: Opaque
- apiVersion: v1
kind: Service
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
name: raven
namespace: default
spec:
clusterIP: None
ports:
- name: http-api
port: 443
protocol: TCP
targetPort: 443
- name: tcp-server
port: 38888
protocol: TCP
targetPort: 38888
- name: snmp
port: 161
protocol: TCP
targetPort: 161
selector:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- apiVersion: v1
kind: Service
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
node: "0"
name: raven-0
namespace: default
spec:
ports:
- name: http-api
port: 443
protocol: TCP
targetPort: 443
- name: tcp-server
port: 38888
protocol: TCP
targetPort: 38888
- name: snmp
port: 161
protocol: TCP
targetPort: 161
selector:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
statefulset.kubernetes.io/pod-name: raven-0
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- apiVersion: v1
kind: Service
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
node: "1"
name: raven-1
namespace: default
spec:
ports:
- name: http-api
port: 443
protocol: TCP
targetPort: 443
- name: tcp-server
port: 38888
protocol: TCP
targetPort: 38888
- name: snmp
port: 161
protocol: TCP
targetPort: 161
selector:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
statefulset.kubernetes.io/pod-name: raven-1
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- apiVersion: v1
kind: Service
metadata:
labels:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
node: "2"
name: raven-2
namespace: default
spec:
ports:
- name: http-api
port: 443
protocol: TCP
targetPort: 443
- name: tcp-server
port: 38888
protocol: TCP
targetPort: 38888
- name: snmp
port: 161
protocol: TCP
targetPort: 161
selector:
app: ravendb
cluster: ee632d20-0a5f-40e4-a84a-5294da32d6d5
statefulset.kubernetes.io/pod-name: raven-2
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
kind: List
haproxy 规范 yaml:
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: ingress-controller
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: ingress-controller
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- nodes
- pods
- secrets
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- apiGroups:
- "extensions"
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- "extensions"
resources:
- ingresses/status
verbs:
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: ingress-controller
namespace: default
rules:
- apiGroups:
- ""
resources:
- configmaps
- pods
- secrets
- namespaces
verbs:
- get
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- create
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ingress-controller
subjects:
- kind: ServiceAccount
name: ingress-controller
namespace: default
- apiGroup: rbac.authorization.k8s.io
kind: User
name: ingress-controller
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: ingress-controller
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ingress-controller
subjects:
- kind: ServiceAccount
name: ingress-controller
namespace: default
- apiGroup: rbac.authorization.k8s.io
kind: User
name: ingress-controller
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: ingress-default-backend
name: ingress-default-backend
namespace: default
spec:
selector:
matchLabels:
run: ingress-default-backend
template:
metadata:
labels:
run: ingress-default-backend
spec:
containers:
- name: ingress-default-backend
image: gcr.io/google_containers/defaultbackend:1.0
ports:
- containerPort: 8080
resources:
limits:
cpu: 10m
memory: 20Mi
---
apiVersion: v1
kind: Service
metadata:
name: ingress-default-backend
namespace: default
spec:
ports:
- port: 8080
selector:
run: ingress-default-backend
---
apiVersion: v1
data:
backend-server-slots-increment: "4"
dynamic-scaling: "true"
kind: ConfigMap
metadata:
name: haproxy-ingress
namespace: default
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
labels:
run: haproxy-ingress
name: haproxy-ingress
spec:
selector:
matchLabels:
run: haproxy-ingress
template:
metadata:
labels:
run: haproxy-ingress
spec:
serviceAccountName: ingress-controller
containers:
- name: haproxy-ingress
image: quay.io/jcmoraisjr/haproxy-ingress
args:
- --default-backend-service=$(POD_NAMESPACE)/ingress-default-backend
- --configmap=$(POD_NAMESPACE)/haproxy-ingress
- --reload-strategy=reusesocket
ports:
- name: https
containerPort: 443
- name: stat
containerPort: 1936
livenessProbe:
httpGet:
path: /healthz
port: 10253
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
---
apiVersion: v1
kind: Service
metadata:
labels:
run: haproxy-ingress
name: haproxy-ingress
namespace: default
spec:
type: LoadBalancer
ports:
- name: https
port: 443
- name: stat
port: 1936
selector:
run: haproxy-ingress
最佳答案
您收到的说明是不完整的。您没有更新 DNS 记录。
关于kubernetes - 对 kubernetes 上的 ravendb 部署进行故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55297900/
core@core-1-94 ~ $ kubectl exec -it busybox -- nslookup kubernetesServer: 10.100.0.10Address 1: 1
我有一个节点错误地注册在集群 B 上,而它实际上为集群 A 服务。 这里“在集群 B 上注册”意味着我可以从 kubectl get node 看到节点来自集群 B。 我想从集群 B 中取消注册这个节
据我所知,Kubernetes 是一个用于部署和管理容器的编排框架。另一方面,Kubernetes Engine 负责集群的伸缩,以及管理容器镜像。 从上面看,它们似乎是同一件事或非常相似。从上面的定
我正在学习 Kubernetes 和 Docker,以启动一个简单的 Python 网络应用程序。我对上述所有技术都不熟悉。 下面是我计划的方法: 安装 Kubernetes。 在本地启动并运行集群。
我了解如何在 kubernetes 中设置就绪探测器,但是是否有任何关于在调用就绪探测器时微服务应实际检查哪些内容的最佳实践?两个具体例子: 一个面向数据库的微服务,如果没有有效的数据库连接,几乎所有
Kubernetes 调度程序是仅根据请求的资源和节点在服务器当前快照中的可用资源将 Pod 放置在节点上,还是同时考虑节点的历史资源利用率? 最佳答案 在官方Kubernetes documenta
我们有多个环境,如 dev、qa、prepod 等。我们有基于环境的命名空间。现在我们将服务命名为 environment 作为后缀。例如。, apiVersion: apps/v1
我有一个关于命名空间的问题,并寻求您的专业知识来消除我的疑虑。 我对命名空间的理解是,它们用于在团队和项目之间引入逻辑边界。 当然,我在某处读到命名空间可用于在同一集群中引入/定义不同的环境。 例如测
我知道角色用于授予用户或服务帐户在特定命名空间中执行操作的权限。 一个典型的角色定义可能是这样的 kind: Role apiVersion: rbac.authorization.k8s.io/v1
我正在学习 Kubernetes,目前正在深入研究高可用性,虽然我知道我可以使用本地(或远程)etcd 以及一组高可用性的控制平面(API 服务器、 Controller 、调度程序)来设置minio
两者之间有什么实际区别?我什么时候应该选择一个? 例如,如果我想让我的项目中的开发人员仅查看 pod 的日志。似乎可以通过 RoleBinding 为服务帐户或上下文分配这些权限。 最佳答案 什么是服
根据基于时间的计划执行容器或 Pod 的推荐方法是什么?例如,每天凌晨 2 点运行 10 分钟的任务。 在传统的 linux 服务器上,crontab 很容易工作,而且显然在容器内部仍然是可能的。然而
有人可以帮助我了解服务网格本身是否是一种入口,或者服务网格和入口之间是否有任何区别? 最佳答案 “入口”负责将流量路由到集群中(来自 Docs:管理对集群中服务的外部访问的 API 对象,通常是 HT
我是 kubernetes 集群的新手。我有一个简单的问题。 我在多个 kubernetes 集群中。 kubernetes 中似乎有多个集群可用。所以 kubernetes 中的“多集群”意味着:
我目前正在使用Deployments管理我的K8S集群中的Pod。 我的某些部署需要2个Pod /副本,一些部署需要3个Pod /副本,而有些部署只需要1个Pod /副本。我遇到的问题是只有一个 po
我看过官方文档:https://kubernetes.io/docs/tasks/setup-konnectivity/setup-konnectivity/但我还是没明白它的意思。 我有几个问题:
这里的任何人都有在 kubernetes 上进行批处理(例如 spring 批处理)的经验?这是个好主意吗?如果我们使用 kubernetes 自动缩放功能,如何防止批处理处理相同的数据?谢谢你。 最
我有一个具有 4 个节点和一个主节点的 Kubernetes 集群。我正在尝试在所有节点中运行 5 个 nginx pod。目前,调度程序有时在一台机器上运行所有 pod,有时在不同的机器上运行。 如
我在运行 Raspbian Stretch 的 Raspberry PI 3 上使用以下命令安装最新版本的 Kubernetes。 $ curl -s https://packages.cloud.g
container port 与 Kubernetes 容器中的 targetports 有何不同? 它们是否可以互换使用,如果可以,为什么? 我遇到了下面的代码片段,其中 containerPort
我是一名优秀的程序员,十分优秀!