apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: langchain-streamlit-demo-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: langchain-streamlit-demo | |
template: | |
metadata: | |
labels: | |
app: langchain-streamlit-demo | |
spec: | |
containers: | |
- name: langchain-streamlit-demo | |
image: joshuasundance/langchain-streamlit-demo:0.0.7 | |
imagePullPolicy: Always | |
resources: | |
requests: | |
cpu: "100m" | |
memory: "200Mi" | |
limits: | |
cpu: "500m" | |
memory: "500Mi" | |
env: | |
- name: OPENAI_API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: langchain-streamlit-demo-secret | |
key: OPENAI_API_KEY | |
- name: ANTHROPIC_API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: langchain-streamlit-demo-secret | |
key: ANTHROPIC_API_KEY | |
- name: ANYSCALE_API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: langchain-streamlit-demo-secret | |
key: ANYSCALE_API_KEY | |
- name: LANGCHAIN_API_KEY | |
valueFrom: | |
secretKeyRef: | |
name: langchain-streamlit-demo-secret | |
key: LANGCHAIN_API_KEY | |
- name: LANGCHAIN_PROJECT | |
value: "langchain-streamlit-demo" | |
securityContext: | |
runAsNonRoot: true | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: langchain-streamlit-demo-service | |
# configure on Azure and uncomment below to use a vnet | |
# annotations: | |
# service.beta.kubernetes.io/azure-load-balancer-internal: "true" | |
# service.beta.kubernetes.io/azure-load-balancer-ipv4: vnet.ip.goes.here | |
# service.beta.kubernetes.io/azure-dns-label-name: "langchain-streamlit-demo" | |
spec: | |
selector: | |
app: langchain-streamlit-demo | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 7860 | |
type: LoadBalancer | |
apiVersion: networking.k8s.io/v1 | |
kind: NetworkPolicy | |
metadata: | |
name: langchain-streamlit-demo-network-policy | |
spec: | |
podSelector: | |
matchLabels: | |
app: langchain-streamlit-demo | |
policyTypes: | |
- Ingress | |
ingress: | |
- from: [] # An empty array here means it will allow traffic from all sources. | |
ports: | |
- protocol: TCP | |
port: 7860 | |