-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from pradeepmvn/feature/multi-servers
Feature/multi servers
- Loading branch information
Showing
11 changed files
with
432 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: envoy-deployment | ||
labels: | ||
app: envoy | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: envoy | ||
template: | ||
metadata: | ||
labels: | ||
app: envoy | ||
spec: | ||
containers: | ||
- name: envoy | ||
command: | ||
- envoy | ||
args: | ||
- "-c /etc/envoy/envoy.yaml" | ||
- "--log-level info" | ||
- "--log-format %L. envoy]%v" | ||
- "--log-format-escaped" | ||
- "--enable-fine-grain-logging" | ||
- "--component-log-level upstream:debug,connection:debug" | ||
image: envoyproxy/envoy:v1.24.0 | ||
imagePullPolicy: Never | ||
# env: | ||
# - name: "GRPC_GO_LOG_SEVERITY_LEVEL" | ||
# value: info | ||
ports: | ||
- name: http | ||
containerPort: 8082 | ||
resources: | ||
requests: | ||
cpu: 1 | ||
memory: 1G | ||
limits: | ||
cpu: 1 | ||
memory: 1G | ||
volumeMounts: | ||
- name: envoy-config | ||
mountPath: /etc/envoy | ||
volumes: | ||
- name: envoy-config | ||
configMap: | ||
name: envoy-config-map-cewwcs4rfgfy | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
note: envoy | ||
name: envoy | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8082 | ||
protocol: TCP | ||
targetPort: 8082 | ||
- name: admin-http | ||
protocol: TCP | ||
port: 8081 | ||
targetPort: 8090 | ||
selector: | ||
app: envoy | ||
clusterIP: None | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
annotations: | ||
note: envoy-config-map | ||
name: envoy-config-map-cewwcs4rfgfy | ||
data: | ||
envoy.yaml: | | ||
static_resources: | ||
listeners: | ||
- address: | ||
socket_address: | ||
address: 0.0.0.0 | ||
port_value: 8082 | ||
filter_chains: | ||
- filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
codec_type: AUTO | ||
common_http_protocol_options: | ||
idle_timeout: 900s | ||
stat_prefix: ingress_http | ||
http2_protocol_options: | ||
max_concurrent_streams: 100 | ||
access_log: | ||
name: envoy.access_loggers.file | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog | ||
path: /dev/stdout | ||
typed_json_format: | ||
duration: "%DURATION%" | ||
request_duration: "%REQUEST_DURATION%" | ||
response_duration: "%RESPONSE_DURATION%" | ||
route_name: "%ROUTE_NAME%" | ||
upstream_host: "%UPSTREAM_HOST%" | ||
upstream_failure_reason: "%UPSTREAM_TRANSPORT_FAILURE_REASON%" | ||
response_code: "%RESPONSE_CODE%" | ||
response_flag: "%RESPONSE_FLAGS%" | ||
grpc_status: "%GRPC_STATUS%" | ||
response: "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%" | ||
envoy_path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | ||
fwd: "%REQ(X-FORWARDED-FOR)%" | ||
route_config: | ||
name: local_route | ||
virtual_hosts: | ||
- name: default | ||
domains: | ||
- "*" | ||
routes: | ||
- match: | ||
prefix: "/hello.Person/" | ||
route: | ||
cluster: person_server | ||
max_grpc_timeout: 100s | ||
clusters: | ||
- name: person_server | ||
type: STRICT_DNS | ||
# Comment out the following line to test on v6 networks | ||
dns_lookup_family: V4_ONLY | ||
lb_policy: ROUND_ROBIN | ||
close_connections_on_host_health_failure: true | ||
http2_protocol_options: | ||
max_concurrent_streams: 1000000000 | ||
load_assignment: | ||
cluster_name: person_server | ||
endpoints: | ||
- lb_endpoints: | ||
- endpoint: | ||
address: | ||
socket_address: | ||
address: server.xds-test.svc.cluster.local | ||
port_value: 8080 | ||
admin: | ||
access_log_path: "/dev/stdout" | ||
address: | ||
socket_address: | ||
address: 0.0.0.0 | ||
port_value: 8090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: envoy-deployment | ||
labels: | ||
app: envoy | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: envoy | ||
template: | ||
metadata: | ||
labels: | ||
app: envoy | ||
spec: | ||
containers: | ||
- name: envoy | ||
command: | ||
- envoy | ||
args: | ||
- "-c /etc/envoy/envoy.yaml" | ||
- "--log-level info" | ||
- "--log-format %L. envoy]%v" | ||
- "--log-format-escaped" | ||
- "--enable-fine-grain-logging" | ||
- "--component-log-level upstream:debug,connection:debug" | ||
image: envoyproxy/envoy:v1.19.0 | ||
imagePullPolicy: Never | ||
# env: | ||
# - name: "GRPC_GO_LOG_SEVERITY_LEVEL" | ||
# value: info | ||
ports: | ||
- name: http | ||
containerPort: 10000 | ||
resources: | ||
requests: | ||
cpu: 1 | ||
memory: 1G | ||
limits: | ||
cpu: 1 | ||
memory: 1G | ||
volumeMounts: | ||
- name: envoy-config | ||
mountPath: /etc/envoy | ||
volumes: | ||
- name: envoy-config | ||
configMap: | ||
name: envoy-config-map-cewwcs4rfgfy | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
note: envoy | ||
name: envoy | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 10000 | ||
- name: admin-http | ||
protocol: TCP | ||
port: 8081 | ||
targetPort: 8090 | ||
selector: | ||
app: envoy | ||
clusterIP: None | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
annotations: | ||
note: envoy-config-map | ||
name: envoy-config-map-cewwcs4rfgfy | ||
data: | ||
envoy.yaml: | | ||
node: | ||
id: THIS_IS_THE_SNAPSHOT_ID_THAT_MATCHES_TO_XDS_CONTROLLER | ||
cluster: all_services | ||
dynamic_resources: | ||
lds_config: | ||
resource_api_version: V3 | ||
ads: {} | ||
cds_config: | ||
resource_api_version: V3 | ||
ads: {} | ||
ads_config: | ||
# type of request | ||
api_type: GRPC | ||
transport_api_version: V3 | ||
grpc_services: | ||
- envoy_grpc: | ||
cluster_name: xds_cluster | ||
static_resources: | ||
clusters: | ||
- name: xds_cluster | ||
connect_timeout: 0.25s | ||
type: STRICT_DNS | ||
lb_policy: ROUND_ROBIN | ||
typed_extension_protocol_options: | ||
envoy.extensions.upstreams.http.v3.HttpProtocolOptions: | ||
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions | ||
explicit_http_config: | ||
http2_protocol_options: | ||
# Configure an HTTP/2 keep-alive to detect connection issues and reconnect | ||
# to the admin server if the connection is no longer responsive. | ||
connection_keepalive: | ||
interval: 30s | ||
timeout: 5s | ||
load_assignment: | ||
cluster_name: xds_cluster | ||
endpoints: | ||
- lb_endpoints: | ||
- endpoint: | ||
address: | ||
socket_address: | ||
address: xds-controller.xds-test.svc.cluster.local | ||
port_value: 8080 | ||
admin: | ||
access_log_path: "/dev/stdout" | ||
address: | ||
socket_address: | ||
address: 0.0.0.0 | ||
port_value: 8090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: server-b-deployment | ||
labels: | ||
app: server-b | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: server-b | ||
template: | ||
metadata: | ||
labels: | ||
app: server-b | ||
spec: | ||
containers: | ||
- name: server-b | ||
env: | ||
- name: SERVER_PORT | ||
value: "8080" | ||
- name: RANDOM_NUM_LENGTH | ||
value: "2" | ||
image: xds.example/server:latest | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8080 | ||
name: grpc-port | ||
protocol: TCP | ||
resources: | ||
requests: | ||
cpu: 50m | ||
memory: 50Mi | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
note: server-b | ||
name: server-b | ||
spec: | ||
ports: | ||
- name: grpc-port | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: grpc-port | ||
selector: | ||
app: server-b | ||
clusterIP: None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.