Skip to content

Commit 1eeccbb

Browse files
committedApr 12, 2023
Introduce prober deployment
1 parent e2c7999 commit 1eeccbb

File tree

6 files changed

+185
-3
lines changed

6 files changed

+185
-3
lines changed
 

‎charts/grpcbeacon-prober/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
18+
version: 0.1.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: prober-config
5+
namespace: {{ .Release.Name }}
6+
labels:
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}
10+
data:
11+
beacon_addr: "localhost:7000"
12+
prober_interval: "10s"
13+
envoy-config: |
14+
node:
15+
id: default
16+
cluster: kind-cluster
17+
18+
static_resources:
19+
listeners:
20+
- name: listener_0
21+
address:
22+
socket_address:
23+
address: 0.0.0.0
24+
port_value: 7000
25+
filter_chains:
26+
- filters:
27+
- name: envoy.filters.network.http_connection_manager
28+
typed_config:
29+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
30+
stat_prefix: ingress_http
31+
access_log:
32+
- name: envoy.access_loggers.stdout
33+
typed_config:
34+
"@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
35+
http_filters:
36+
- name: envoy.filters.http.router
37+
typed_config:
38+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
39+
route_config:
40+
name: beacon-service
41+
virtual_hosts:
42+
- name: beacon-service
43+
domains: ["*"]
44+
routes:
45+
- match:
46+
prefix: "/grpcbeacon.Beacon"
47+
grpc: {}
48+
route:
49+
cluster: beacon-service
50+
clusters:
51+
- name: beacon-service
52+
type: STRICT_DNS
53+
dns_lookup_family: V4_ONLY
54+
http2_protocol_options: {}
55+
load_assignment:
56+
cluster_name: beacon-service
57+
endpoints:
58+
- lb_endpoints:
59+
- endpoint:
60+
address:
61+
socket_address:
62+
address: {{ .Values.beaconAddr }}
63+
port_value: {{ .Values.beaconPort }}
64+
transport_socket:
65+
name: envoy.transport_sockets.tls
66+
typed_config:
67+
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
68+
common_tls_context:
69+
tls_certificate_sds_secret_configs:
70+
- name: "spiffe://spire-in-a-box.troydai.cc/wl/ns/{{.Release.Name}}/prober"
71+
sds_config:
72+
api_config_source:
73+
api_type: GRPC
74+
transport_api_version: V3
75+
grpc_services:
76+
envoy_grpc:
77+
cluster_name: spire_agent
78+
combined_validation_context:
79+
default_validation_context:
80+
match_subject_alt_names:
81+
exact: "spiffe://spire-in-a-box.troydai.cc/wl/beacon"
82+
validation_context_sds_secret_config:
83+
name: "spiffe://spire-in-a-box.troydai.cc"
84+
sds_config:
85+
api_config_source:
86+
api_type: GRPC
87+
transport_api_version: V3
88+
grpc_services:
89+
envoy_grpc:
90+
cluster_name: spire_agent
91+
tls_params:
92+
ecdh_curves:
93+
- X25519:P-256:P-521:P-384
94+
- name: spire_agent
95+
connect_timeout: 0.25s
96+
http2_protocol_options: {}
97+
load_assignment:
98+
cluster_name: spire_agent
99+
endpoints:
100+
- lb_endpoints:
101+
- endpoint:
102+
address:
103+
pipe:
104+
path: /opt/spire/sockets/spire-agent.sock
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: prober-deployment
5+
namespace: {{ .Release.Name }}
6+
labels:
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}
10+
spec:
11+
replicas: {{ .Values.replicaCount }}
12+
selector:
13+
matchLabels:
14+
app: prober
15+
template:
16+
metadata:
17+
labels:
18+
app: prober
19+
spec:
20+
serviceAccountName: prober-sa
21+
containers:
22+
- name: envoy
23+
image: envoyproxy/envoy:v1.25.1
24+
volumeMounts:
25+
- name: envoy-config
26+
mountPath: /etc/envoy
27+
readOnly: true
28+
- name: spiffe-workload-api
29+
mountPath: /opt/spire/sockets
30+
readOnly: true
31+
- name: prober
32+
image: troydai/grpcprober:{{ .Values.proberVersion }}
33+
volumeMounts:
34+
- name: spiffe-workload-api
35+
mountPath: /opt/spire/sockets
36+
readOnly: true
37+
env:
38+
- name: SERVER_ADDRESS
39+
valueFrom:
40+
configMapKeyRef:
41+
name: prober-config
42+
key: beacon_addr
43+
- name: CLIENT_INTERVAL
44+
valueFrom:
45+
configMapKeyRef:
46+
name: prober-config
47+
key: prober_interval
48+
49+
volumes:
50+
- name: envoy-config
51+
configMap:
52+
name: prober-config
53+
items:
54+
- key: envoy-config
55+
path: envoy.yaml
56+
- name: spiffe-workload-api
57+
csi:
58+
driver: "csi.spiffe.io"
59+
readOnly: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# create a k8s namespace
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: {{ .Release.Name }}
6+
labels:
7+
app: {{ .Release.Name }}
8+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9+
release: {{ .Release.Name }}
10+
heritage: {{ .Release.Service }}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
apiVersion: v1
22
kind: ServiceAccount
33
metadata:
4-
name: {{ .Release.Name }}-sa
5-
namespace: {{ .Release.Namespace }}
4+
name: prober-sa
5+
namespace: {{ .Release.Name }}
6+
labels:
7+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}

‎charts/grpcbeacon-prober/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
# Default values for grpcbeacon-prober.
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
4+
5+
replicaCount: 1
6+
proberVersion: v0.8.4
7+
beaconAddr: beacon-service.workload-ns.svc.cluster.local
8+
beaconPort: 9090

0 commit comments

Comments
 (0)
Please sign in to comment.