-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into optimization
# Conflicts: # sermant-plugins/sermant-router/spring-router-plugin/src/main/java/com/huaweicloud/sermant/router/spring/interceptor/FeignClientInterceptor.java
- Loading branch information
Showing
24 changed files
with
649 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: sermant-backend-lite-service | ||
labels: | ||
app: sermant-backend-lite | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 8900 | ||
nodePort: 30001 | ||
name: sermant-backend-lite-service-http | ||
- port: 6888 | ||
nodePort: 30002 | ||
name: sermant-backend-lite-service-netty | ||
selector: | ||
app: sermant-backend-lite | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: sermant-backend-lite-deployment | ||
labels: | ||
app: sermant-backend-lite | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: sermant-backend-lite | ||
template: | ||
metadata: | ||
labels: | ||
app: sermant-backend-lite | ||
spec: | ||
containers: | ||
- name: sermant-backend-lite-deployment | ||
image: { image.address } | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "4096Mi" | ||
cpu: "2" | ||
limits: | ||
memory: "4096Mi" | ||
cpu: "2" | ||
ports: | ||
- containerPort: 8900 | ||
- containerPort: 6888 | ||
imagePullSecrets: | ||
- name: default-secret |
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,10 @@ | ||
FROM java:8 | ||
|
||
WORKDIR /home | ||
|
||
COPY sermant-backend-lite.jar /home | ||
COPY start.sh /home | ||
|
||
RUN chmod -R 777 /home | ||
|
||
ENTRYPOINT ["sh", "/home/start.sh"] |
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,3 @@ | ||
#!/bin/bash | ||
|
||
java -jar /home/sermant-backend-lite.jar |
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
13 changes: 12 additions & 1 deletion
13
sermant-backend-lite/src/main/webapp/sermant-frontend/src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
46 changes: 46 additions & 0 deletions
46
...java/com/huaweicloud/sermant/router/spring/declarer/HttpUrlConnectionConnectDeclarer.java
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,46 @@ | ||
/* | ||
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.huaweicloud.sermant.router.spring.declarer; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.declarer.AbstractPluginDeclarer; | ||
import com.huaweicloud.sermant.core.plugin.agent.declarer.InterceptDeclarer; | ||
import com.huaweicloud.sermant.core.plugin.agent.matcher.ClassMatcher; | ||
import com.huaweicloud.sermant.core.plugin.agent.matcher.MethodMatcher; | ||
|
||
/** | ||
* 定义JDK 1.8版本的java.net.HttpURLConnection的拦截点信息<br> | ||
* | ||
* @author yuzl 俞真龙 | ||
* @since 2022-10-25 | ||
*/ | ||
public class HttpUrlConnectionConnectDeclarer extends AbstractPluginDeclarer { | ||
private static final String METHOD_NAME = "connect"; | ||
|
||
private static final String INTERCEPTOR_CLASS = | ||
"com.huaweicloud.sermant.router.spring.interceptor.HttpUrlConnectionConnectInterceptor"; | ||
|
||
@Override | ||
public ClassMatcher getClassMatcher() { | ||
return ClassMatcher.isExtendedFrom("java.net.HttpURLConnection"); | ||
} | ||
|
||
@Override | ||
public InterceptDeclarer[] getInterceptDeclarers(ClassLoader classLoader) { | ||
return new InterceptDeclarer[] { | ||
InterceptDeclarer.build(MethodMatcher.nameEquals(METHOD_NAME), INTERCEPTOR_CLASS)}; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...in/src/main/java/com/huaweicloud/sermant/router/spring/declarer/RestTemplateDeclarer.java
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,46 @@ | ||
/* | ||
* Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.huaweicloud.sermant.router.spring.declarer; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.declarer.AbstractPluginDeclarer; | ||
import com.huaweicloud.sermant.core.plugin.agent.declarer.InterceptDeclarer; | ||
import com.huaweicloud.sermant.core.plugin.agent.matcher.ClassMatcher; | ||
import com.huaweicloud.sermant.core.plugin.agent.matcher.MethodMatcher; | ||
|
||
/** | ||
* org.springframework.web.client.RestTemplate的拦截点定义<br> | ||
* | ||
* @author yuzl 俞真龙 | ||
* @since 2022-10-27 | ||
*/ | ||
public class RestTemplateDeclarer extends AbstractPluginDeclarer { | ||
private static final String ENHANCE_CLASS = "org.springframework.web.client.RestTemplate"; | ||
private static final String ENHANCE_METHOD = "doExecute"; | ||
private static final String INTERCEPTOR_CLASS = | ||
"com.huaweicloud.sermant.router.spring.interceptor.RestTemplateInterceptor"; | ||
|
||
@Override | ||
public ClassMatcher getClassMatcher() { | ||
return ClassMatcher.nameEquals(ENHANCE_CLASS); | ||
} | ||
|
||
@Override | ||
public InterceptDeclarer[] getInterceptDeclarers(ClassLoader classLoader) { | ||
return new InterceptDeclarer[] { | ||
InterceptDeclarer.build(MethodMatcher.nameEquals(ENHANCE_METHOD), INTERCEPTOR_CLASS)}; | ||
} | ||
} |
Oops, something went wrong.