This commit is contained in:
Piotr Biernat 2024-12-05 16:55:03 +01:00
parent 741e1f22e4
commit 0accb265d7
29 changed files with 890 additions and 93 deletions

16
.app.config Normal file
View File

@ -0,0 +1,16 @@
{
"ID": "gateway-__IP__",
"Name": "gateway",
"Address": "__IP__",
"Tags": ["api-gateway", "gateway", "https", "infra"],
"Port": 8443,
"Connect": {
"Native": true
},
"Check": {
"TCP": "__IP__:8443",
"Interval": "5s",
"Timeout": "1s",
"DeregisterCriticalServiceAfter": "10s"
}
}

View File

@ -1,13 +1,37 @@
FROM hashicorp/consul:1.15
FROM envoyproxy/envoy:distroless-v1.29-latest AS envoy
FROM ubuntu:latest AS base
FROM hashicorp/consul:1.19.2-ubi
USER root
LABEL dev.egommerce.image.author="Piotr Biernat"
LABEL dev.egommerce.image.vendor="Egommerce"
LABEL dev.egommerce.image.service="api-registry"
LABEL dev.egommerce.image.version="1.0"
COPY ./api-registry/etc /consul/config
ENV CGO_ENABLED=0
EXPOSE 8500 8600 8600/udp
# USER consul
COPY ./api-registry/etc/consul /consul/config
# COPY ./api-registry/etc/addons/* /consul/config
COPY ./api-registry/etc/consul-template /consul/template
COPY ./api-registry/opt /opt/consul
COPY ./api-registry/entrypoint.sh /
ENTRYPOINT ["consul", "agent", "-config-dir=/consul/config"]
# Fix for running Go apps in container @https://stackoverflow.com/a/35613430
#RUN rm /lib64/ld-linux-x86-64.so.2 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
# RUN apt update && \
# apt install -y curl
# RUN microdnf --enablerepo=rhel-7-server-rpms \
# install curl --nodocs
COPY --from=base /usr/bin/hostname /usr/bin/hostname
# COPY --from=base /usr/bin/ps /usr/bin/ps
COPY --from=envoy /usr/local/bin/envoy /bin/envoy
# COPY ./.app.config /
COPY ./api-registry/spawn-process.sh /
EXPOSE 53 53/udp 8443 8501
ENTRYPOINT ["/entrypoint.sh"]
CMD ["consul", "agent", "-config-dir=/consul/config"]

View File

@ -2,16 +2,16 @@
set -e
apk add zip
# apk add zip
update-ca-trust
# exec register-service
update-ca-certificates
echo -e "nameserver 127.0.0.1\n$(cat /etc/resolv.conf)" > /etc/resolv.conf
# Install consul-template
cd ~/ && curl -O https://releases.hashicorp.com/consul-template/0.19.5/consul-template_0.19.5_linux_amd64.zip && \
unzip consul-template_0.19.5_linux_amd64.zip && \
rm consul-template_0.19.5_linux_amd64.zip && cd -
# cd ~/ && curl -O https://releases.hashicorp.com/consul-template/0.19.5/consul-template_0.19.5_linux_amd64.zip && \
# unzip consul-template_0.19.5_linux_amd64.zip && \
# rm consul-template_0.19.5_linux_amd64.zip && cd -
# Install glibc
# apk add gcompat
@ -21,4 +21,14 @@ rm consul-template_0.19.5_linux_amd64.zip && cd -
# func-e use $ENVOY_VERSION_STRING
# cp ~/.func-e/versions/$ENVOY_VERSION_STRING/bin/envoy /usr/local/bin/
exec "$@"
if [ $APP_NAME == "api-gateway" ]
then
# register-service
IP=$(hostname -i) COMMAND="consul connect envoy -gateway api -register -service gateway -address ${IP}:8443 -admin-bind 0.0.0.0:19000 -bind-address gw-listener=0.0.0.0:8443 -ca-file /usr/share/pki/ca-trust-source/anchors/internalCA.crt -client-cert /etc/certs/catalog.crt -client-key /etc/certs/catalog.key -enable-config-gen-logging -- --log-level trace --log-path /var/log/api-gateway.log" ./spawn-process.sh 2>&1 &
COMMAND="consul connect envoy -sidecar-for catalog -admin-bind 0.0.0.0:20000 -enable-config-gen-logging -- --log-level trace --log-path /var/log/sidecar-catalog.log" ./spawn-process.sh 2>&1 &
COMMAND="consul connect envoy -sidecar-for basket -admin-bind 0.0.0.0:20001 -enable-config-gen-logging -- --log-level trace --log-path /var/log/sidecar-basket.log" ./spawn-process.sh 2>&1 &
fi
exec "$@"

View File

@ -0,0 +1,21 @@
config_entries {
bootstrap = [
{
Kind = "api-gateway"
Name = "gw"
Listeners = [
{
Name = "gw"
Port = 443
Protocol = "http"
#Services = [
# {
# Name = "catalog"
# }
#]
}
]
}
]
}

View File

@ -0,0 +1,13 @@
#Kind = "service-intentions"
#Name = "pricing"
#Sources = [
#{
# Name = "basket"
# Action = "deny"
#}
#{
# Name = "api"
# Action = "allow"
#}
#]

View File

@ -0,0 +1,6 @@
Kind = "proxy-defaults"
Name = "global"
Config {
Protocol = "http"
}

View File

@ -0,0 +1,87 @@
config_entries {
bootstrap = [
{
Kind = "http-route"
Name = "catalog-routes"
Meta = {
"name" = "catalog-routes"
}
#Hostnames = ["<hostnames for which this HTTPRoute should respond to requests>"]
Parents = [
{
Kind = "api-gateway"
Name = "gw"
#SectionName = "<optional name of a specific listener on the api-gateway to bind to>"
}
]
Rules = [
{
Filters = {
URLRewrite = {
Path = "/catalog"
}
#JWT = {
# Providers = [
# Name = "<name of the provider>"
# VerifyClaim = {
# Path = ["<path to claim>"]
# Value = "<value of claim>"
# }
# ]
#}
}
#Matches = [
#{
# Headers = [
# {
# Match = "<type of match: exact, prefix or regex>"
# Name = "<name of header to match on>"
# Value = "<value of header to match on>"
# }
# ]
# Method = "<method type to match on>"
# Path = {
# Match = "<type of match: exact, prefix or regex>"
# Value = "<value to match on>"
# }
# Query = [
# {
# Match = "<type of match: exact, present or regex>"
# Name = "<name of query parameter to match on>"
# Value = "<value of query parameter to match on>"
# }
# ]
#}
#]
Services = [
{
Name = "catalog"
Weight = 90
Filters = {
# Headers = [
# {
# Add = {
# "<name of header to add>" = "<value of header to add>"
# }
# Remove = [
# "<name of header to remove from request>"
# ]
# Set = {
# "<name of header to set>" = "<value of header to set>"
# }
# }
# ]
URLRewrite = {
Path = "/"
}
}
}
]
}
]
}
]
}

View File

@ -0,0 +1,20 @@
services = [
{
name = "catalog"
port = 443
}
checks = {
Interval = "10s"
Name = "Connect Sidecar Listening"
TCP = "127.0.0.1:20000"
}
kind = "connect-proxy"
name = "web-sidecar-proxy"
port = 20000
proxy = {
destination_service_id = "catalog"
destination_service_name = "catalog"
local_service_address = "127.0.0.1"
local_service_port = 443
}
]

View File

@ -0,0 +1,4 @@
Kind = "service-defaults"
Name = "service-globals"
Protocol = "http"

View File

@ -0,0 +1,88 @@
Kind = "service-router"
Name = "service-router"
Routes = [
{
Match {
HTTP {
PathPrefix = "/identity"
}
},
Destination {
Service = "identity"
}
},
{
Match {
HTTP {
PathPrefix = "/basket"
}
},
Destination {
Service = "basket"
}
},
{
Match {
HTTP {
PathPrefix = "/catalog"
}
},
Destination {
Service = "catalog"
}
},
{
Match {
HTTP {
PathPrefix = "/order"
}
},
Destination {
Service = "order"
}
},
{
Match {
HTTP {
PathPrefix = "/pricing"
}
},
Destination {
Service = "pricing"
}
},
{
Match {
HTTP {
PathPrefix = "/service"
}
#HTTP {
# Methods = ["GET", "POST", "PUT"]
#},
},
Destination {
Service = "service"
#ServiceSubset = "<service-subset-at-destination>"
#Namespace = "<namespace-at-destination>"
#Partition = "<partition-at-destination>"
#PrefixRewrite = "<new-prefix-after-routing>" ## required specifying either Routes.Match.HTTP.PathPrefix or Routes.Match.HTTP.PathExact
#RequestTimeout = 0
#IdleTimeout = 0
#NumRetries = 1
#RetryOnConnectFailure = false
#RetryOn = ["reset", "unavailable"]
#RetryOnStatusCodes = [500, 502, 503]
#RequestHeaders = {
#Set = {
# "X-Web-Version" : "<text-string>"
#}
#}
}
#ResponseHeaders = {
#Set = {
# "X-Web-Version" : "<text-string>"
#}
#}
}
]

View File

@ -0,0 +1,18 @@
config_entries {
bootstrap = [
{
Kind = "proxy-defaults"
Name = "defaults"
Config {
Protocol = "http"
}
},
{
Kind = "service-defaults"
Name = "defaults"
Protocol = "http"
}
]
}

View File

@ -0,0 +1,70 @@
# Datacenter configuration
datacenter = "dc"
domain = "ego.io"
data_dir = "/consul/data"
log_level = "DEBUG"
enable_local_script_checks = true
server = false
ui_config {
enabled = true
content_path = "/registry"
}
bind_addr = "{{ GetPrivateInterfaces | include \"network\" \"10.0.2.0/24\" | attr \"address\" }}"
client_addr = "0.0.0.0"
ports {
dns = -1
https = 8501
http = -1
grpc_tls = 8503
}
dns_config {
service_ttl {
"*" = "20s"
}
node_ttl = "0s"
}
# Connect settings
connect {
enabled = true
}
# TLS Encryption configuration
tls {
defaults {
ca_file = "/usr/share/pki/ca-trust-source/anchors/internalCA.crt"
cert_file = "/etc/certs/gateway.crt"
key_file = "/etc/certs/gateway.key"
#verify_server_hostname = true
#verify_incoming = true
#verify_outgoing = true
verify_incoming = false
verify_outgoing = false
}
}
#auto_encrypt {
# allow_tls = true
#}
# ACL configuration
# After startup, bootstrap the ACL system with `consul acl bootstrap` command
acl = {
enabled = true
default_policy = "deny"
enable_token_persistence = true
tokens {
default = "784746ec-0d5d-fb12-1a79-95f912dcaabd"
initial_management = "784746ec-0d5d-fb12-1a79-95f912dcaabd"
}
}
# Gossip Encryption
encrypt = "tRgXSb6ClvzV1myhc75rWIdwx8tTmUI8UxySKecxiQA="

View File

@ -0,0 +1,19 @@
{
"Provider": "consul",
"Config": {
"LeafCertTTL": "72h",
"PrivateKey": "-----BEGIN PRIVATE KEY-----\nMIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDHQTuRb+EPGlTX\naRNf8cFrjz5hZiXkHX4OxW1CHK/N4SJdRZLVQJ8DvC460GgsKawgRvrIAmkSsDjC\nUAU7erx4XM/q6bLAOQ3w85pJ4SclOg2EhnVWR3Dgej2l4MqwioIkTeMnAdYXJXJq\nQWYNH2UP6dJa5c5YUxXWh+RVy7i4y3II5Y7vbP7vey7A8MwuhLNC5oHygLjHhPtp\nvBO0PAZrG9QFbB3nL/V3gZAZIVXXBg9HivUD5EW664KHJXxstj+ryh8sLg+VL+nv\n+6A7CpjMYav0/7+Kje6ys1sI8ZYcydIpnN6bS39fyDPjpGJu+AE8o8S6CZ9NgbWt\nTTdGrTcXhqS0gJRihRlp7Ybt+ubHC8MJtozqJDma+TdNQEWqnb7Pu/0a9sETJxQa\nnutqUWucgl/8QTZA4krAfgtI8fD2HuiXtM8Jg1pE9fnQFOL4GyIqkl/lvQEFb2zE\nIt6KCwDlDGJfqKTKqSDX1GC+b/8Ge5cL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cx3B913hfnmjRrchioGpsS9au3cZjKLbKa+zedOd2pK1TiVUAVgHUcr\nc893OpUg7nEONHrjzlroMmNHDaqA//Kg2lKMc2xHU06pEIIcCGGD4fAV2nXwn/9g\nl4XK5iBaQt5HIDNl7o+5AbxFQBptv91yLEzxtF3l51CUyh7/yOeJAoL9aKxlWAFh\nTO315Ouy2syTSBAs1Mj3U7KsvrWkRk5QJ3RaSEWf/l1LOgnthd4j6FEOVlB+Qe0U\nlvEIkHMftRKyp54hKABchJGjjsQmxY2Qyegw75mYdqaN0V1mz0dzAW8Bg/6U+i/L\n9bdsTC6WHiFV2InAogpXQRaDBvZXhGDujKR49+oBkLId/jmOpIU/crvdD767W7Fx\nqXz/PGpXoKtPK4tNVhjoBfYhKXTFI47AoplrqhkqbC/gfEEi0ny0DsTOx6r+aTRf\nFFw/JXM=\n-----END CERTIFICATE-----\n",
"IntermediateCertTTL": "8760h"
}
}
{
"Provider": "vault",
"Config": {
"Address": "https://api-vault:8200",
"Token": "hvs.CAESICxuTO_JieCbpMoZ4_qOPIohxSKim_4V8t11JLg93RtKGh4KHGh2cy5VUUFqUm5CdTQ3V3hMQ3BHSDB4dThNZHE",
"RootPKIPath": "pki/",
"IntermediatePKIPath": "pki_int/"
}
}

View File

@ -1,7 +1,6 @@
# Datacenter configuration
datacenter = "ego"
datacenter = "dc"
domain = "ego.io"
node_name = "registry"
data_dir = "/consul/data"
log_level = "DEBUG"
@ -11,62 +10,65 @@ enable_local_script_checks = true
server = true
bootstrap = true
bootstrap_expect = 1
acl_master_token = "784746ec-0d5d-fb12-1a79-95f912dcaabd"
acl_token = "784746ec-0d5d-fb12-1a79-95f912dcaabd"
ui_config {
enabled = true
content_path = "/registry"
dashboard_url_templates {
service = "https://grafana.example.com/d/lDlaj-NGz/service-overview?orgId=1&var-service={{Service.Name}}&var-namespace={{Service.Namespace}}&var-partition={{Service.Partition}}&var-dc={{Datacenter}}"
}
}
bind_addr = "127.0.0.1"
bind_addr = "{{ GetPrivateInterfaces | include \"network\" \"10.0.2.0/24\" | attr \"address\" }}"
client_addr = "0.0.0.0"
ports {
dns = 53
server = 8300
https = 8501
grpc_tls = 8503
dns = 53
#server = 8300
http = -1
https = 8501
grpc_tls = 8503
}
dns_config {
service_ttl {
"*" = "10s"
"*" = "20s"
}
node_ttl = "0s"
}
#enable_central_service_config = true
# Connect settings
#connect {
#enabled = true
#ca_provider = "vault"
connect {
enabled = true
#ca_provider = "consul"
#ca_config {
# address = "https://api-vault:8200"
# token = "hvs.CAESIA9jPKArVgpCNzvze9ehIiX2gKMnVgu0rtSUw54Wj9HQGh4KHGh2cy5LdmJVRnYzVkQ1UXhDU2FKaEFQMW5UTm0"
# root_pki_path = "pki/"
# intermediate_pki_path = "pki_int/"
# ca_file = "/usr/local/share/ca-certificates/internalCA.crt"
# leaf_cert_ttl = "72h"
# private_key = "-----BEGIN PRIVATE KEY-----\nMIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDHQTuRb+EPGlTX\naRNf8cFrjz5hZiXkHX4OxW1CHK/N4SJdRZLVQJ8DvC460GgsKawgRvrIAmkSsDjC\nUAU7erx4XM/q6bLAOQ3w85pJ4SclOg2EhnVWR3Dgej2l4MqwioIkTeMnAdYXJXJq\nQWYNH2UP6dJa5c5YUxXWh+RVy7i4y3II5Y7vbP7vey7A8MwuhLNC5oHygLjHhPtp\nvBO0PAZrG9QFbB3nL/V3gZAZIVXXBg9HivUD5EW664KHJXxstj+ryh8sLg+VL+nv\n+6A7CpjMYav0/7+Kje6ys1sI8ZYcydIpnN6bS39fyDPjpGJu+AE8o8S6CZ9NgbWt\nTTdGrTcXhqS0gJRihRlp7Ybt+ubHC8MJtozqJDma+TdNQEWqnb7Pu/0a9sETJxQa\nnutqUWucgl/8QTZA4krAfgtI8fD2HuiXtM8Jg1pE9fnQFOL4GyIqkl/lvQEFb2zE\nIt6KCwDlDGJfqKTKqSDX1GC+b/8Ge5cLoRWyOtGNtxh6vTA+NYQ2f317K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KLbKa+zedOd2pK1TiVUAVgHUcr\nc893OpUg7nEONHrjzlroMmNHDaqA//Kg2lKMc2xHU06pEIIcCGGD4fAV2nXwn/9g\nl4XK5iBaQt5HIDNl7o+5AbxFQBptv91yLEzxtF3l51CUyh7/yOeJAoL9aKxlWAFh\nTO315Ouy2syTSBAs1Mj3U7KsvrWkRk5QJ3RaSEWf/l1LOgnthd4j6FEOVlB+Qe0U\nlvEIkHMftRKyp54hKABchJGjjsQmxY2Qyegw75mYdqaN0V1mz0dzAW8Bg/6U+i/L\n9bdsTC6WHiFV2InAogpXQRaDBvZXhGDujKR49+oBkLId/jmOpIU/crvdD767W7Fx\nqXz/PGpXoKtPK4tNVhjoBfYhKXTFI47AoplrqhkqbC/gfEEi0ny0DsTOx6r+aTRf\nFFw/JXM=\n-----END CERTIFICATE-----\n"
#}
#}
ca_provider = "vault"
ca_config {
address = "https://api-vault:8200"
token = "hvs.CAESICxuTO_JieCbpMoZ4_qOPIohxSKim_4V8t11JLg93RtKGh4KHGh2cy5VUUFqUm5CdTQ3V3hMQ3BHSDB4dThNZHE"
root_pki_path = "pki/"
intermediate_pki_path = "pki_int/"
}
}
# TLS Encryption configuration
tls {
defaults {
ca_file = "/usr/local/share/ca-certificates/internalCA.crt"
ca_file = "/usr/share/pki/ca-trust-source/anchors/internalCA.crt"
cert_file = "/etc/certs/registry.crt"
key_file = "/etc/certs/registry.key"
verify_incoming = false
verify_outgoing = false
#verify_incoming = true
#verify_outgoing = true
}
internal_rpc {
verify_server_hostname = false
verify_incoming = false
#verify_server_hostname = true
#verify_incoming = true
#verify_outgoing = true
verify_server_hostname = false
verify_incoming = false
verify_outgoing = false
}
}
@ -78,53 +80,228 @@ auto_encrypt {
# After startup, bootstrap the ACL system with `consul acl bootstrap` command
acl = {
enabled = true
default_policy = "allow"
default_policy = "deny"
enable_token_persistence = true
tokens {
default = "784746ec-0d5d-fb12-1a79-95f912dcaabd"
initial_management = "784746ec-0d5d-fb12-1a79-95f912dcaabd"
}
}
# Gossip Encryption
#encrypt = "tRgXSb6ClvzV1myhc75rWIdwx8tTmUI8UxySKecxiQA="
encrypt = "tRgXSb6ClvzV1myhc75rWIdwx8tTmUI8UxySKecxiQA="
# If running Consul 1.8.x or below, enable central service configuration
#enable_central_service_config = true
recursors = ["127.0.0.11", "8.8.8.8", "8.8.4.4"]
#config_entries {
#bootstrap = [
#{
# Kind = "api-gateway"
# Name = "gw"
# Listeners = [
# {
# Name = "http"
# Port = 443
# Protocol = "http"
# }
# ]
#}
#{
# Kind = "service-defaults"
# Name = "defaults"
# Protocol = "http"
#},
#{
# Kind = "service-router"
# Name = "service-router"
# #Hostnames = ["catalog", "catalog-svc", "catalog.service.ego.io"]
# Routes = [
# {
# Match = {
# HTTP {
# PathPrefix = "/catalog"
# }
# }
# Destination {
# Service = "catalog"
# }
# }
# ]
#}
#]
#}
# ADDITIONAL CONFIGS
config_entries {
bootstrap = [
{
Kind = "proxy-defaults"
Name = "global"
Config {
Protocol = "http"
}
AccessLogs {
Enabled = true
},
MeshGateway {
Mode = "local"
}
},
{
Kind = "service-defaults"
Name = "global"
Protocol = "http"
MeshGateway {
Mode = "local"
}
},
#{
# Kind = "mesh"
# Peering {
# PeerThroughMeshGateways = true
# }
#},
{
Kind = "file-system-certificate"
Name = "gateway-certificate"
Certificate = "/etc/certs/gateway.crt"
PrivateKey = "/etc/certs/gateway.key"
},
#{
# Kind = "file-system-certificate"
# Name = "catalog-certificate"
# Certificate = "/etc/certs/catalog.crt"
# PrivateKey = "/etc/certs/catalog.key"
#},
{
Kind = "api-gateway"
Name = "gateway"
Listeners = [
{
Name = "gw-listener"
Port = 8443
Protocol = "http"
TLS = {
Certificates = [
{
Kind = "file-system-certificate"
Name = "gateway-certificate"
}
]
}
}
]
},
{
Kind = "http-route"
Name = "basket-routes"
Hostnames = ["basket.service.ego.io"]
Parents = [
{
Kind = "api-gateway"
Name = "gateway"
SectionName = "gw-listener"
}
]
Rules = [
{
Matches = [
{
Path = {
Match = "prefix"
Value = "/basket"
}
}
]
#Filters = {
# URLRewrite = {
# Path = "/basket"
# }
#}
Services = [
{
Name = "basket"
Weight = 90
#Filters = {
# URLRewrite = {
# Path = "/"
# }
#}
}
]
}
]
},
{
Kind = "http-route"
Name = "catalog-routes"
Hostnames = ["catalog.service.ego.io"]
Parents = [
{
Kind = "api-gateway"
Name = "gateway"
SectionName = "gw-listener"
}
]
Rules = [
{
Matches = [
{
Path = {
Match = "prefix"
Value = "/catalog"
}
}
]
#Filters = {
# URLRewrite = {
# Path = "/catalog"
# }
#}
Services = [
{
Name = "catalog"
Weight = 90
#Filters = {
# URLRewrite = {
# Path = "/"
# }
#}
}
]
}
]
},
{
Kind = "service-router"
Name = "gateway"
Routes = [
{
Match {
HTTP {
PathPrefix = "/identity"
}
},
Destination {
Service = "identity"
RetryOnConnectFailure = true
RequestTimeout = "120s"
PrefixRewrite = "/"
}
},
{
Match {
HTTP {
PathPrefix = "/basket"
}
},
Destination {
Service = "basket"
RetryOnConnectFailure = true
RequestTimeout = "120s"
PrefixRewrite = "/"
}
},
{
Match {
HTTP {
PathPrefix = "/catalog"
}
},
Destination {
Service = "catalog"
RetryOnConnectFailure = true
RequestTimeout = "120s"
PrefixRewrite = "/"
}
},
{
Match {
HTTP {
PathPrefix = "/order"
}
},
Destination {
Service = "order"
RetryOnConnectFailure = true
RequestTimeout = "120s"
PrefixRewrite = "/"
}
},
{
Match {
HTTP {
PathPrefix = "/pricing"
}
},
Destination {
Service = "pricing"
RetryOnConnectFailure = true
RequestTimeout = "120s"
PrefixRewrite = "/"
}
}
]
}
]
}

View File

@ -1,3 +1,3 @@
{{ with secret "pki_int/issue/ego-io" "common_name=server.me.registry" "ttl=72h"}}
{{ with secret "pki_int/issue/ego.io" "common_name=ego.io" "ttl=72h"}}
{{ .Data.issuing_ca }}
{{ end }}

View File

@ -1,3 +1,3 @@
{{ with secret "pki_int/issue/ego-io" "common_name=catalog.service.ego.io" "ttl=72h" "alt_names=catalog.service.ego.io" "ip_sans=127.0.0.1"}}
{{ with secret "pki_int/issue/ego.io" "common_name=catalog.service.ego.io" "ttl=72h" "alt_names=catalog.service.ego.io" "ip_sans=127.0.0.1"}}
{{ .Data.certificate }}
{{ end }}

View File

@ -1,3 +1,3 @@
{{ with secret "pki_int/issue/ego-io" "common_name=catalog.service.ego.io" "ttl=72h" "alt_names=catalog.service.ego.io" "ip_sans=127.0.0.1"}}
{{ with secret "pki_int/issue/ego.io" "common_name=catalog.service.ego.io" "ttl=72h" "alt_names=catalog.service.ego.io" "ip_sans=127.0.0.1"}}
{{ .Data.private_key }}
{{ end }}

8
api-registry/spawn-process.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
sleep 10
until ${COMMAND}; do
echo "Envoy crashed with exit code $?. Respawning.." >&2
sleep 1
done

View File

@ -0,0 +1,18 @@
#!/bin/sh
# consul connect envoy -gateway api -register \
# -service gw-mesh -token=${CONSUL_HTTP_TOKEN} \
# -address "{{ GetPrivateInterfaces | include \"network\" \"10.0.2.0/24\" | attr \"address\" }}:8443" \
# -wan-address "{{ GetPrivateInterfaces | include \"network\" \"10.0.2.0/24\" | attr \"address\" }}:8443" \
# -bind-address gw-listener=0.0.0.0:8443 \
# -enable-config-gen-logging
consul connect envoy -gateway api -register -service gateway -admin-bind 0.0.0.0:19000 -bind-address gw-listener=0.0.0.0:8443 -token=${CONSUL_HTTP_TOKEN} -enable-config-gen-logging -- --log-level trace --log-file /var/log/api-gateway.log 2>&1 &
# -address "{{ GetPrivateInterfaces | include \"network\" \"10.0.2.0/24\" | attr \"address\" }}:8443"
# -bind-address gw-listener=0.0.0.0:80
# catalog sidecar
consul connect envoy -sidecar-for catalog -admin-bind 0.0.0.0:20000 -token=${CONSUL_HTTP_TOKEN} -enable-config-gen-logging -- --log-level trace --log-file /var/log/sidecar-catalog.log 2>&1 &
#basket sidecar
consul connect envoy -sidecar-for basket -admin-bind 0.0.0.0:20001 -token=${CONSUL_HTTP_TOKEN} -enable-config-gen-logging -- --log-level trace --log-file /var/log/sidecar-basket.log 2>&1 &

View File

@ -1,7 +1,7 @@
#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-registry"
export IMAGE_NAME="git.pbiernat.io/egommerce/api-registry"
TARGET=${1:-latest}

View File

@ -1,9 +1,12 @@
#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-registry"
export IMAGE_NAME="git.pbiernat.io/egommerce/api-registry"
TARGET=${1:-latest}
echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin
echo $DOCKER_PASSWORD | docker login git.pbiernat.io -u $DOCKER_USERNAME --password-stdin
docker push "$IMAGE_NAME:$TARGET"
# Restart container
curl -X POST http://127.0.0.1:9001/api/webhooks/603d2077-4018-4983-bbff-875154ec9e83

15
example.hcl Normal file
View File

@ -0,0 +1,15 @@
service {
id = "registry"
name = "registry"
tags = ["api-registry", "registry", "https", "grpc", "tcp", "consul", "catalog"]
address = ""
port = 8500
check {
id = "registry"
name = "Registry Service"
tcp ="localhost:53"
interval = "10s"
timeout = "1s"
}
}

7
secrets Normal file
View File

@ -0,0 +1,7 @@
AccessorID: d0dfcac2-5459-f7d8-c42f-2ee906a34279
SecretID: 784746ec-0d5d-fb12-1a79-95f912dcaabd
Description: Bootstrap Token (Global Management)
Local: false
Create Time: 2023-07-29 22:37:20.267488642 +0000 UTC
Policies:
00000000-0000-0000-0000-000000000001 - global-management

19
var/certs/VaultCA.pem Normal file
View File

@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDJjCCAg6gAwIBAgIUIG28xUQKS1B35XXFoBsEWgRO2QYwDQYJKoZIhvcNAQEL
BQAwETEPMA0GA1UEAxMGZWdvLmlvMB4XDTIzMDcwNjE5MjkxM1oXDTMzMDcwMzE5
Mjk0M1owETEPMA0GA1UEAxMGZWdvLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MI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