-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for cloud-based platforms #7
Merged
+5,570
−1,234
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
035fa23
This version has been adapter to Spring Boot 2.3 support for docker i…
odedia 11686a0
Fixed README
odedia 77d2ba3
added snapshot repo
odedia e59a093
Update .travis.yml
odedia f38d75a
Update README.md
odedia c4793db
Update README.md
odedia d8cf647
Update README.md
odedia b887f12
Update README.md
odedia 86f1670
support for restart context
odedia 253c79b
Merge branch 'master' of https://github.com/odedia/spring-petclinic-c…
odedia ab74f0f
Update README.md
odedia cce719e
Update DiscoveryConfig.java
odedia 039fbee
Update README.md
odedia 3c34e31
Update README.md
odedia 5d4657c
Update README.md
odedia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
This version has been adapter to Spring Boot 2.3 support for docker i…
…mages, and supports deploying to Cloud Foundry and Kubernetes with free Wavefront monitoring.
commit 035fa2327259b8a222e6c59f6c9cabc52a35c18e
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,38 @@ | ||
resource_types: | ||
- name: cf-cli-resource | ||
type: docker-image | ||
source: | ||
repository: nulldriver/cf-cli-resource | ||
tag: latest | ||
|
||
resources: | ||
- name: cf | ||
type: cf | ||
source: | ||
api: ((cf-api)) | ||
username: ((cf-username)) | ||
password: ((cf-password)) | ||
organization: ((cf-org)) | ||
space: ((cf-space)) | ||
- name: docker-image | ||
type: docker-image | ||
source: | ||
repository: spring-petclinic/api-gateway | ||
|
||
jobs: | ||
- name: deploy | ||
plan: | ||
- get: docker-image | ||
trigger: true | ||
params: | ||
globs: [ "((app)).jar", "manifest.yml" ] | ||
- put: cf | ||
params: | ||
manifest: github-prerelease/manifest.yml | ||
current_app_name: ((app)) | ||
- put: cf-add-network-policy | ||
resource: cf-env | ||
params: | ||
command: add-network-policy | ||
source_app: cloudnativepoll-webui | ||
destination_app: cloudnativepoll-backend |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: api-gateway | ||
name: api-gateway | ||
namespace: spring-pet-clinic | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: api-gateway | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
app: api-gateway | ||
spec: | ||
containers: | ||
- image: ${REPOSITORY_PREFIX}/api-gateway:latest | ||
name: api-gateway | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
httpGet: | ||
port: 8080 | ||
path: /actuator/health | ||
initialDelaySeconds: 90 | ||
periodSeconds: 2 | ||
readinessProbe: | ||
httpGet: | ||
port: 8080 | ||
path: /actuator/health | ||
initialDelaySeconds: 15 | ||
resources: | ||
limits: | ||
memory: 1Gi | ||
requests: | ||
cpu: 2000m | ||
memory: 1Gi | ||
env: | ||
- name: SPRING_PROFILES_ACTIVE | ||
value: kubernetes | ||
- name: MANAGEMENT_METRICS_EXPORT_WAVEFRONT_URI | ||
value: proxy://wavefront-proxy.spring-pet-clinic.svc.cluster.local:2878 | ||
ports: | ||
- containerPort: 8080 | ||
resources: {} | ||
restartPolicy: Always | ||
status: {} |
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,60 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
labels: | ||
app: customers-service | ||
name: customers-service | ||
namespace: spring-pet-clinic | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: customers-service | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
app: customers-service | ||
spec: | ||
containers: | ||
- image: ${REPOSITORY_PREFIX}/customers-service:latest | ||
name: customers-service | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
httpGet: | ||
port: 8080 | ||
path: /actuator/health | ||
initialDelaySeconds: 90 | ||
periodSeconds: 2 | ||
readinessProbe: | ||
httpGet: | ||
port: 8080 | ||
path: /actuator/health | ||
initialDelaySeconds: 15 | ||
resources: | ||
limits: | ||
memory: 1Gi | ||
requests: | ||
cpu: 2000m | ||
memory: 1Gi | ||
env: | ||
- name: SPRING_PROFILES_ACTIVE | ||
value: kubernetes | ||
- name: SPRING_DATASOURCE_URL | ||
value: jdbc:mysql://customers-db-mysql.spring-pet-clinic.svc.cluster.local:3306/my_database?queryInterceptors=brave.mysql8.TracingQueryInterceptor&exceptionInterceptors=brave.mysql8.TracingExceptionInterceptor&zipkinServiceName=customers-db | ||
- name: SPRING_DATASOURCE_USERNAME | ||
value: root | ||
- name: SPRING_DATASOURCE_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: customers-db-mysql | ||
key: mysql-root-password | ||
- name: MANAGEMENT_METRICS_EXPORT_WAVEFRONT_URI | ||
value: proxy://wavefront-proxy.spring-pet-clinic.svc.cluster.local:2878 | ||
ports: | ||
- containerPort: 8080 | ||
resources: {} | ||
restartPolicy: Always | ||
status: {} |
Binary file not shown.
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,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: spring-pet-clinic |
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,108 @@ | ||
--- | ||
odedia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: pet-clinic-config | ||
namespace: spring-pet-clinic | ||
data: | ||
application.yaml: |- | ||
server: | ||
port: 8080 | ||
compression: | ||
enabled: true | ||
mime-types: application/json,text/css,application/javascript | ||
min-response-size: 2048 | ||
wavefront: | ||
application: | ||
name: spring-pet-clinic-k8s | ||
freemium-account: true | ||
# Logging | ||
logging.level.org.springframework: INFO | ||
# Metrics | ||
management: | ||
endpoint: | ||
restart: | ||
enabled: true | ||
metrics: | ||
enabled: true | ||
prometheus: | ||
enabled: true | ||
endpoints: | ||
web: | ||
exposure: | ||
include: '*' | ||
metrics: | ||
export: | ||
prometheus: | ||
enabled: true | ||
wavefront: | ||
enabled: true | ||
customers-service-id: http://customers-service.spring-pet-clinic.svc.cluster.local:8080 | ||
visits-service-id: http://vists-service.spring-pet-clinic.svc.cluster.local:8080 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Thanks. |
||
spring: | ||
datasource: | ||
schema: classpath*:db/mysql/schema.sql | ||
data: classpath*:db/mysql/data.sql | ||
platform: mysql | ||
initialization-mode: always | ||
jpa: | ||
show-sql: true | ||
hibernate: | ||
ddl-auto: none | ||
generate-ddl: false | ||
sleuth: | ||
sampler: | ||
probability: 1.0 | ||
config: | ||
# Allow the microservices to override the remote properties with their own System properties or config file | ||
allow-override: true | ||
# Override configuration with any local property source | ||
override-none: true | ||
messages: | ||
basename: messages/messages | ||
cloud: | ||
kubernetes: | ||
discovery: | ||
enabled: true | ||
loadbalancer: | ||
ribbon: | ||
enabled: false | ||
gateway: | ||
x-forwarded: | ||
enabled: true | ||
for-enabled: true | ||
proto-enabled: true | ||
host-append: false | ||
port-append: false | ||
proto-append: false | ||
routes: | ||
- id: vets-service | ||
uri: http://vets-service.spring-pet-clinic.svc.cluster.local:8080 | ||
predicates: | ||
- Path=/api/vet/** | ||
filters: | ||
- StripPrefix=2 | ||
- id: visits-service | ||
uri: http://visits-service.spring-pet-clinic.svc.cluster.local:8080 | ||
predicates: | ||
- Path=/api/visit/** | ||
filters: | ||
- StripPrefix=2 | ||
- id: customers-service | ||
uri: http://customers-service.spring-pet-clinic.svc.cluster.local:8080 | ||
predicates: | ||
- Path=/api/customer/** | ||
filters: | ||
- StripPrefix=2 | ||
vets: | ||
cache: | ||
ttl: 60 | ||
heap-size: 101 | ||
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,25 @@ | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
namespace: spring-pet-clinic | ||
name: namespace-reader | ||
rules: | ||
- apiGroups: ["", "extensions", "apps"] | ||
resources: ["configmaps", "pods", "services", "endpoints", "secrets"] | ||
verbs: ["get", "list", "watch"] | ||
|
||
--- | ||
|
||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: namespace-reader-binding | ||
namespace: spring-pet-clinic | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
apiGroup: "" | ||
roleRef: | ||
kind: Role | ||
name: namespace-reader | ||
apiGroup: "" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With layered Jar of Spring Boot 2.3, don't we have to use the `org.springframework.boot.loader.JarLauncher?