Skip to content

Instantly share code, notes, and snippets.

@therealmitchconnors
Created September 4, 2024 23:01
Show Gist options
  • Save therealmitchconnors/770433c432a5e5bb731045e89d12b23d to your computer and use it in GitHub Desktop.
Save therealmitchconnors/770433c432a5e5bb731045e89d12b23d to your computer and use it in GitHub Desktop.
Test w/ cilium
---
# Source: load/templates/server.yaml
apiVersion: v1
kind: Namespace
metadata:
labels:
scenario: many-svc
istio.io/dataplane-mode: none
name: ns-001
---
# Source: load/templates/server.yaml
apiVersion: v1
data:
service-graph: |
services:
- name: loadservice
numReplicas: 1
responseSize: 10KiB
type: http
kind: ConfigMap
metadata:
labels:
app: service-graph
name: service-graph-config
namespace: ns-001
---
# Source: load/templates/server.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: service-graph
name: loadservice
namespace: ns-001
spec:
ports:
- name: http-web
port: 8080
selector:
app: loadservice
---
# Source: load/templates/server.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: service-graph
name: loadservice
namespace: ns-001
spec:
replicas: 1
selector:
matchLabels:
app: loadservice
template:
metadata:
labels:
app: loadservice
spec:
containers:
- args:
- --max-idle-connections-per-host=32
lifecycle:
preStop:
exec:
command: # Do not shut the application down immediately
- "sleep"
- "10s"
env:
- name: SERVICE_NAME
value: loadservice
image: gcr.io/istio-testing/isotope:0.0.3
name: mock-service
ports:
- containerPort: 8080
resources: {"requests":{"cpu":"50m"}}
volumeMounts:
- mountPath: /etc/config
name: config-volume
volumes:
- configMap:
items:
- key: service-graph
path: service-graph.yaml
name: service-graph-config
name: config-volume
---
# Source: load/templates/server.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: fortio-client-deployment
namespace: ns-001
spec:
replicas: 1 # tells deployment to run 1 pod(s) matching the template
selector:
matchLabels:
app: fortio-client
template: # create pods using pod definition in this template
metadata:
annotations:
prometheus.io/path: /fortio/debug/metrics
prometheus.io/port: "8080"
# a unique name is generated from the deployment name
labels:
app: fortio-client
spec:
containers:
- name: fortio-client
image: fortio/fortio:latest
imagePullPolicy: Always # IfNotPresent when using explicit version tag (not "latest") [but we do use latest/latest_release in some cases]
ports:
- containerPort: 8080 # main serving port
args:
- server
- -config-dir
- /etc/fortio/
- -echo-debug-path
- /fortio/debug/
# - -sync
# - https://storage.googleapis.com:443/fortio-data?prefix=fortio.istio.io/
# - -sync-interval
# - 15m # sync every 15 minutes
volumeMounts:
- mountPath: /var/lib/fortio
name: fortio-data
nodeSelector:
size: large
tolerations:
- key: "client"
operator: "Exists"
effect: "NoSchedule"
volumes:
- name: fortio-data
emptyDir:
medium: Memory
---
# Source: load/templates/server.yaml
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: ciliumL4
namespace: ns-001
spec:
endpointSelector:
matchLabels:
app: service-graph
ingress:
- fromEndpoints:
- matchLabels:
app: fortio-client
toPorts:
- ports:
- port: "8080"
protocol: TCP
---
# Source: load/templates/server.yaml
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: ciliumL7
namespace: ns-001
spec:
endpointSelector:
matchLabels:
app: service-graph
ingress:
- fromEndpoints:
- matchLabels:
app: fortio-client
toPorts:
- ports:
- port: "8080"
protocol: TCP
rules:
http:
- method: "GET"
path: "/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment