Skip to content

Commit

Permalink
Remove cosky dependency (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Jun 20, 2023
1 parent 4487fa5 commit 5135cce
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 58 deletions.
1 change: 0 additions & 1 deletion cosec-dependencies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies {
api(platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.3"))
api(platform("me.ahoo.cosid:cosid-bom:2.1.0"))
api(platform("me.ahoo.cocache:cocache-bom:2.0.0"))
api(platform("me.ahoo.cosky:cosky-bom:3.3.14"))
api(platform("me.zhyd.oauth:JustAuth:1.16.5"))
api(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:1.27.0"))
constraints {
Expand Down
8 changes: 2 additions & 6 deletions cosec-gateway-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ plugins {
kotlin("kapt")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
kotlin {
jvmToolchain(17)
}
tasks.jar.configure {
exclude("application.yaml", "bootstrap.yaml")
Expand Down Expand Up @@ -68,8 +66,6 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-redis")
implementation("me.ahoo.cosid:cosid-spring-redis")
implementation("me.ahoo.cosid:cosid-spring-boot-starter")
implementation("me.ahoo.cosky:spring-cloud-starter-cosky-config")
implementation("me.ahoo.cosky:spring-cloud-starter-cosky-discovery")
implementation("org.springframework.cloud:spring-cloud-starter-gateway")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
implementation("org.springframework.cloud:spring-cloud-starter-loadbalancer")
Expand Down
2 changes: 1 addition & 1 deletion cosec-gateway-server/src/dist/config/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
spring:
application:
name: ${service.name:cosec-gateway}
name: ${service.name:cosec-gateway}
10 changes: 1 addition & 9 deletions cosec-gateway-server/src/main/resources/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
spring:
application:
name: ${service.name:cosec-gateway}
cloud:
cosky:
namespace: ${cosky.namespace:{dev}}
config:
config-id: ${spring.application.name}.yaml
service-registry:
auto-registration:
enabled: ${cosky.auto-registry:false}
name: ${service.name:cosec-gateway}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License.
#
group=me.ahoo.cosec
version=2.0.0-M1
version=2.0.0
description=RBAC-based And Policy-based Multi-Tenant Reactive Security Framework.
website=https://github.com/Ahoo-Wang/CoSec
issues=https://github.com/Ahoo-Wang/CoSec/issues
Expand Down
19 changes: 19 additions & 0 deletions k8s/cosec-gateway-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cosec-gateway-config
labels:
app: cosec-gateway-config
data:
bootstrap.yaml: |-
spring:
application:
name: ${service.name:cosec-gateway}
application.yaml: |-
server:
error:
whitelabel:
enabled: false
cosec:
authentication:
enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ spec:
spec:
containers:
- env:
- name: SPRING_REDIS_HOST
value: redis-uri:6379
- name: SPRING_REDIS_PASSWORD
value: redis-pwd
- name: SPRING_CLOUD_COSKY_NAMESPACE
value: '{dev}'
- name: TZ
value: Asia/Shanghai
image: ahoowang/cosec-gateway:lastVersion
Expand Down Expand Up @@ -52,42 +46,13 @@ spec:
volumeMounts:
- mountPath: /etc/localtime
name: volume-localtime
- mountPath: /opt/cosec-gateway-server/config/
name: cosec-gateway-config
volumes:
- hostPath:
path: /etc/localtime
type: ""
name: volume-localtime
---
apiVersion: v1
kind: Service
metadata:
name: cosec-gateway
labels:
app: cosec-gateway
spec:
selector:
app: cosec-gateway
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: cosec-gateway-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: cosec-gateway
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 600
- configMap:
name: cosec-gateway-config
name: cosec-gateway-config
18 changes: 18 additions & 0 deletions k8s/cosec-gateway-hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: cosec-gateway-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: cosec-gateway
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 600
14 changes: 14 additions & 0 deletions k8s/cosec-gateway-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: cosec-gateway
labels:
app: cosec-gateway
spec:
selector:
app: cosec-gateway
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080

0 comments on commit 5135cce

Please sign in to comment.