diff --git a/README.md b/README.md index 76229816..8e4f47b8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ko apply --strict -f config Samples are located in the [samples directory](./samples), including: -- [Spring PetClinic with MySQL](./samples/petclinic) +- [Spring PetClinic with MySQL](./samples/spring-petclinic) - [Custom Projection](./samples/custom-projection) - [Controlled Resource](./samples/controlled-resource) - [Environment Variables and Mappings](./samples/environment-variable-mappings) diff --git a/samples/environment-variable-mappings/README.md b/samples/environment-variable-mappings/README.md index 8fabbbd4..44bba398 100644 --- a/samples/environment-variable-mappings/README.md +++ b/samples/environment-variable-mappings/README.md @@ -99,7 +99,7 @@ kubectl delete -f ./samples/environment-variable-mappings/ kubectl apply -f ./samples/environment-variable-mappings/ ``` -The application logs will not contain the `GAME_SERVER` variable: +The application logs will no longer contain the `GAME_SERVER` variable: ```sh kubectl logs -l job-name=mappings diff --git a/samples/petclinic/README.md b/samples/spring-petclinic/README.md similarity index 83% rename from samples/petclinic/README.md rename to samples/spring-petclinic/README.md index 27a1d6ff..cfbbdf34 100644 --- a/samples/petclinic/README.md +++ b/samples/spring-petclinic/README.md @@ -11,13 +11,13 @@ If not already installed, [install the ServiceBinding CRD and controller][instal Apply the PetClinic application, MySQL service and connect them with a ServiceBinding: ```sh -kubectl apply -f ./samples/petclinic +kubectl apply -f ./samples/spring-petclinic ``` Wait for the application (and database) to start and become healthy: ```sh -kubectl wait deployment petclinic --for condition=available --timeout=2m +kubectl wait deployment spring-petclinic --for condition=available --timeout=2m ``` ## Understand @@ -25,10 +25,10 @@ kubectl wait deployment petclinic --for condition=available --timeout=2m Inspect the PetClinic application as bound: ```sh -kubectl describe deployment petclinic +kubectl describe deployment spring-petclinic ``` -If the ServiceBinding is working, a new environment variable (SERVICE_BINDINGS_ROOT), volume and volume mount (petclinic-db-projection-binding) is added to the deployment. +If the ServiceBinding is working, a new environment variable (SERVICE_BINDINGS_ROOT), volume and volume mount (binding-49a23274b0590d5057aae1ae621be723716c4dd5) is added to the deployment. The describe output will contain: ```txt @@ -42,11 +42,11 @@ The describe output will contain: SPRING_PROFILES_ACTIVE: mysql SERVICE_BINDINGS_ROOT: /bindings Mounts: - /bindings/petclinic-db from petclinic-db-projection-binding (ro) + /bindings/spring-petclinic-db from binding-49a23274b0590d5057aae1ae621be723716c4dd5 (ro) Volumes: - petclinic-db-projection-binding: + binding-49a23274b0590d5057aae1ae621be723716c4dd5: Type: Secret (a volume populated by a Secret) - SecretName: petclinic-db-projection + SecretName: spring-petclinic-db-projection Optional: false ... ``` @@ -57,7 +57,7 @@ Spring Cloud Bindings is automatically added to Spring applications built by Pak We can see the effect of Spring Cloud Bindings by view the application logs: ```sh -kubectl logs -l app=petclinic -c application --tail 1000 +kubectl logs -l app=spring-petclinic -c application --tail 1000 ``` The logs should contain: @@ -92,7 +92,7 @@ Spring Cloud Bindings Boot Auto-Configuration Enabled To connect to the application, forward a local port into the cluster: ```sh -kubectl port-forward service/petclinic 8080:80 +kubectl port-forward service/spring-petclinic 8080:80 ``` Then open `http://localhost:8080` in a browser. diff --git a/samples/petclinic/application.yaml b/samples/spring-petclinic/application.yaml similarity index 88% rename from samples/petclinic/application.yaml rename to samples/spring-petclinic/application.yaml index 1bb69347..b8b7cc9b 100644 --- a/samples/petclinic/application.yaml +++ b/samples/spring-petclinic/application.yaml @@ -5,30 +5,30 @@ apiVersion: v1 kind: Service metadata: - name: petclinic + name: spring-petclinic spec: ports: - port: 80 targetPort: 8080 selector: - app: petclinic + app: spring-petclinic --- apiVersion: apps/v1 kind: Deployment metadata: - name: petclinic + name: spring-petclinic labels: - app: petclinic + app: spring-petclinic spec: replicas: 1 selector: matchLabels: - app: petclinic + app: spring-petclinic template: metadata: labels: - app: petclinic + app: spring-petclinic spec: containers: - name: application diff --git a/samples/petclinic/service-binding.yaml b/samples/spring-petclinic/service-binding.yaml similarity index 77% rename from samples/petclinic/service-binding.yaml rename to samples/spring-petclinic/service-binding.yaml index 1adc469f..a3c33f70 100644 --- a/samples/petclinic/service-binding.yaml +++ b/samples/spring-petclinic/service-binding.yaml @@ -5,13 +5,13 @@ apiVersion: service.binding/v1alpha2 kind: ServiceBinding metadata: - name: petclinic-db + name: spring-petclinic-db spec: application: apiVersion: apps/v1 kind: Deployment - name: petclinic + name: spring-petclinic service: apiVersion: bindings.labs.vmware.com/v1alpha1 kind: ProvisionedService - name: petclinic-db + name: spring-petclinic-db diff --git a/samples/petclinic/service.yaml b/samples/spring-petclinic/service.yaml similarity index 88% rename from samples/petclinic/service.yaml rename to samples/spring-petclinic/service.yaml index 9968e6f3..37ef2c0e 100644 --- a/samples/petclinic/service.yaml +++ b/samples/spring-petclinic/service.yaml @@ -5,16 +5,16 @@ apiVersion: bindings.labs.vmware.com/v1alpha1 kind: ProvisionedService metadata: - name: petclinic-db + name: spring-petclinic-db spec: binding: - name: petclinic-db + name: spring-petclinic-db --- apiVersion: v1 kind: Secret metadata: - name: petclinic-db + name: spring-petclinic-db type: Opaque stringData: type: mysql @@ -60,17 +60,17 @@ spec: - name: MYSQL_USER valueFrom: secretKeyRef: - name: petclinic-db + name: spring-petclinic-db key: username - name: MYSQL_PASSWORD valueFrom: secretKeyRef: - name: petclinic-db + name: spring-petclinic-db key: password - name: MYSQL_DATABASE valueFrom: secretKeyRef: - name: petclinic-db + name: spring-petclinic-db key: database - name: MYSQL_ROOT_PASSWORD value: root