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
# k3d-config.yml | |
apiVersion: k3d.io/v1alpha3 | |
kind: Simple | |
name: "mycluster" | |
servers: 1 | |
agents: 2 | |
kubeAPI: | |
hostIP: "0.0.0.0" | |
hostPort: "6443" | |
ports: |
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
/** | |
Helper that copies the state of Reactor [Context] to MDC on the #onNext function. | |
*/ | |
@Slf4j | |
@RequiredArgsConstructor | |
public class MdcContextLifter<T> implements CoreSubscriber<T> { | |
private final CoreSubscriber<T> coreSubscriber; | |
@Override |
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
/** | |
* @link https://www.novatec-gmbh.de/en/blog/how-can-the-mdc-context-be-used-in-the-reactive-spring-applications/ | |
* https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Hooks.html#onEachOperator-java.util.function.Function- | |
*/ | |
@Configuration | |
public class MdcContextLifterConfig { | |
public static final String MDC_CONTEXT_REACTOR_KEY = MdcContextLifterConfig.class.getName(); | |
@PostConstruct |
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
@Slf4j | |
@Configuration | |
public class MdcLoggingFilter implements WebFilter { | |
private static final String MDC_KEY_TRACE_ID = "traceId"; | |
@Override | |
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) { | |
ServerHttpRequest request = exchange.getRequest(); | |
String requestId = getRequestId(request.getHeaders()); |
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
// build.gradle | |
ext { | |
set('springCloudVersion', "2021.0.5") | |
} | |
dependencyManagement { | |
imports { | |
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" | |
} | |
} |
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
# application.yml | |
spring: | |
security: | |
oauth2: | |
resourceserver: | |
opaquetoken: | |
introspection-uri: http://localhost:8080/auth/realms/demo/protocol/openid-connect/token/introspect | |
client-id: demo-client | |
client-secret: 83f3e948-3f8c-49da-af7f-87a42d5ea6fd |
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
# application.yml | |
spring: | |
security: | |
oauth2: | |
resourceserver: | |
jwt: | |
issuer-uri: http://localhost:8080/auth/realms/demo |
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
package com.demo.scg.config; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; | |
import org.springframework.security.config.web.server.ServerHttpSecurity; | |
import org.springframework.security.web.server.SecurityWebFilterChain; | |
@Configuration |
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
package com.demo.scg.config; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.stream.Collectors; |
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
# argocd-canary-rollout.yml | |
apiVersion: argoproj.io/v1alpha1 | |
kind: Rollout | |
# 이 아래 내용은 기존 Deployment와 동일하게 작성 | |
metadata: | |
name: demo-scg-rollout | |
namespace: gateway | |
spec: | |
minReadySeconds: 30 | |
revisionHistoryLimit: 3 |
OlderNewer