Skip to content

Commit

Permalink
feat(service-mesh): deployment linkerd
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurzydym committed Oct 2, 2023
1 parent 2a0855a commit 12bb6a6
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 30 deletions.
11 changes: 11 additions & 0 deletions ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBjDCCATOgAwIBAgIQAQLOxYi/wHJEzliDjlHjHzAKBggqhkjOPQQDAjAlMSMw
IQYDVQQDExpyb290LmxpbmtlcmQuY2x1c3Rlci5sb2NhbDAeFw0yMzA5MjIxNDU4
MThaFw0zMzA5MTkxNDU4MThaMCUxIzAhBgNVBAMTGnJvb3QubGlua2VyZC5jbHVz
dGVyLmxvY2FsMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDPPltuWri9JncM/t
OSpE7OKQumK14yf+lnIE0c9rsgBiqn/7rc8Wps4FCZtHiQdOYEify7VSo+ytagIR
VsDxaqNFMEMwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYD
VR0OBBYEFCbAZMdByHcvt2YDQCybWtd6HcjlMAoGCCqGSM49BAMCA0cAMEQCIFLk
UB0Yj+3T/3CKz5bAbRMz7Zaz7p8G1yiCdP+WFOwaAiAoQqh4nVqqV/EMKjuKMIVX
6X3uB1BOc9NxqI0gEhPEYg==
-----END CERTIFICATE-----
5 changes: 5 additions & 0 deletions ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIEAZRZYzJZildqEfLuVcXMTFrJ7xyJGhAW9nYYOy/z3VoAoGCCqGSM49
AwEHoUQDQgAEDPPltuWri9JncM/tOSpE7OKQumK14yf+lnIE0c9rsgBiqn/7rc8W
ps4FCZtHiQdOYEify7VSo+ytagIRVsDxag==
-----END EC PRIVATE KEY-----
16 changes: 0 additions & 16 deletions delivery-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
<junit.version>5.8.2</junit.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-bom</artifactId>
<version>1.27.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.meecrowave</groupId>
Expand Down Expand Up @@ -138,10 +126,6 @@
<artifactId>geronimo-metrics</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@
import java.io.IOException;
import java.util.logging.Logger;

import io.opentelemetry.api.trace.Span;

/**
* Filter to allow cross origin calls.
*/
@Provider
@ApplicationScoped
public class CORSFilter implements ContainerRequestFilter, ContainerResponseFilter {
public class CORSFilter implements ContainerResponseFilter {

private static final Logger LOG = Logger.getLogger(CORSFilter.class.getSimpleName());
@Override
Expand All @@ -45,16 +43,5 @@ public void filter(final ContainerRequestContext requestContext,
cres.getHeaders().add("Access-Control-Allow-Credentials", "true");
cres.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD");
cres.getHeaders().add("Access-Control-Max-Age", "1209600");

ThreadContext.remove("traceId");
ThreadContext.remove("spanId");
}

@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
LOG.info("Current Span: " + Span.current().getSpanContext().getTraceId() + " " + Span.current().getSpanContext().getSpanId());

ThreadContext.put("traceId", Span.current().getSpanContext().getTraceId());
ThreadContext.put("spanId", Span.current().getSpanContext().getSpanId());
}
}
1 change: 1 addition & 0 deletions deployment/base/address-validation-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
annotations:
sidecar.opentelemetry.io/inject: "otel-collector"
instrumentation.opentelemetry.io/inject-java: "true"
linkerd.io/inject: enabled
spec:
containers:
- name: address-validation-service
Expand Down
1 change: 1 addition & 0 deletions deployment/base/billing-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
annotations:
sidecar.opentelemetry.io/inject: "otel-collector"
instrumentation.opentelemetry.io/inject-java: "true"
linkerd.io/inject: enabled
spec:
containers:
- name: billing-service
Expand Down
1 change: 1 addition & 0 deletions deployment/base/customer-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
annotations:
sidecar.opentelemetry.io/inject: "otel-collector"
instrumentation.opentelemetry.io/inject-java: "true"
linkerd.io/inject: enabled
spec:
containers:
- name: customer-service
Expand Down
1 change: 1 addition & 0 deletions deployment/base/delivery-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
annotations:
sidecar.opentelemetry.io/inject: "otel-collector"
instrumentation.opentelemetry.io/inject-java: "true"
linkerd.io/inject: enabled
spec:
containers:
- name: delivery-service
Expand Down
12 changes: 12 additions & 0 deletions issuer.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBtDCCAVmgAwIBAgIRAPbHRnaTtCA1/5S6VmsslNwwCgYIKoZIzj0EAwIwJTEj
MCEGA1UEAxMacm9vdC5saW5rZXJkLmNsdXN0ZXIubG9jYWwwHhcNMjMwOTIyMTQ1
ODI4WhcNMjQwOTIxMTQ1ODI4WjApMScwJQYDVQQDEx5pZGVudGl0eS5saW5rZXJk
LmNsdXN0ZXIubG9jYWwwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQh08K8b8H9
PmGGq1vHaRjzdb6evQcOj+sbXkTURD+4iOi3SmG10LjCK4yHn2zW0NEL4MjuGtgu
C2KYFq8ndx2No2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIB
ADAdBgNVHQ4EFgQUA2/apk2leRx751eVB93l74Q9mV4wHwYDVR0jBBgwFoAUJsBk
x0HIdy+3ZgNALJta13odyOUwCgYIKoZIzj0EAwIDSQAwRgIhAJC2hV1msCCHzzc/
25RCzvZCFS62Y9B0lkCBqsstyDjxAiEAstJZVnzuS7vcaN17nLpRcfhuiixT6VgG
g7zgWh7A/g4=
-----END CERTIFICATE-----
5 changes: 5 additions & 0 deletions issuer.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIG8AgHlbZm+45zY0CBI7vtzPyroETnKYOuEbwAU8whr7oAoGCCqGSM49
AwEHoUQDQgAEIdPCvG/B/T5hhqtbx2kY83W+nr0HDo/rG15E1EQ/uIjot0phtdC4
wiuMh59s1tDRC+DI7hrYLgtimBavJ3cdjQ==
-----END EC PRIVATE KEY-----
14 changes: 14 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ deploy:
createNamespace: true
valuesFiles:
- ./ingress-nginx-values.yaml
- name: linkerd-crds
repo: https://helm.linkerd.io/stable
remoteChart: linkerd-crds
namespace: linkerd
createNamespace: true
- name: linkerd-control-plane
repo: https://helm.linkerd.io/stable
remoteChart: linkerd-control-plane
namespace: linkerd
createNamespace: true
setFiles:
identityTrustAnchorsPEM: ./ca.crt
"identity.issuer.tls.crtPEM": ./issuer.crt
"identity.issuer.tls.keyPEM": ./issuer.key
statusCheckDeadlineSeconds: 300
tolerateFailuresUntilDeadline: true

Expand Down

0 comments on commit 12bb6a6

Please sign in to comment.