1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

Merge pull request #130 from nats-io/fix-stan-ft-docs

Fix stan FT docs
This commit is contained in:
Ginger Collison 2020-07-24 16:34:51 -05:00 committed by GitHub
commit 36c07cb7d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
# NATS Streaming Cluster with FT Mode # NATS Streaming Cluster with FT Mode on AWS
## Preparation ## Preparation
@ -6,13 +6,13 @@ First, we need a Kubernetes cluster with a provider that offers a service with a
```text ```text
# Create 3 nodes Kubernetes cluster # Create 3 nodes Kubernetes cluster
eksctl create cluster --name nats-eks-cluster \ eksctl create cluster --name stan-k8s \
--nodes 3 \ --nodes 3 \
--node-type=t3.large \ --node-type=t3.large \ # t3.small
--region=us-east-2 --region=us-east-2
# Get the credentials for your cluster # Get the credentials for your cluster
eksctl utils write-kubeconfig --name nats-eks-cluster --region us-east-2 eksctl utils write-kubeconfig --name stan-k8s --region us-east-2
``` ```
For the FT mode to work, we will need to create an EFS volume which can be shared by more than one pod. Go into the [AWS console](https://us-east-2.console.aws.amazon.com/efs/home?region=us-east-2#/wizard/1) and create one and make the sure that it is in a security group where the k8s nodes will have access to it. In case of clusters created via eksctl, this will be a security group named `ClusterSharedNodeSecurityGroup`: For the FT mode to work, we will need to create an EFS volume which can be shared by more than one pod. Go into the [AWS console](https://us-east-2.console.aws.amazon.com/efs/home?region=us-east-2#/wizard/1) and create one and make the sure that it is in a security group where the k8s nodes will have access to it. In case of clusters created via eksctl, this will be a security group named `ClusterSharedNodeSecurityGroup`:
@ -223,6 +223,7 @@ data:
cluster_advertise: $CLUSTER_ADVERTISE cluster_advertise: $CLUSTER_ADVERTISE
connect_retries: 10 connect_retries: 10
} }
streaming { streaming {
id: test-cluster id: test-cluster
store: file store: file
@ -256,15 +257,6 @@ spec:
serviceName: stan serviceName: stan
replicas: 3 replicas: 3
volumeClaimTemplates: volumeClaimTemplates:
- metadata:
name: efs
annotations:
volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
accessModes: [ "ReadWriteMany" ]
resources:
requests:
storage: 1Mi
template: template:
metadata: metadata:
labels: labels:
@ -275,7 +267,7 @@ spec:
containers: containers:
- name: stan - name: stan
image: nats-streaming:latest image: nats-streaming:alpine
ports: ports:
# In case of NATS embedded mode expose these ports # In case of NATS embedded mode expose these ports
@ -334,6 +326,9 @@ spec:
- name: config-volume - name: config-volume
configMap: configMap:
name: stan-config name: stan-config
- name: efs
persistentVolumeClaim:
claimName: efs
``` ```
Your cluster now will look something like this: Your cluster now will look something like this:
@ -384,4 +379,3 @@ $ kubectl logs stan-0 -c stan
[1] 2019/12/04 20:40:41.671541 [INF] STREAM: ---------------------------------- [1] 2019/12/04 20:40:41.671541 [INF] STREAM: ----------------------------------
[1] 2019/12/04 20:40:41.671546 [INF] STREAM: Streaming Server is ready [1] 2019/12/04 20:40:41.671546 [INF] STREAM: Streaming Server is ready
``` ```