First need to create a PVC (PersistentVolumeClaim), in Azure we can use azurefile to get a volume with ReadWriteMany
:
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: stan-efs
annotations:
notes | |
--- | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: stan-ssd-ft | |
annotations: | |
volume.beta.kubernetes.io/storage-class: "azurefile" | |
spec: | |
accessModes: | |
- ReadWriteMany |
--- | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: stan-disk | |
annotations: | |
volume.beta.kubernetes.io/storage-class: "managed-premium" | |
spec: | |
accessModes: | |
- ReadWriteOnce |
First need to create a PVC (PersistentVolumeClaim), in Azure we can use azurefile to get a volume with ReadWriteMany
:
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: stan-efs
annotations:
import asyncio | |
import nats | |
import concurrent.futures | |
import time | |
def train(msg): | |
print("->> Train task started...", msg.data) | |
time.sleep(1) # seconds | |
print("<<- Train task done...", msg.data) | |
return f"DONE: {msg.data.decode()}" |
require 'socket' | |
module NATS | |
VERSION = '2.0.0' | |
class Subscription | |
def initialize(ractor) | |
@ractor = ractor | |
end |
import asyncio | |
import nats | |
async def run(): | |
nc = await nats.connect(servers=["nats://localhost:4222"]) | |
# Using list comprehension like syntax with limited interest | |
sub1 = await nc.subscribe("foo") | |
await nc.publish("foo", b'First') | |
await nc.publish("foo", b'Second') |
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: stan-config | |
data: | |
stan.conf: | | |
port: 4222 | |
http: 8222 |
import asyncio | |
from nats.aio.client import Client as NATS | |
async def run(loop): | |
nc = NATS() | |
await nc.connect("nats://demo.nats.io:4222", loop=loop) | |
future = asyncio.Future() | |
async def cb(msg): |
--- | |
apiVersion: cert-manager.io/v1alpha2 | |
kind: ClusterIssuer | |
metadata: | |
name: selfsigning | |
spec: | |
selfSigned: {} | |
--- | |
apiVersion: cert-manager.io/v1alpha2 | |
kind: Certificate |