├── .gitignore ├── Config ├── LICENSE ├── README.md ├── articles-java-jee ├── .dockerignore ├── Dockerfile ├── Dockerfile.java ├── Dockerfile.nojava ├── Dockerfile.quarkus ├── WebContent │ └── META-INF │ │ └── MANIFEST.MF ├── deployment │ ├── IKS-kubernetes.yaml │ ├── istio-quarkus.yaml │ ├── istio.yaml │ ├── kubernetes-openshift.yaml │ ├── kubernetes-quarkus.yaml │ ├── kubernetes.yaml │ └── os4-kubernetes.yaml ├── kubernetes-openshift.yaml ├── liberty │ └── server.xml ├── pom-quarkus.xml ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── ibm │ │ └── cns │ │ ├── JAXRSConfiguration.java │ │ ├── articles │ │ ├── boundary │ │ │ ├── ArticlesResource.java │ │ │ ├── ArticlesService.java │ │ │ ├── InvalidInputParamters.java │ │ │ └── JAXRSConfiguration.java │ │ ├── control │ │ │ ├── ArticleDoesNotExist.java │ │ │ ├── DataAccess.java │ │ │ ├── DataAccessFacade.java │ │ │ ├── InMemoryDataAccess.java │ │ │ ├── JPADataAccess.java │ │ │ ├── MPConfigured.java │ │ │ ├── NoConnectivity.java │ │ │ └── NoDataAccess.java │ │ └── entity │ │ │ ├── Article.java │ │ │ └── InvalidArticle.java │ │ └── health │ │ └── boundary │ │ └── HealthEndpoint.java │ ├── resources │ └── META-INF │ │ └── persistence.xml │ └── webapp │ └── WEB-INF │ └── beans.xml ├── articles-java-spring-boot ├── .gitignore ├── Dockerfile ├── Dockerfile.nojava ├── deployment │ ├── istio.yaml │ └── kubernetes.yaml ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── ibm │ │ └── articles │ │ ├── Article.java │ │ ├── ArticlesApplication.java │ │ ├── ArticlesController.java │ │ ├── ArticlesRepo.java │ │ ├── ArticlesService.java │ │ ├── ClientException.java │ │ └── NotFoundException.java │ └── resources │ ├── application-deployed.properties │ ├── application.properties │ └── local-data.sql ├── authentication-nodejs ├── .env.template ├── Dockerfile ├── deployment │ ├── istio-egress.yaml │ ├── istio.yaml │ └── kubernetes.yaml ├── package.json └── server.js ├── authors-java-jee ├── .dockerignore ├── Dockerfile ├── DockerfileNoBuild ├── DockerfileTekton ├── README.md ├── deployment │ ├── deployment-template.yaml │ ├── deployment.yaml │ ├── service.yaml │ └── tekton │ │ ├── pipeline-account.yaml │ │ ├── pipeline-run-template.yaml │ │ ├── pipeline.yaml │ │ ├── resource-git-cloud-native-starter.yaml │ │ ├── task-deploy-via-kubectl.yaml │ │ └── task-source-to-image.yaml ├── liberty │ └── server.xml ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── ibm │ │ └── authors │ │ ├── Author.java │ │ ├── AuthorsApplication.java │ │ ├── GetAuthor.java │ │ └── HealthEndpoint.java │ └── webapp │ └── WEB-INF │ └── beans.xml ├── authors-java-spring-boot ├── .gitignore ├── Dockerfile.nojava ├── deployment │ ├── istio.yaml │ └── kubernetes.yaml ├── pom.xml └── src │ └── main │ ├── .DS_Store │ ├── java │ └── com │ │ └── ibm │ │ └── authors │ │ ├── Author.java │ │ ├── AuthorController.java │ │ ├── AuthorRepo.java │ │ ├── AuthorService.java │ │ ├── AuthorsSpringBootApplication.java │ │ └── ClientException.java │ ├── liberty │ ├── .DS_Store │ └── config │ │ └── server.xml │ └── resources │ ├── application-deployed.properties │ ├── application.properties │ └── local-data.sql ├── authors-nodejs ├── .dockerignore ├── .gitignore ├── Dockerfile ├── README.md ├── authordata.json ├── authorview.json ├── deployment │ ├── README.md │ ├── deployment-minishift.yaml │ ├── deployment-openshift.yaml │ ├── deployment.yaml.template │ ├── egress-cloudant-trafficrule.yaml │ ├── istio-egress-cloudant.yaml.template │ ├── istio.yaml │ └── kubernetes-openshift.yaml ├── package.json ├── public │ ├── 404.html │ ├── 500.html │ ├── authors.js │ └── swagger.yaml ├── server │ ├── routers │ │ ├── health.js │ │ ├── index.js │ │ ├── public.js │ │ └── swagger.js │ └── server.js └── yarn.lock ├── documentation ├── DemoAuthentication.md ├── DemoCloudant.md ├── DemoConfiguration.md ├── DemoConsumeRESTAPIs.md ├── DemoDistributedLoggingMonitoring.md ├── DemoExposeRESTAPIs.md ├── DemoHealthCheck.md ├── DemoJPA.md ├── DemoJavaImage.md ├── DemoMetrics.md ├── DemoResiliency.md ├── DemoTrafficRouting.md ├── FirstCloudNativeApplicationsJava.pdf ├── IKSDeployment.md ├── MinishiftDeployment.md ├── OS4Cluster.md ├── OS4Deployment.md ├── OS4Requirements.md ├── OS4ServiceMesh.md ├── OneHourTalk.pdf ├── OpenShift-Istio.md ├── OpenShiftIKSDeployment.md ├── SetupIBMCloudAccess.md ├── SetupLocalEnvironment.md └── SetupMinishiftManually.md ├── ibm-scripts ├── README.md ├── check-prerequisites.sh ├── create-app-id.sh ├── create-cloudant.sh └── create-db2.sh ├── iks-scripts ├── README.md ├── check-prerequisites.sh ├── cluster-get-config.sh ├── create-iks-cluster.sh ├── create-registry.sh ├── deploy-articles-java-jee.sh ├── deploy-authors-nodejs.sh ├── deploy-web-api-java-jee-v2.sh ├── deploy-web-api-java-jee.sh ├── deploy-web-app-vuejs.sh └── show-urls.sh ├── images ├── IKS-urls.png ├── appid-identity-providers.png ├── appid-service-credential.png ├── appid-users.png ├── architecture-2.png ├── architecture.png ├── authentication-appid-0.gif ├── authentication-appid-01.gif ├── authentication-appid-02.gif ├── authentication-appid-04.gif ├── authentication-appid-05.gif ├── authentication-appid-06.gif ├── authentication-appid-07.gif ├── authorization-microprofile-admin.png ├── authorization-microprofile-user.png ├── authorization-microprofile.gif ├── cloudant-demo-1.png ├── cloudant-demo-2.png ├── cloudant-demo-3.png ├── cloudant-demo-4.png ├── cloudant-demo-5.png ├── create-operator-subscription.png ├── create-servicemesh-controlplane.png ├── displaytoken.png ├── endpoint-protection-istio-1.png ├── endpoint-protection-istio-2.png ├── endpoint-protection-istio-3.png ├── endpoint-protection-istio-4.png ├── endpoint-protection-istio.gif ├── get-oc-cli.png ├── install-succeeded.png ├── installed-operators.png ├── istio-dashboard.png ├── jaeger-2.png ├── jaeger.png ├── jpa-demo-1.png ├── jpa-demo-2.png ├── jpa-demo-3.png ├── logdna-cloudconsole.png ├── logdna-dashboard.png ├── logdna-logsource.png ├── logdna-no-authors.png ├── logdna-success.png ├── login.gif ├── login.jpeg ├── memberroll1.png ├── memberroll2.png ├── minishift-istio.png ├── minishift-urls.png ├── openapi-microprofile.png ├── openshift-create-cluster.png ├── openshift-create-cluster1.png ├── openshift-daemonset.png ├── openshift-is-kiali.png ├── openshift-istio-op.png ├── openshift-istio.png ├── openshift-jaeger-op.png ├── openshift-kiali-op.png ├── operatorhub-catalog.png ├── os-image-registry.png ├── os4-kiali-cns.png ├── os4-localenv.png ├── prometheus-1.png ├── prometheus-2.png ├── prometheus-3.png ├── slides.png ├── sysdig-cloudconsole.png ├── sysdig-dashboard.png ├── sysdig-source.png ├── traffic-management-1.png ├── traffic-management-2.png ├── traffic-management.gif ├── urls.png ├── web-app-2.png ├── web-app-no-authors.png ├── web-app-traffic-v1.png ├── web-app-traffic-v2.png └── web-app.png ├── istio ├── HTTPS │ ├── IstioIngressHTTPS.md │ ├── istio-ingress-gateway-HTTPS.yaml │ └── istio-ingress-service-web-api-v1-only-HTTPS.yaml ├── fault-articles-500.yaml ├── fault-authors-500-10per.yaml ├── fault-authors-500.yaml ├── istio-ingress-gateway.yaml ├── istio-ingress-service-web-api-v1-only.yaml ├── istio-ingress-service-web-api-v1-v2-80-20.yaml ├── k8s-ingress.md ├── nofault-articles.yaml ├── nofault-authors.yaml ├── prometheus-config.yaml ├── protect-web-api.yaml.template └── template.k8s-ingress.yaml ├── minishift-scripts ├── check-prerequisites.sh ├── delete-all.sh ├── delete-articles-java-jee.sh ├── delete-authors-nodejs.sh ├── delete-istio-ingress.sh ├── delete-web-api-java-jee.sh ├── delete-web-app.sh ├── deploy-articles-java-jee.sh ├── deploy-authors-nodejs.sh ├── deploy-istio-ingress-v1-v2.sh ├── deploy-istio-ingress-v1.sh ├── deploy-web-api-java-jee-v2.sh ├── deploy-web-api-java-jee.sh ├── deploy-web-app.sh ├── no-mtls.yaml ├── setup-minishift.sh ├── setup-project.sh └── show-urls.sh ├── openshift-scripts ├── check-prerequisites.sh ├── create-k8s-ingress.sh ├── delete-articles-java-jee.sh ├── delete-authors-nodejs.sh ├── delete-web-api-java-jee.sh ├── delete-web-app.sh ├── deploy-articles-java-jee.sh ├── deploy-authors-nodejs.sh ├── deploy-web-api-java-jee.sh ├── deploy-web-app.sh ├── es-daemonset.yaml ├── k8s-ingress.yaml ├── k8s-ingress.yaml.template ├── oc-login.sh ├── servicemesh-cr.yaml ├── setup-project.sh └── show-urls.sh ├── os4-scripts ├── check-prerequisites.sh ├── delete-all.sh ├── deploy-articles-java-jee.sh ├── deploy-authors-nodejs.sh ├── deploy-istio-ingress-v1-v2.sh ├── deploy-istio-ingress-v1.sh ├── deploy-web-api-java-jee-v2.sh ├── deploy-web-api-java-jee.sh ├── deploy-web-app-vuejs.sh ├── istio-ingress-gateway.yaml ├── istio-ingress-service-web-api-v1-only.yaml ├── istio-ingress-service-web-api-v1-v2-80-20.yaml ├── login.sh └── show-urls.sh ├── reactive ├── README.md ├── articles-reactive │ ├── .dockerignore │ ├── Dockerfile │ ├── Dockerfile.Hotspot │ ├── Dockerfile.OpenJ9-run-java │ ├── deployment │ │ └── kubernetes.yaml │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── ibm │ │ │ └── articles │ │ │ ├── apis │ │ │ ├── ArticleAsJson.java │ │ │ ├── ArticlesReactiveResource.java │ │ │ ├── ArticlesResource.java │ │ │ ├── HealthEndpoint.java │ │ │ └── NewArticleCreatedListener.java │ │ │ ├── business │ │ │ ├── Article.java │ │ │ ├── ArticleDoesNotExist.java │ │ │ ├── ArticleService.java │ │ │ ├── InvalidArticle.java │ │ │ ├── InvalidInputParameter.java │ │ │ └── NoDataAccess.java │ │ │ └── data │ │ │ ├── DataAccess.java │ │ │ ├── DataAccessExposer.java │ │ │ ├── InMemoryDataAccess.java │ │ │ ├── NoConnectivity.java │ │ │ └── PostgresDataAccess.java │ │ └── resources │ │ └── application.properties.template ├── articles-synch │ ├── Dockerfile │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── ibm │ │ │ └── articles │ │ │ ├── Article.java │ │ │ └── ArticleResource.java │ │ └── resources │ │ ├── application.properties │ │ ├── application.properties.template │ │ └── import.sql ├── documentation │ ├── IKS.md │ ├── LoadTests.md │ ├── OpenShift4.md │ ├── PersistencePerformanceTests.md │ ├── ReactiveMicroservices.pdf │ ├── architecture-small.png │ ├── architecture.png │ ├── architecture.pptx │ ├── demo-1-small.png │ ├── demo-1-video-small.gif │ ├── demo-1-video.gif │ ├── demo-1.png │ ├── demo-2-small.png │ ├── demo-2.png │ ├── images │ │ ├── operatorhub-postgres.png │ │ ├── postgres-op-succeeded.png │ │ ├── postgres-yaml.png │ │ └── subscr-postgres.png │ ├── jmeter.jmx │ ├── load-100x30-threads.png │ ├── load-100x30-v1-graph.png │ ├── load-100x30-v1-summary.png │ ├── load-100x30-v2-graph.png │ ├── load-100x30-v2-summary.png │ ├── load-100x300-threads.png │ ├── load-100x300-v1-errors.png │ ├── load-100x300-v1-graph.png │ ├── load-100x300-v1-summary.png │ ├── load-100x300-v2-graph.png │ ├── load-100x300-v2-summary.png │ ├── load-v1-requests.png │ ├── load-v2-requests.png │ ├── persistence-panache.png │ ├── persistence-reactive.png │ └── persistence.jmx ├── iks-scripts │ ├── check-prerequisites.sh │ ├── cleanup.sh │ ├── cluster-get-config.sh │ ├── create-iks-cluster.sh │ ├── create-messagehub.sh │ ├── create-registry.sh │ ├── delete-articles-reactive.sh │ ├── delete-authors.sh │ ├── deploy-articles-reactive-postgres.sh │ ├── deploy-authors.sh │ ├── deploy-kafka.sh │ ├── deploy-postgres.sh │ ├── deploy-web-api-reactive.sh │ ├── deploy-web-app-reactive.sh │ ├── kafka-cluster.yaml │ ├── postgres.yaml │ └── show-urls.sh ├── os4-scripts │ ├── Dockerfile │ ├── check-prerequisites.sh │ ├── cleanup.sh │ ├── delete-articles-reactive.sh │ ├── delete-authors.sh │ ├── deploy-articles-reactive-postgres-via-oc.sh │ ├── deploy-articles-reactive-postgres.sh │ ├── deploy-authors-via-oc.sh │ ├── deploy-authors.sh │ ├── deploy-example.sh │ ├── deploy-kafka-oc-only.sh │ ├── deploy-kafka.sh │ ├── deploy-postgres-via-oc.sh │ ├── deploy-web-api-reactive-via-oc.sh │ ├── deploy-web-api-reactive.sh │ ├── deploy-web-app-reactive-via-oc.sh │ ├── deploy-web-app-reactive.sh │ ├── login.sh │ ├── postgres-template.yaml │ ├── run-in-cloud-shell-web-api-reactive.sh │ └── show-urls.sh ├── scripts │ ├── check-prerequisites.sh │ ├── delete-all-services.sh │ ├── delete-articles-reactive.sh │ ├── delete-authors.sh │ ├── delete-postgres-database.sh │ ├── delete-web-api-reactive.sh │ ├── deploy-articles-reactive-in-memory.sh │ ├── deploy-articles-reactive-postgres.sh │ ├── deploy-articles-synch-postgres.sh │ ├── deploy-authors.sh │ ├── deploy-kafka.sh │ ├── deploy-postgres-admin.sh │ ├── deploy-postgres-operator-database.sh │ ├── deploy-postgres-operator.sh │ ├── deploy-postgres.sh │ ├── deploy-web-api-reactive.sh │ ├── deploy-web-app-reactive.sh │ ├── download-run-java.sh │ ├── generate-load.sh │ ├── kafka-cluster.yaml │ ├── postgres-cluster.yaml │ ├── run-locally-articles-reactive-in-memory.sh │ ├── run-locally-articles-reactive-postgres.sh │ ├── run-locally-web-api-reactive.sh │ ├── run-locally-web-app-reactive.sh │ ├── show-logs-articles-reactive.sh │ ├── show-logs-web-api-reactive.sh │ ├── show-urls.sh │ └── start-minikube.sh ├── web-api-reactive │ ├── .dockerignore │ ├── Dockerfile │ ├── Dockerfile.hotspot │ ├── deployment │ │ └── kubernetes.yaml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── ibm │ │ │ │ └── webapi │ │ │ │ ├── apis │ │ │ │ ├── ArticleAsJson.java │ │ │ │ ├── ArticlesReactiveResource.java │ │ │ │ ├── ArticlesResource.java │ │ │ │ ├── HealthEndpoint.java │ │ │ │ ├── NewArticleListener.java │ │ │ │ └── NewArticlesStreamResource.java │ │ │ │ ├── business │ │ │ │ ├── Article.java │ │ │ │ ├── Author.java │ │ │ │ ├── CoreArticle.java │ │ │ │ ├── InvalidArticle.java │ │ │ │ ├── NoDataAccess.java │ │ │ │ ├── NonexistentAuthor.java │ │ │ │ └── Service.java │ │ │ │ └── data │ │ │ │ ├── ArticlesDataAccess.java │ │ │ │ ├── ArticlesService.java │ │ │ │ ├── ArticlesServiceReactive.java │ │ │ │ ├── AuthorsDataAccess.java │ │ │ │ ├── AuthorsService.java │ │ │ │ ├── ExceptionMapperArticles.java │ │ │ │ ├── ExceptionMapperAuthors.java │ │ │ │ └── NoConnectivity.java │ │ └── resources │ │ │ └── application.properties.template │ │ └── test │ │ └── java │ │ └── com │ │ └── ibm │ │ └── webapi │ │ └── business │ │ ├── ServiceIT.java │ │ └── TestManagedExecutor.java └── web-app-reactive │ ├── .dockerignore │ ├── Dockerfile │ ├── Dockerfile.os4 │ ├── babel.config.js │ ├── deployment │ └── kubernetes.yaml │ ├── nginx-os4.conf │ ├── nginx.conf │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ └── src │ ├── App.vue │ ├── components │ ├── CreateArticle.vue │ ├── Home.vue │ └── Login.vue │ ├── main.js │ ├── router.js │ └── store.js.template ├── scripts ├── README.md ├── check-prerequisites.sh ├── configure-prometheus.sh ├── create-demo-load.sh ├── delete-all.sh ├── delete-articles-java-jee-quarkus.sh ├── delete-articles-java-jee.sh ├── delete-articles-java-spring-boot.sh ├── delete-authentication-nodejs.sh ├── delete-authors-java-spring-boot.sh ├── delete-authors-nodejs.sh ├── delete-istio-ingress.sh ├── delete-web-api-java-jee.sh ├── delete-web-app-vuejs.sh ├── deploy-articles-java-jee-jpa.sh ├── deploy-articles-java-jee-quarkus.sh ├── deploy-articles-java-jee.sh ├── deploy-articles-java-spring-boot.sh ├── deploy-authentication-nodejs.sh ├── deploy-authors-java-spring-boot.sh ├── deploy-authors-nodejs.sh ├── deploy-istio-ingress-v1-v2.sh ├── deploy-istio-ingress-v1.sh ├── deploy-web-api-java-jee-v2.sh ├── deploy-web-api-java-jee.sh ├── deploy-web-app-vuejs-authentication.sh ├── deploy-web-app-vuejs.sh ├── display-logs-articles.sh ├── display-logs-authors.sh ├── display-logs-web-api.sh ├── get-url-authors-nodejs.sh ├── open-monitoring-grafana.sh ├── open-monitoring-jaeger.sh ├── open-monitoring-kiali.sh ├── open-monitoring-prometheus.sh ├── open-monitoring.sh └── show-urls.sh ├── security ├── IKS │ ├── authorization-w-rule.yaml │ ├── authorization.yaml │ ├── configmap.yaml │ ├── iks-rm-nlb-ips.sh │ ├── istio-ingress-tls-kiali.yaml │ ├── istio-ingress-tls.yaml │ ├── istio-setup-ingress-gateway.sh │ ├── istio-setup-telemetry.sh │ ├── istio-setup.sh │ ├── istio-tele-services.yaml │ ├── istio.yaml │ ├── keycloak-create-realm.sh │ ├── keycloak.yaml │ ├── mtls.yaml │ ├── oc-get-admin-password.sh │ ├── oc-get-keycloak-urls.sh │ └── quarkus-realm.json ├── KEYCLOAK-SETUP.md ├── KEYCLOUK_SETUP-locally.md ├── README.md ├── articles-secure │ ├── .dockerignore │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── Dockerfile │ ├── deployment │ │ ├── articles-sa.yaml │ │ └── articles.yaml │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile.jvm │ │ └── Dockerfile.native │ │ ├── java │ │ └── com │ │ │ └── ibm │ │ │ └── webapi │ │ │ ├── Article.java │ │ │ └── ArticleResource.java │ │ └── resources │ │ └── application.properties ├── images │ ├── application-sample.gif │ ├── architecture-local.png │ ├── keycloak-config-1.png │ ├── keycloak-config-2.png │ ├── keycloak-config-3.png │ ├── keycloak-config-4.png │ ├── keycloak-content.png │ ├── keycloak-setup-01.png │ ├── keycloak-setup-02.png │ ├── keycloak-setup-03.png │ ├── keycloak-user.png │ └── keycloak-users.png ├── web-api-secure │ ├── .dockerignore │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── Dockerfile │ ├── deployment │ │ ├── web-api-sa.yaml │ │ └── web-api.yaml │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile.jvm │ │ └── Dockerfile.native │ │ ├── java │ │ └── com │ │ │ └── ibm │ │ │ └── webapi │ │ │ ├── Article.java │ │ │ ├── ArticleResource.java │ │ │ ├── ArticlesDataAccess.java │ │ │ ├── ArticlesService.java │ │ │ ├── CoreArticle.java │ │ │ ├── ExceptionMapperArticles.java │ │ │ ├── InvalidArticle.java │ │ │ ├── NoConnectivity.java │ │ │ ├── NoDataAccess.java │ │ │ └── UserResource.java │ │ └── resources │ │ ├── META-INF │ │ └── resources │ │ │ └── index.html │ │ └── application.properties └── web-app │ ├── Dockerfile │ ├── Dockerfile.os4 │ ├── babel.config.js │ ├── deployment │ └── web-app.yaml │ ├── nginx-os4.conf │ ├── nginx.conf │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ └── src │ ├── App.vue │ ├── components │ └── Home.vue │ ├── main.js │ ├── router.js │ ├── store.js │ └── store.js.template ├── template.local.env ├── web-api-java-jee ├── .dockerignore ├── Dockerfile ├── Dockerfile.java ├── Dockerfile.nojava ├── deployment │ ├── istio-ingress.yaml │ ├── istio-service-v1.yaml │ ├── istio-service-v2.yaml │ ├── kubernetes-deployment-v1-minishift.yaml │ ├── kubernetes-deployment-v1-openshift.yaml │ ├── kubernetes-deployment-v1.yaml │ ├── kubernetes-deployment-v2.yaml │ ├── kubernetes-service.yaml │ ├── os4-kubernetes-deployment-v1.yaml │ └── os4-kubernetes-deployment-v2.yaml ├── key.jks ├── liberty │ └── server.xml ├── pom.xml ├── src │ └── main │ │ └── java │ │ └── com │ │ └── ibm │ │ └── webapi │ │ ├── apis │ │ ├── ArticleAsJson.java │ │ ├── CorsFilter.java │ │ ├── CreateNewArticle.java │ │ ├── GetArticles.java │ │ ├── HealthEndpoint.java │ │ ├── JAXRSConfiguration.java │ │ ├── Manage.java │ │ └── ManageResponse.java │ │ ├── business │ │ ├── Article.java │ │ ├── Author.java │ │ ├── CoreArticle.java │ │ ├── InvalidArticle.java │ │ ├── NoDataAccess.java │ │ ├── NonexistentAuthor.java │ │ └── Service.java │ │ └── data │ │ ├── ArticlesDataAccess.java │ │ ├── ArticlesService.java │ │ ├── ArticlesServiceDataAccess.java │ │ ├── AuthorsDataAccess.java │ │ ├── AuthorsService.java │ │ ├── AuthorsServiceDataAccess.java │ │ ├── DataAccessManager.java │ │ ├── ExceptionMapperArticles.java │ │ ├── ExceptionMapperAuthors.java │ │ └── NoConnectivity.java └── us-southappidcloudibmcom.crt ├── web-app-vuejs ├── .dockerignore ├── Dockerfile ├── Dockerfile.nonroot ├── Dockerfile.os4 ├── babel.config.js ├── deployment │ ├── istio.yaml │ ├── kubernetes-minishift.yaml │ ├── kubernetes-openshift.yaml │ ├── kubernetes.yaml │ └── os4-kubernetes.yaml ├── nginx-os4.conf ├── nginx.conf ├── package.json ├── public │ ├── favicon.ico │ └── index.html └── src │ ├── App.vue │ ├── components │ ├── CreateArticle.vue │ ├── Home.vue │ └── Login.vue │ ├── main.js │ ├── router.js │ ├── store.js │ └── store.js.template ├── workshop-one-service ├── README.md └── images │ └── cnsl1.png └── workshop ├── 00-prerequisites-windows-10.md ├── 00-prerequisites.md ├── 01-introduction.md ├── 02-container.md ├── 03-rest-api.md ├── 04-traffic-management.md ├── 05-resiliency.md ├── 06-java-development.md ├── README.md ├── Tekton.Dockerfile ├── Tools.Buildah.Dockerfile ├── Tools.Dockerfile.Outdated ├── hands-on-only.md └── images ├── architecture-authors.gif ├── architecture.png ├── architecture.pptx ├── authors-java-classdiagram-01.png ├── authors-java-classdiagram-02.png ├── authors-java-container-image.png ├── authors-java-container-overview.png ├── authors-java-health.png ├── authors-java-kubernetes-deployment-overview.png ├── authors-java-openapi-explorer.png ├── authors-java-service-pod-container.png ├── classoverview-articles.jpg ├── classoverview-webapi.jpg ├── cns-basic-setup-01.png ├── cns-container-articels-service-03.png ├── cns-container-deployment-01.png ├── cns-container-deployment-02.png ├── cns-container-web-api-v1-04.png ├── cns-container-web-app-05.png ├── cns-introduction-01.png ├── dockerhub.png ├── docs.gif ├── email.png ├── ibm-cloud-cluster-02.png ├── ibm-cloud-cluster-access.png ├── ibm-cloud-cluster.png ├── ibm-cloud-key.png ├── ibm-cloud-pods.png ├── ibm-cloud-registry-container.png ├── ibm-cloud-registry.png ├── ibm-cloud-services.png ├── istio-installation-01.png ├── istio-installation-02.png ├── microprofile-starter.gif ├── microprofiles.png ├── registration.png ├── resliency-01.png ├── resliency-02.png ├── rest-api-classdiagram.png ├── rest-api-open-api.gif ├── rest-api-sequencediagram.png ├── traffic-new-architecture.gif ├── traffic-routing-deployment01.png ├── traffic-routing-deployment02.png ├── traffic-routing-deployment03.png ├── traffic-routing-deployment04.png ├── traffic-routing-deployment04.svg ├── traffic-routing-deployment05.png ├── traffic-routing-deployment06.png ├── traffic-routing-deployment07.gif ├── traffic-routing-deployment08.png ├── traffic-routing-deployment09.png ├── traffic-routing-deployment10.png ├── traffic-routing-deployment11.png ├── traffic-routing-deployment12.png ├── traffic-routing-deployment13.png ├── traffic-routing-deployment14.png ├── traffic-routing-deployment15.gif ├── traffic-routing.gif ├── windows-setup-01.png └── windows-setup-02.png /Config: -------------------------------------------------------------------------------- 1 | 2019-12-17 11:28:27 - file local.env found 2 | -------------------------------------------------------------------------------- /articles-java-jee/.dockerignore: -------------------------------------------------------------------------------- 1 | .apt_generated 2 | .apt_generated_tests 3 | .settings 4 | deployment 5 | target/articles 6 | target/classes 7 | target/generated-sources 8 | target/lib 9 | target/maven-archiver 10 | target/maven-status 11 | target/reports 12 | target/test-classes 13 | target/transformed-classes 14 | target/wiring-classes 15 | target/wiring-devmode -------------------------------------------------------------------------------- /articles-java-jee/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM open-liberty:19.0.0.9-kernel-java11 2 | # OpenJ9 0.14.0 3 | # OpenJDK 11.0.3+7 4 | # Open Liberty 19.0.0.5 5 | 6 | COPY liberty-opentracing-zipkintracer /opt/ol/wlp/usr/ 7 | 8 | COPY liberty/server.xml /config/ 9 | 10 | ADD target/articles.war /config/dropins/ 11 | 12 | ADD target/jcc-11.1.4.4.jar /opt/ol/wlp/usr/shared/resources/jcc-11.1.4.4.jar 13 | 14 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 15 | # https://github.com/WASdev/ci.docker 16 | RUN configure.sh 17 | 18 | EXPOSE 8080 -------------------------------------------------------------------------------- /articles-java-jee/Dockerfile.java: -------------------------------------------------------------------------------- 1 | FROM open-liberty:19.0.0.9-kernel-java11 2 | # OpenJ9 0.14.0 3 | # OpenJDK 11.0.3+7 4 | # Open Liberty 19.0.0.5 5 | 6 | COPY liberty-opentracing-zipkintracer /opt/ol/wlp/usr/ 7 | 8 | COPY liberty/server.xml /config/ 9 | 10 | ADD target/articles.war /config/dropins/ 11 | 12 | ADD target/jcc-11.1.4.4.jar /opt/ol/wlp/usr/shared/resources/jcc-11.1.4.4.jar 13 | 14 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 15 | # https://github.com/WASdev/ci.docker 16 | RUN configure.sh 17 | 18 | EXPOSE 8080 -------------------------------------------------------------------------------- /articles-java-jee/Dockerfile.nojava: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY pom.xml /usr/src/app 5 | WORKDIR /usr/src/app 6 | RUN mvn package 7 | 8 | 9 | FROM open-liberty:19.0.0.9-kernel-java11 10 | 11 | COPY liberty-opentracing-zipkintracer /opt/ol/wlp/usr/ 12 | 13 | COPY liberty/server.xml /config/ 14 | 15 | COPY --from=BUILD /usr/src/app/target/articles.war /config/dropins/ 16 | 17 | COPY --from=BUILD /usr/src/app/target/jcc-11.1.4.4.jar /opt/ol/wlp/usr/shared/resources/ 18 | 19 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 20 | # https://github.com/WASdev/ci.docker 21 | RUN configure.sh 22 | 23 | EXPOSE 8080 -------------------------------------------------------------------------------- /articles-java-jee/Dockerfile.quarkus: -------------------------------------------------------------------------------- 1 | FROM registry.fedoraproject.org/fedora-minimal 2 | WORKDIR /work/ 3 | COPY target/*-runner /work/application 4 | RUN chmod 775 /work 5 | EXPOSE 8080 6 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] 7 | -------------------------------------------------------------------------------- /articles-java-jee/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /articles-java-jee/deployment/istio-quarkus.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: articles-quarkus 5 | spec: 6 | hosts: 7 | - articles-quarkus 8 | http: 9 | - route: 10 | - destination: 11 | host: articles-quarkus 12 | subset: v1 13 | --- 14 | 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: DestinationRule 17 | metadata: 18 | name: articles-quarkus 19 | spec: 20 | host: articles-quarkus 21 | subsets: 22 | - name: v1 23 | labels: 24 | version: v1 25 | --- 26 | -------------------------------------------------------------------------------- /articles-java-jee/deployment/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: articles 5 | spec: 6 | hosts: 7 | - articles 8 | http: 9 | - route: 10 | - destination: 11 | host: articles 12 | subset: v1 13 | --- 14 | 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: DestinationRule 17 | metadata: 18 | name: articles 19 | spec: 20 | host: articles 21 | subsets: 22 | - name: v1 23 | labels: 24 | version: v1 25 | --- 26 | -------------------------------------------------------------------------------- /articles-java-jee/kubernetes-openshift.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/articles-java-jee/kubernetes-openshift.yaml -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/JAXRSConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("v1") 7 | public class JAXRSConfiguration extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/boundary/InvalidInputParamters.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.boundary; 2 | 3 | import javax.ws.rs.WebApplicationException; 4 | import javax.ws.rs.core.Response; 5 | 6 | public class InvalidInputParamters extends WebApplicationException { 7 | 8 | public InvalidInputParamters(String message) { 9 | super(Response.status(400).header("info", message).build()); 10 | } 11 | } -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/boundary/JAXRSConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.boundary; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JAXRSConfiguration extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/control/ArticleDoesNotExist.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.control; 2 | 3 | import javax.ws.rs.WebApplicationException; 4 | import javax.ws.rs.core.Response; 5 | 6 | public class ArticleDoesNotExist extends WebApplicationException { 7 | 8 | public ArticleDoesNotExist(String message) { 9 | super(Response.status(204).header("info", "message").build()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/control/DataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.control; 2 | 3 | import com.ibm.cns.articles.entity.Article; 4 | import java.util.List; 5 | 6 | public interface DataAccess { 7 | 8 | public Article addArticle(Article article); 9 | 10 | public Article getArticle(String id); 11 | 12 | public List
getArticles(); 13 | } 14 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/control/DataAccessFacade.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.control; 2 | 3 | import org.eclipse.microprofile.config.inject.ConfigProperty; 4 | 5 | import javax.enterprise.context.ApplicationScoped; 6 | import javax.enterprise.inject.Produces; 7 | import javax.inject.Inject; 8 | 9 | @ApplicationScoped 10 | public class DataAccessFacade { 11 | 12 | @Inject 13 | @ConfigProperty(name = "inmemory", defaultValue = "true") 14 | private boolean inMemory; 15 | 16 | @Inject 17 | InMemoryDataAccess inMemoryDataAccess; 18 | 19 | @Inject 20 | JPADataAccess jPADataAccess; 21 | 22 | @Produces 23 | @MPConfigured 24 | public DataAccess getDataAccess() { 25 | if (inMemory) 26 | return inMemoryDataAccess; 27 | return jPADataAccess; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/control/MPConfigured.java: -------------------------------------------------------------------------------- 1 | 2 | package com.ibm.cns.articles.control; 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | import javax.inject.Qualifier; 9 | 10 | /** 11 | * 12 | * @author airhacks.com 13 | */ 14 | @Qualifier 15 | @Target({ElementType.METHOD, ElementType.FIELD}) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | public @interface MPConfigured { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/control/NoConnectivity.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.control; 2 | 3 | import javax.ws.rs.WebApplicationException; 4 | import javax.ws.rs.core.Response; 5 | 6 | public class NoConnectivity extends WebApplicationException { 7 | 8 | public NoConnectivity(String message) { 9 | super(Response.status(500).header("info", message).build()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/control/NoDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.control; 2 | 3 | public class NoDataAccess extends Exception { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoDataAccess() { 8 | } 9 | 10 | public NoDataAccess(String message) { 11 | super(message); 12 | } 13 | 14 | public NoDataAccess(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/articles/entity/InvalidArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.articles.entity; 2 | 3 | public class InvalidArticle extends Exception { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidArticle() { 8 | } 9 | 10 | public InvalidArticle(String message) { 11 | super(message); 12 | } 13 | } -------------------------------------------------------------------------------- /articles-java-jee/src/main/java/com/ibm/cns/health/boundary/HealthEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.ibm.cns.health.boundary; 2 | 3 | import org.eclipse.microprofile.health.Readiness; 4 | import org.eclipse.microprofile.health.HealthCheck; 5 | import org.eclipse.microprofile.health.HealthCheckResponse; 6 | 7 | import javax.enterprise.context.ApplicationScoped; 8 | 9 | @Readiness 10 | @ApplicationScoped 11 | public class HealthEndpoint implements HealthCheck { 12 | 13 | @Override 14 | public HealthCheckResponse call() { 15 | return HealthCheckResponse.named("articles").withData("articles", "ok").up().build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | jdbc/articlejpadatasource 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /articles-java-jee/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /articles-java-spring-boot/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /articles-java-spring-boot/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/openjdk11-openj9:latest 2 | 3 | COPY articles.jar / 4 | 5 | ENTRYPOINT ["java", "-jar", "articles.jar" ] -------------------------------------------------------------------------------- /articles-java-spring-boot/Dockerfile.nojava: -------------------------------------------------------------------------------- 1 | FROM maven:3.6-jdk-11 as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY pom.xml /usr/src/app 5 | WORKDIR /usr/src/app 6 | RUN mvn package 7 | 8 | FROM adoptopenjdk:11-jre-openj9 9 | 10 | COPY --from=BUILD /usr/src/app/target/articles.jar / 11 | 12 | COPY --from=BUILD /usr/src/app/target/jcc-11.1.4.4.jar / 13 | 14 | ENTRYPOINT ["java", "-jar", "articles.jar" ] -------------------------------------------------------------------------------- /articles-java-spring-boot/deployment/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: articles 5 | spec: 6 | hosts: 7 | - articles 8 | http: 9 | - route: 10 | - destination: 11 | host: articles 12 | subset: v1 13 | --- 14 | 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: DestinationRule 17 | metadata: 18 | name: articles 19 | spec: 20 | host: articles 21 | subsets: 22 | - name: v1 23 | labels: 24 | version: v1 25 | --- 26 | -------------------------------------------------------------------------------- /articles-java-spring-boot/src/main/java/com/ibm/articles/ArticlesRepo.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles; 2 | 3 | import org.springframework.data.repository.PagingAndSortingRepository; 4 | 5 | public interface ArticlesRepo extends PagingAndSortingRepository { 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /articles-java-spring-boot/src/main/java/com/ibm/articles/ClientException.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles; 2 | 3 | public class ClientException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public ClientException() { 8 | 9 | } 10 | 11 | public ClientException(String message) { 12 | super(message); 13 | 14 | } 15 | 16 | public ClientException(Throwable cause) { 17 | super(cause); 18 | 19 | } 20 | 21 | public ClientException(String message, Throwable cause) { 22 | super(message, cause); 23 | 24 | } 25 | 26 | public ClientException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 27 | super(message, cause, enableSuppression, writableStackTrace); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /articles-java-spring-boot/src/main/resources/application-deployed.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:db2://DB2-SERVER:50000/BLUDB 2 | spring.datasource.driverClassName=com.ibm.db2.jcc.DB2Driver 3 | spring.datasource.username=DB2-USER 4 | spring.datasource.password=DB2-PASSWORD 5 | spring.jpa.database-platform=org.hibernate.dialect.DB2Dialect -------------------------------------------------------------------------------- /articles-java-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | management.endpoints.web.base-path=/ 3 | spring.datasource.url=jdbc:h2:mem:articlesdb 4 | spring.datasource.driverClassName=org.h2.Driver 5 | spring.datasource.username=sa 6 | spring.datasource.password=password 7 | spring.datasource.data=classpath:local-data.sql 8 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -------------------------------------------------------------------------------- /articles-java-spring-boot/src/main/resources/local-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO Article (article_id, article_author, creation_date, article_title, article_url) values (nextval('articles_generator'), 'Billy Korando','07-07-2019','Cloud Native Spring Boot','https://ibm.com'); 2 | INSERT INTO Article (article_id, article_author, creation_date, article_title, article_url) values (nextval('articles_generator'), 'Niklas Heidloff','05-07-2012','The Avengers','https://ibm.com'); -------------------------------------------------------------------------------- /authentication-nodejs/.env.template: -------------------------------------------------------------------------------- 1 | APPID_ISSUER=https://us-south.appid.cloud.ibm.com/oauth/v4/8f1d603d-2a03-4fa5-8d3b-2218c200929e 2 | APPID_OPENID_CONFIG=https://us-south.appid.cloud.ibm.com/oauth/v4/8f1d603d-2a03-4fa5-8d3b-2218c200929e/.well-known/openid-configuration 3 | APPID_AUTHORIZATION_ENDPOINT=https://us-south.appid.cloud.ibm.com/oauth/v4/8f1d603d-2a03-4fa5-8d3b-2218c200929e/authorization 4 | APPID_TOKEN_ENDPOINT=https://us-south.appid.cloud.ibm.com/oauth/v4/8f1d603d-2a03-4fa5-8d3b-2218c200929e/token 5 | APPID_USERINFO_ENDPOINT=https://us-south.appid.cloud.ibm.com/oauth/v4/8f1d603d-2a03-4fa5-8d3b-2218c200929e/userinfo 6 | APPID_JWKS_URI=https://us-south.appid.cloud.ibm.com/oauth/v4/8f1d603d-2a03-4fa5-8d3b-2218c200929e/publickeys 7 | APPID_CLIENTID=xxx 8 | APPID_SECRET=xxx 9 | REDIRECT_URL_CALLBACK=http://localhost:3000/callback 10 | REDIRECT_URL_WEB_APP=http://localhost:8080/loginwithtoken -------------------------------------------------------------------------------- /authentication-nodejs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8-alpine 2 | 3 | WORKDIR /usr/src/app 4 | COPY package.json ./ 5 | COPY server.js ./ 6 | COPY .env ./ 7 | 8 | RUN npm install 9 | 10 | EXPOSE 3000 11 | CMD ["npm", "start"] -------------------------------------------------------------------------------- /authentication-nodejs/deployment/istio-egress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: ServiceEntry 3 | metadata: 4 | name: authentication-egress 5 | spec: 6 | hosts: 7 | - us-south.appid.cloud.ibm.com 8 | ports: 9 | - number: 443 10 | name: https 11 | protocol: HTTPS 12 | resolution: DNS 13 | location: MESH_EXTERNAL 14 | --- 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: VirtualService 17 | metadata: 18 | name: authentication-egress 19 | spec: 20 | hosts: 21 | - us-south.appid.cloud.ibm.com 22 | tls: 23 | - match: 24 | - port: 443 25 | sni_hosts: 26 | - us-south.appid.cloud.ibm.com 27 | route: 28 | - destination: 29 | host: us-south.appid.cloud.ibm.com 30 | port: 31 | number: 443 32 | weight: 100 -------------------------------------------------------------------------------- /authentication-nodejs/deployment/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: authentication 5 | spec: 6 | hosts: 7 | - authentication 8 | http: 9 | - route: 10 | - destination: 11 | host: authentication 12 | subset: v1 13 | --- 14 | 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: DestinationRule 17 | metadata: 18 | name: authentication 19 | spec: 20 | host: authentication 21 | subsets: 22 | - name: v1 23 | labels: 24 | version: v1 25 | --- 26 | -------------------------------------------------------------------------------- /authentication-nodejs/deployment/kubernetes.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: authentication 5 | labels: 6 | app: authentication 7 | spec: 8 | selector: 9 | app: authentication 10 | ports: 11 | - port: 3000 12 | name: http 13 | type: NodePort 14 | --- 15 | 16 | kind: Deployment 17 | apiVersion: apps/v1 18 | metadata: 19 | name: authentication 20 | spec: 21 | selector: 22 | matchLabels: 23 | app: authentication 24 | replicas: 1 25 | template: 26 | metadata: 27 | labels: 28 | app: authentication 29 | version: v1 30 | spec: 31 | containers: 32 | - name: authentication 33 | image: authentication:1 34 | ports: 35 | - containerPort: 3000 36 | restartPolicy: Always 37 | --- 38 | -------------------------------------------------------------------------------- /authentication-nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "auth-nodejs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "start": "node server.js" 8 | }, 9 | "author": "", 10 | "license": "", 11 | "dependencies": { 12 | "dotenv": "7.0.0", 13 | "express": "4.16.4", 14 | "express-session": "1.15.6", 15 | "openid-client": "2.4.5" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /authors-java-jee/.dockerignore: -------------------------------------------------------------------------------- 1 | .apt_generated 2 | .apt_generated_tests 3 | .settings 4 | deployment 5 | target/authors 6 | target/classes 7 | target/generated-sources 8 | target/lib 9 | target/maven-archiver 10 | target/maven-status 11 | target/reports 12 | target/test-classes 13 | target/transformed-classes 14 | target/wiring-classes 15 | target/wiring-devmode -------------------------------------------------------------------------------- /authors-java-jee/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM maven:3.5-jdk-8 2 | 3 | COPY src /usr/src/app/src 4 | COPY pom.xml /usr/src/app 5 | RUN mvn -f /usr/src/app/pom.xml clean package 6 | 7 | 8 | FROM open-liberty:21.0.0.12-full-java11-openj9 9 | 10 | COPY liberty/server.xml /config/ 11 | 12 | COPY --from=0 /usr/src/app/target/authors.war /config/apps/ 13 | 14 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 15 | # https://github.com/WASdev/ci.docker 16 | RUN configure.sh 17 | 18 | EXPOSE 3000 -------------------------------------------------------------------------------- /authors-java-jee/DockerfileNoBuild: -------------------------------------------------------------------------------- 1 | FROM open-liberty:21.0.0.12-full-java11-openj9 2 | 3 | COPY liberty/server.xml /config/ 4 | 5 | COPY target/authors.war /config/apps/ 6 | 7 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 8 | # https://github.com/WASdev/ci.docker 9 | RUN configure.sh 10 | 11 | EXPOSE 3000 -------------------------------------------------------------------------------- /authors-java-jee/DockerfileTekton: -------------------------------------------------------------------------------- 1 | FROM maven:3.5-jdk-8 2 | 3 | COPY src /usr/src/app/src 4 | COPY pom.xml /usr/src/app 5 | RUN mvn -f /usr/src/app/pom.xml clean package 6 | 7 | 8 | FROM open-liberty:21.0.0.12-full-java11-openj9 9 | 10 | RUN chmod 777 /config/ 11 | 12 | COPY liberty/server.xml /config/ 13 | 14 | COPY --from=0 /usr/src/app/target/authors.war /config/apps/ 15 | 16 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 17 | # https://github.com/WASdev/ci.docker 18 | RUN configure.sh 19 | 20 | EXPOSE 3000 -------------------------------------------------------------------------------- /authors-java-jee/deployment/service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: authors 5 | labels: 6 | app: authors 7 | spec: 8 | selector: 9 | app: authors 10 | ports: 11 | - port: 3000 12 | name: http 13 | type: NodePort 14 | --- 15 | -------------------------------------------------------------------------------- /authors-java-jee/deployment/tekton/pipeline-run-template.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1alpha1 2 | kind: PipelineRun 3 | metadata: 4 | generateName: pipeline-run-cns-authors- 5 | spec: 6 | pipelineRef: 7 | name: pipeline 8 | resources: 9 | - name: git-source 10 | resourceRef: 11 | name: resource-git-cloud-native-starter 12 | params: 13 | - name: pathToContext 14 | value: "authors-java-jee" 15 | - name: pathToDeploymentYamlFile 16 | value: "deployment/deployment.yaml" 17 | - name: pathToServiceYamlFile 18 | value: "deployment/service.yaml" 19 | - name: imageUrl 20 | value: //authors 21 | - name: imageTag 22 | value: "1" 23 | - name: pathToDockerFile 24 | value: "DockerfileTekton" 25 | trigger: 26 | type: manual 27 | serviceAccount: pipeline-account -------------------------------------------------------------------------------- /authors-java-jee/deployment/tekton/resource-git-cloud-native-starter.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1alpha1 2 | kind: PipelineResource 3 | metadata: 4 | name: resource-git-cloud-native-starter 5 | spec: 6 | type: git 7 | params: 8 | - name: revision 9 | value: master 10 | - name: url 11 | value: https://github.com/IBM/cloud-native-starter -------------------------------------------------------------------------------- /authors-java-jee/liberty/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | microProfile-4.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /authors-java-jee/src/main/java/com/ibm/authors/Author.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | public class Author { 4 | 5 | public String name; 6 | public String twitter; 7 | public String blog; 8 | 9 | } -------------------------------------------------------------------------------- /authors-java-jee/src/main/java/com/ibm/authors/AuthorsApplication.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | import javax.ws.rs.core.Application; 4 | import javax.ws.rs.ApplicationPath; 5 | 6 | @ApplicationPath("v1") 7 | public class AuthorsApplication extends Application { 8 | } -------------------------------------------------------------------------------- /authors-java-jee/src/main/java/com/ibm/authors/HealthEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | import org.eclipse.microprofile.health.Readiness; 4 | import org.eclipse.microprofile.health.HealthCheck; 5 | import org.eclipse.microprofile.health.HealthCheckResponse; 6 | 7 | @Readiness 8 | public class HealthEndpoint implements HealthCheck { 9 | 10 | @Override 11 | public HealthCheckResponse call() { 12 | return HealthCheckResponse.named("authors").withData("authors", "ok").up().build(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /authors-java-jee/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /authors-java-spring-boot/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /authors-java-spring-boot/deployment/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: authors 5 | spec: 6 | hosts: 7 | - authors 8 | http: 9 | - route: 10 | - destination: 11 | host: authors 12 | subset: v1 13 | --- 14 | 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: DestinationRule 17 | metadata: 18 | name: authors 19 | spec: 20 | host: authors 21 | subsets: 22 | - name: v1 23 | labels: 24 | version: v1 25 | --- 26 | -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/authors-java-spring-boot/src/main/.DS_Store -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/java/com/ibm/authors/AuthorRepo.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | public interface AuthorRepo extends CrudRepository { 8 | 9 | public Optional findByName(String name); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/java/com/ibm/authors/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service 8 | public class AuthorService { 9 | 10 | private AuthorRepo repo; 11 | 12 | public AuthorService(AuthorRepo repo) { 13 | this.repo = repo; 14 | } 15 | 16 | public Author getAuthorByName(String name) { 17 | Optional author = repo.findByName(name); 18 | 19 | if (author.isPresent()) { 20 | return author.get(); 21 | } else { 22 | throw new ClientException("Author Not Found"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/java/com/ibm/authors/AuthorsSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 7 | 8 | @SpringBootApplication 9 | @EnableSwagger2 10 | public class AuthorsSpringBootApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(AuthorsSpringBootApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/java/com/ibm/authors/ClientException.java: -------------------------------------------------------------------------------- 1 | package com.ibm.authors; 2 | 3 | public class ClientException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public ClientException() { 8 | } 9 | 10 | public ClientException(String message) { 11 | super(message); 12 | } 13 | 14 | public ClientException(Throwable cause) { 15 | super(cause); 16 | } 17 | 18 | public ClientException(String message, Throwable cause) { 19 | super(message, cause); 20 | } 21 | 22 | public ClientException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 23 | super(message, cause, enableSuppression, writableStackTrace); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/liberty/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/authors-java-spring-boot/src/main/liberty/.DS_Store -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/liberty/config/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | servlet-4.0 6 | springBoot-2.0 7 | 8 | 9 | 10 | 12 | -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/resources/application-deployed.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:db2://DB2-SERVER:50000/BLUDB 2 | spring.datasource.driverClassName=com.ibm.db2.jcc.DB2Driver 3 | spring.datasource.username=DB2-USER 4 | spring.datasource.password=DB2-PASSWORD 5 | spring.jpa.database-platform=org.hibernate.dialect.DB2Dialect -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:authorsdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | spring.datasource.data=classpath:local-data.sql 7 | management.endpoints.web.base-path=/ -------------------------------------------------------------------------------- /authors-java-spring-boot/src/main/resources/local-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO AUTHOR (name, twitter, blog) VALUES ('Billy Korando','@BillyKorando','https://billykorando.com'); 2 | INSERT INTO AUTHOR (name, twitter, blog) VALUES ('Niklas Heidloff','@nheidloff','http://heidloff.net/'); -------------------------------------------------------------------------------- /authors-nodejs/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | node_modules_linux/ 3 | package.1.json 4 | yarn* 5 | swagger-ui/ -------------------------------------------------------------------------------- /authors-nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | node_modules_linux 3 | yarn*.log 4 | yarn.lock 5 | package.1.json 6 | public/authors.js.CLOUDANT -------------------------------------------------------------------------------- /authors-nodejs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8-alpine 2 | 3 | # Create app directory 4 | WORKDIR /usr/src/app 5 | 6 | # Install app dependencies 7 | COPY package*.json ./ 8 | RUN npm install 9 | 10 | # Bundle app source 11 | COPY . . 12 | 13 | # Set permissions 14 | RUN chmod -R 777 /usr/src/app 15 | 16 | # Server listens on 17 | EXPOSE 3000 18 | 19 | CMD ["npm", "start"] 20 | -------------------------------------------------------------------------------- /authors-nodejs/authordata.json: -------------------------------------------------------------------------------- 1 | {"docs": [ 2 | {"name":"Niklas Heidloff","twitter":"@nheidloff","blog":"http://heidloff.net"}, 3 | {"name":"Miriam Oglesby","twitter":"@Jessieevaline","blog":"https://developer.ibm.com/blogs/"}, 4 | {"name":"Thomas Südbröcker","twitter":"@tsuedbroecker","blog":"https://suedbroecker.net"}, 5 | {"name":"Harald Uebele","twitter":"@harald_u","blog":"https://haralduebele.github.io"} 6 | ] 7 | } -------------------------------------------------------------------------------- /authors-nodejs/authorview.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "_design/authorview", 3 | "views": { 4 | "data_by_name": { 5 | "map": "function (doc) {\n emit(doc.name, doc);\n}" 6 | } 7 | }, 8 | "language": "javascript" 9 | } -------------------------------------------------------------------------------- /authors-nodejs/deployment/README.md: -------------------------------------------------------------------------------- 1 | * deployment.yaml 2 | 3 | K8s deployment and service, you need to specify the URL for your specific Cloudant instance 4 | 5 | Without automatic istio envoy injection: 6 | `kubectl apply -f deployment.yaml` 7 | 8 | 9 | * istio-egress-cloudant.yaml 10 | 11 | Istio ServiceEntry, Gateway and DestinatonRule to access the Cloudant DB on IBM Cloud using https, you need to specify the host-part of the Cloudant URL (without user:password@) in 4 different places. 12 | 13 | `istioctl create -f istio-egress-cloudant.yaml` 14 | 15 | 16 | -------------------------------------------------------------------------------- /authors-nodejs/deployment/egress-cloudant-trafficrule.yaml: -------------------------------------------------------------------------------- 1 | 2 | apiVersion: networking.istio.io/v1alpha3 3 | kind: DestinationRule 4 | metadata: 5 | name: egressgateway-for-cloudant 6 | spec: 7 | host: istio-egressgateway.istio-system.svc.cluster.local 8 | trafficPolicy: 9 | connectionPool: 10 | tcp: 11 | maxConnections: 1 12 | http: 13 | http1MaxPendingRequests: 1 14 | maxRequestsPerConnection: 1 15 | subsets: 16 | - name: cloudant 17 | --- 18 | -------------------------------------------------------------------------------- /authors-nodejs/deployment/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: authors 5 | spec: 6 | hosts: 7 | - authors 8 | http: 9 | - route: 10 | - destination: 11 | host: authors 12 | subset: v1 13 | --- 14 | apiVersion: networking.istio.io/v1alpha3 15 | kind: DestinationRule 16 | metadata: 17 | name: authors 18 | spec: 19 | host: authors 20 | subsets: 21 | - name: v1 22 | labels: 23 | version: v1 24 | --- -------------------------------------------------------------------------------- /authors-nodejs/deployment/kubernetes-openshift.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/authors-nodejs/deployment/kubernetes-openshift.yaml -------------------------------------------------------------------------------- /authors-nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "authors_service", 3 | "version": "1.0.0", 4 | "description": "Authors API for Cloud Native Starter pattern", 5 | "private": true, 6 | "engines": { 7 | "node": "^8.9.1" 8 | }, 9 | "config": { 10 | "entrypoint": "server/server.js" 11 | }, 12 | "scripts": { 13 | "start": "node $npm_package_config_entrypoint" 14 | }, 15 | "nodemonConfig": { 16 | "env": { 17 | "NODE_HEAPDUMP_OPTIONS": "nosignal" 18 | } 19 | }, 20 | "dependencies": { 21 | "@cloudant/cloudant": "^1.10.0", 22 | "appmetrics-zipkin": "^1.1.1", 23 | "express": "^4.16.4", 24 | "json-query": "^2.2.2", 25 | "log4js": "^4.0.2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /authors-nodejs/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IBM Cloud Native Starter 5 | 6 | 7 | 8 |
9 |
10 |
11 |

404!

12 |

Whoops! Looks like you got lost or couldn't find your page.

13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /authors-nodejs/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IBM Cloud Native Starter 5 | 6 | 7 | 8 |
9 |
10 |
11 |

500

12 |

The server couldn't handle your request.

13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /authors-nodejs/server/routers/health.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | 3 | module.exports = function (app) { 4 | const router = express.Router(); 5 | 6 | router.get('/', function (req, res, next) { 7 | res.json({ 8 | status: 'UP' 9 | }); 10 | }); 11 | 12 | app.use('/health', router); 13 | } -------------------------------------------------------------------------------- /authors-nodejs/server/routers/index.js: -------------------------------------------------------------------------------- 1 | // The content of this file was generated by IBM Cloud 2 | // Do not modify it as it might get overridden 3 | module.exports = function(app, server){ 4 | // swagger removed 5 | //require('./swagger')(app); 6 | require('./public')(app); 7 | require('./health')(app); 8 | }; 9 | -------------------------------------------------------------------------------- /authors-nodejs/server/routers/public.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const author = require('../../public/authors'); 3 | //const populatedb = require('../../public/populatedb'); 4 | 5 | module.exports = function(app){ 6 | const router = express.Router(); 7 | 8 | router.get('/getauthor', author.author_get); 9 | 10 | app.use('/api/v1', router); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /authors-nodejs/server/routers/swagger.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | 3 | module.exports = function(app){ 4 | const router = express.Router(); 5 | app.use('/swagger/api', express.static('./public/swagger.yaml')); 6 | app.use('/explorer', express.static('./public/swagger-ui')); 7 | app.use(router); 8 | } -------------------------------------------------------------------------------- /documentation/FirstCloudNativeApplicationsJava.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/documentation/FirstCloudNativeApplicationsJava.pdf -------------------------------------------------------------------------------- /documentation/OneHourTalk.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/documentation/OneHourTalk.pdf -------------------------------------------------------------------------------- /iks-scripts/README.md: -------------------------------------------------------------------------------- 1 | ## Directory iks-scripts 2 | 3 | This directory contains the deployment scripts that are used for deploying Cloud Native Starter to IBM Kubernetes Service on the IBM Cloud. 4 | 5 | Deployment instructions can be found [here](../documentation/IKSDeployment.md) 6 | -------------------------------------------------------------------------------- /images/IKS-urls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/IKS-urls.png -------------------------------------------------------------------------------- /images/appid-identity-providers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/appid-identity-providers.png -------------------------------------------------------------------------------- /images/appid-service-credential.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/appid-service-credential.png -------------------------------------------------------------------------------- /images/appid-users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/appid-users.png -------------------------------------------------------------------------------- /images/architecture-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/architecture-2.png -------------------------------------------------------------------------------- /images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/architecture.png -------------------------------------------------------------------------------- /images/authentication-appid-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-0.gif -------------------------------------------------------------------------------- /images/authentication-appid-01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-01.gif -------------------------------------------------------------------------------- /images/authentication-appid-02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-02.gif -------------------------------------------------------------------------------- /images/authentication-appid-04.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-04.gif -------------------------------------------------------------------------------- /images/authentication-appid-05.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-05.gif -------------------------------------------------------------------------------- /images/authentication-appid-06.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-06.gif -------------------------------------------------------------------------------- /images/authentication-appid-07.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authentication-appid-07.gif -------------------------------------------------------------------------------- /images/authorization-microprofile-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authorization-microprofile-admin.png -------------------------------------------------------------------------------- /images/authorization-microprofile-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authorization-microprofile-user.png -------------------------------------------------------------------------------- /images/authorization-microprofile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/authorization-microprofile.gif -------------------------------------------------------------------------------- /images/cloudant-demo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/cloudant-demo-1.png -------------------------------------------------------------------------------- /images/cloudant-demo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/cloudant-demo-2.png -------------------------------------------------------------------------------- /images/cloudant-demo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/cloudant-demo-3.png -------------------------------------------------------------------------------- /images/cloudant-demo-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/cloudant-demo-4.png -------------------------------------------------------------------------------- /images/cloudant-demo-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/cloudant-demo-5.png -------------------------------------------------------------------------------- /images/create-operator-subscription.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/create-operator-subscription.png -------------------------------------------------------------------------------- /images/create-servicemesh-controlplane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/create-servicemesh-controlplane.png -------------------------------------------------------------------------------- /images/displaytoken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/displaytoken.png -------------------------------------------------------------------------------- /images/endpoint-protection-istio-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/endpoint-protection-istio-1.png -------------------------------------------------------------------------------- /images/endpoint-protection-istio-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/endpoint-protection-istio-2.png -------------------------------------------------------------------------------- /images/endpoint-protection-istio-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/endpoint-protection-istio-3.png -------------------------------------------------------------------------------- /images/endpoint-protection-istio-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/endpoint-protection-istio-4.png -------------------------------------------------------------------------------- /images/endpoint-protection-istio.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/endpoint-protection-istio.gif -------------------------------------------------------------------------------- /images/get-oc-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/get-oc-cli.png -------------------------------------------------------------------------------- /images/install-succeeded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/install-succeeded.png -------------------------------------------------------------------------------- /images/installed-operators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/installed-operators.png -------------------------------------------------------------------------------- /images/istio-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/istio-dashboard.png -------------------------------------------------------------------------------- /images/jaeger-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/jaeger-2.png -------------------------------------------------------------------------------- /images/jaeger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/jaeger.png -------------------------------------------------------------------------------- /images/jpa-demo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/jpa-demo-1.png -------------------------------------------------------------------------------- /images/jpa-demo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/jpa-demo-2.png -------------------------------------------------------------------------------- /images/jpa-demo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/jpa-demo-3.png -------------------------------------------------------------------------------- /images/logdna-cloudconsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/logdna-cloudconsole.png -------------------------------------------------------------------------------- /images/logdna-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/logdna-dashboard.png -------------------------------------------------------------------------------- /images/logdna-logsource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/logdna-logsource.png -------------------------------------------------------------------------------- /images/logdna-no-authors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/logdna-no-authors.png -------------------------------------------------------------------------------- /images/logdna-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/logdna-success.png -------------------------------------------------------------------------------- /images/login.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/login.gif -------------------------------------------------------------------------------- /images/login.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/login.jpeg -------------------------------------------------------------------------------- /images/memberroll1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/memberroll1.png -------------------------------------------------------------------------------- /images/memberroll2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/memberroll2.png -------------------------------------------------------------------------------- /images/minishift-istio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/minishift-istio.png -------------------------------------------------------------------------------- /images/minishift-urls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/minishift-urls.png -------------------------------------------------------------------------------- /images/openapi-microprofile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openapi-microprofile.png -------------------------------------------------------------------------------- /images/openshift-create-cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-create-cluster.png -------------------------------------------------------------------------------- /images/openshift-create-cluster1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-create-cluster1.png -------------------------------------------------------------------------------- /images/openshift-daemonset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-daemonset.png -------------------------------------------------------------------------------- /images/openshift-is-kiali.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-is-kiali.png -------------------------------------------------------------------------------- /images/openshift-istio-op.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-istio-op.png -------------------------------------------------------------------------------- /images/openshift-istio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-istio.png -------------------------------------------------------------------------------- /images/openshift-jaeger-op.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-jaeger-op.png -------------------------------------------------------------------------------- /images/openshift-kiali-op.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/openshift-kiali-op.png -------------------------------------------------------------------------------- /images/operatorhub-catalog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/operatorhub-catalog.png -------------------------------------------------------------------------------- /images/os-image-registry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/os-image-registry.png -------------------------------------------------------------------------------- /images/os4-kiali-cns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/os4-kiali-cns.png -------------------------------------------------------------------------------- /images/os4-localenv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/os4-localenv.png -------------------------------------------------------------------------------- /images/prometheus-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/prometheus-1.png -------------------------------------------------------------------------------- /images/prometheus-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/prometheus-2.png -------------------------------------------------------------------------------- /images/prometheus-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/prometheus-3.png -------------------------------------------------------------------------------- /images/slides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/slides.png -------------------------------------------------------------------------------- /images/sysdig-cloudconsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/sysdig-cloudconsole.png -------------------------------------------------------------------------------- /images/sysdig-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/sysdig-dashboard.png -------------------------------------------------------------------------------- /images/sysdig-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/sysdig-source.png -------------------------------------------------------------------------------- /images/traffic-management-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/traffic-management-1.png -------------------------------------------------------------------------------- /images/traffic-management-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/traffic-management-2.png -------------------------------------------------------------------------------- /images/traffic-management.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/traffic-management.gif -------------------------------------------------------------------------------- /images/urls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/urls.png -------------------------------------------------------------------------------- /images/web-app-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/web-app-2.png -------------------------------------------------------------------------------- /images/web-app-no-authors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/web-app-no-authors.png -------------------------------------------------------------------------------- /images/web-app-traffic-v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/web-app-traffic-v1.png -------------------------------------------------------------------------------- /images/web-app-traffic-v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/web-app-traffic-v2.png -------------------------------------------------------------------------------- /images/web-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/images/web-app.png -------------------------------------------------------------------------------- /istio/HTTPS/istio-ingress-gateway-HTTPS.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: default-gateway-ingress-https 5 | spec: 6 | selector: 7 | istio: ingressgateway # use Istio default gateway implementation 8 | servers: 9 | - port: 10 | number: 443 11 | name: https 12 | protocol: HTTPS 13 | tls: 14 | mode: SIMPLE 15 | serverCertificate: /etc/istio/ingressgateway-certs/tls.crt 16 | privateKey: /etc/istio/ingressgateway-certs/tls.key 17 | hosts: 18 | - "web-api.local" 19 | --- 20 | 21 | -------------------------------------------------------------------------------- /istio/fault-articles-500.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: articles 5 | spec: 6 | hosts: 7 | - articles 8 | http: 9 | - route: 10 | - destination: 11 | host: articles 12 | subset: v1 13 | fault: 14 | abort: 15 | httpStatus: 500 16 | percent: 100 17 | --- 18 | -------------------------------------------------------------------------------- /istio/fault-authors-500-10per.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: authors 5 | spec: 6 | hosts: 7 | - authors 8 | http: 9 | - route: 10 | - destination: 11 | host: authors 12 | subset: v1 13 | fault: 14 | abort: 15 | httpStatus: 500 16 | percent: 25 17 | --- 18 | -------------------------------------------------------------------------------- /istio/fault-authors-500.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: authors 5 | spec: 6 | hosts: 7 | - authors 8 | http: 9 | - route: 10 | - destination: 11 | host: authors 12 | subset: v1 13 | fault: 14 | abort: 15 | httpStatus: 500 16 | percent: 100 17 | --- 18 | -------------------------------------------------------------------------------- /istio/istio-ingress-gateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: default-gateway-ingress-http 5 | spec: 6 | selector: 7 | istio: ingressgateway # use Istio default gateway implementation 8 | servers: 9 | - port: 10 | number: 80 11 | name: http 12 | protocol: HTTP 13 | hosts: 14 | - "*" 15 | --- 16 | 17 | -------------------------------------------------------------------------------- /istio/nofault-articles.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: articles 5 | spec: 6 | hosts: 7 | - articles 8 | http: 9 | - route: 10 | - destination: 11 | host: articles 12 | subset: v1 13 | --- 14 | -------------------------------------------------------------------------------- /istio/nofault-authors.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: authors 5 | spec: 6 | hosts: 7 | - authors 8 | http: 9 | - route: 10 | - destination: 11 | host: authors 12 | subset: v1 13 | --- 14 | -------------------------------------------------------------------------------- /istio/prometheus-config.yaml: -------------------------------------------------------------------------------- 1 | - job_name: 'webapi' 2 | scheme: 'http' 3 | tls_config: 4 | insecure_skip_verify: true 5 | kubernetes_sd_configs: 6 | - role: endpoints 7 | relabel_configs: 8 | - source_labels: [__meta_kubernetes_service_annotation_webapi] 9 | action: keep 10 | regex: true 11 | kind: ConfigMap 12 | -------------------------------------------------------------------------------- /istio/protect-web-api.yaml.template: -------------------------------------------------------------------------------- 1 | apiVersion: "authentication.istio.io/v1alpha1" 2 | kind: "Policy" 3 | metadata: 4 | name: "protect-web-api" 5 | spec: 6 | targets: 7 | - name: web-api 8 | origins: 9 | - jwt: 10 | issuer: "APPID_ISSUER" 11 | jwksUri: "APPID_JWKS_URI" 12 | trigger_rules: 13 | - included_paths: 14 | - exact: /web-api/v1/create 15 | principalBinding: USE_ORIGIN -------------------------------------------------------------------------------- /istio/template.k8s-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: cloudnative-ingress 5 | namespace: istio-system 6 | spec: 7 | rules: 8 | - host: cloudnative...containers.appdomain.cloud 9 | http: 10 | paths: 11 | - path: / 12 | backend: 13 | serviceName: istio-ingressgateway 14 | servicePort: 80 15 | 16 | -------------------------------------------------------------------------------- /minishift-scripts/delete-articles-java-jee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deleting articles-java-jee 18 | 19 | cd ${root_folder}/articles-java-jee 20 | oc delete all -l app=articles --ignore-not-found 21 | oc delete all -l app=articles --ignore-not-found 22 | oc delete configmap -l app=articles --ignore-not-found 23 | oc delete -f deployment/istio.yaml --ignore-not-found 24 | 25 | _out Done Deleting articles-java-jee 26 | } 27 | 28 | login 29 | setup 30 | -------------------------------------------------------------------------------- /minishift-scripts/delete-authors-nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deleting authors-nodejs 18 | 19 | cd ${root_folder}/authors-nodejs 20 | oc delete all -l app=authors --ignore-not-found 21 | oc delete all -l app=authors --ignore-not-found 22 | kubectl delete -f deployment/istio.yaml --ignore-not-found 23 | 24 | _out Done Deleting authors-nodejs 25 | } 26 | 27 | login 28 | setup 29 | -------------------------------------------------------------------------------- /minishift-scripts/delete-istio-ingress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deleting Istio Ingress definitions 18 | 19 | cd ${root_folder}/istio 20 | oc delete -f istio-ingress-gateway.yaml --ignore-not-found 21 | oc delete -f istio-ingress-service-web-api-v1-v2-80-20.yaml --ignore-not-found 22 | 23 | _out Done deleting Istio Ingress definitions 24 | } 25 | 26 | login 27 | setup -------------------------------------------------------------------------------- /minishift-scripts/delete-web-api-java-jee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deleting web-api-java-jee 18 | 19 | cd ${root_folder}/web-api-java-jee 20 | oc delete all -l app=web-api --ignore-not-found 21 | oc delete all -l app=web-api --ignore-not-found 22 | oc delete -f deployment/istio-service-v2.yaml --ignore-not-found 23 | 24 | _out Done Deleting web-api-java-jee 25 | } 26 | 27 | login 28 | setup 29 | -------------------------------------------------------------------------------- /minishift-scripts/delete-web-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deleting web-app 18 | 19 | cd ${root_folder}/web-app-vuejs 20 | oc delete all -l app=web-app --ignore-not-found 21 | oc delete pod -l app=web-app --ignore-not-found 22 | oc delete pod web-app-1-build --ignore-not-found 23 | oc delete istag web-app:latest --ignore-not-found 24 | oc delete -f deployment/istio.yaml --ignore-not-found 25 | 26 | _out Done Deleting web-app 27 | } 28 | 29 | login 30 | setup 31 | -------------------------------------------------------------------------------- /minishift-scripts/deploy-istio-ingress-v1-v2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deploying Istio Ingress definitions for web-api v1 and v2 80 20 18 | 19 | cd ${root_folder}/istio 20 | oc apply -f istio-ingress-gateway.yaml 21 | oc delete -f istio-ingress-service-web-api-v1-only.yaml --ignore-not-found 22 | oc apply -f istio-ingress-service-web-api-v1-v2-80-20.yaml 23 | 24 | _out Done deploying Istio Ingress definitions 25 | } 26 | 27 | login 28 | setup -------------------------------------------------------------------------------- /minishift-scripts/deploy-istio-ingress-v1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function login() { 8 | oc login -u developer -p developer 9 | oc project cloud-native-starter 10 | } 11 | 12 | function _out() { 13 | echo "$(date +'%F %H:%M:%S') $@" 14 | } 15 | 16 | function setup() { 17 | _out Deploying Istio Ingress 18 | 19 | cd ${root_folder}/istio 20 | oc apply -f istio-ingress-gateway.yaml 21 | oc apply -f istio-ingress-service-web-api-v1-only.yaml 22 | 23 | _out Done Deploying Istio Ingress 24 | } 25 | 26 | login 27 | setup 28 | -------------------------------------------------------------------------------- /minishift-scripts/no-mtls.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "authentication.istio.io/v1alpha1" 2 | kind: "Policy" 3 | metadata: 4 | name: "default" 5 | namespace: "cloud-native-starter" 6 | spec: 7 | peers: 8 | - mtls: 9 | mode: PERMISSIVE -------------------------------------------------------------------------------- /minishift-scripts/setup-minishift.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function test() { 12 | command -v minishift >/dev/null 2>&1 || { echo >&2 "You need to install minishift first! Aborting."; exit 1; } 13 | } 14 | 15 | function setup() { 16 | minishift profile set istio 17 | minishift config set vm-driver virtualbox 18 | minishift config set memory 8GB 19 | minishift config set cpus 4 20 | minishift config set image-caching true 21 | minishift config set openshift-version v3.10.0 22 | minishift addon enable admin-user 23 | minishift addon enable anyuid 24 | minishift addon enable admissions-webhook 25 | minishift start 26 | } 27 | 28 | test 29 | setup -------------------------------------------------------------------------------- /minishift-scripts/setup-project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | oc login -u admin -p admin 13 | oc new-project cloud-native-starter 14 | oc adm policy add-scc-to-user anyuid -z default -n cloud-native-starter 15 | oc adm policy add-scc-to-user privileged -z default -n cloud-native-starter 16 | oc adm policy add-role-to-user admin developer 17 | cd ${root_folder}/minishift-scripts 18 | oc apply -f no-mtls.yaml 19 | } 20 | 21 | setup 22 | -------------------------------------------------------------------------------- /openshift-scripts/k8s-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: cloudnative-ingress 5 | namespace: cloud-native-starter 6 | spec: 7 | rules: 8 | - host: cloudnative.harald-uebele-openshift2.us-east.containers.appdomain.cloud 9 | http: 10 | paths: 11 | - path: / 12 | backend: 13 | serviceName: web-app 14 | servicePort: 80 -------------------------------------------------------------------------------- /openshift-scripts/k8s-ingress.yaml.template: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: cloudnative-ingress 5 | namespace: cloud-native-starter 6 | spec: 7 | rules: 8 | - host: cloudnative.#INGRESS 9 | http: 10 | paths: 11 | - path: / 12 | backend: 13 | serviceName: web-app 14 | servicePort: 80 -------------------------------------------------------------------------------- /os4-scripts/delete-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function delete() { 12 | 13 | _out --- Delete articles 14 | oc delete all -l app=articles 15 | oc delete is articles 16 | _out --- Delete authors 17 | oc delete all -l app=authors --ignore-not-found 18 | oc delete is authors 19 | _out --- Delete web-api 20 | oc delete all -l app=web-api --ignore-not-found 21 | oc delete is web-api 22 | 23 | } 24 | 25 | source ${root_folder}/os4-scripts/login.sh 26 | delete -------------------------------------------------------------------------------- /os4-scripts/deploy-istio-ingress-v1-v2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying Istio Ingress definitions for web-api v1 and v2 80 20 13 | 14 | cd ${root_folder}/os4-scripts 15 | oc apply -f istio-ingress-gateway.yaml 16 | oc delete -f istio-ingress-service-web-api-v1-only.yaml --ignore-not-found 17 | oc apply -f istio-ingress-service-web-api-v1-v2-80-20.yaml 18 | 19 | _out Done deploying Istio Ingress definitions 20 | } 21 | 22 | source ${root_folder}/os4-scripts/login.sh 23 | setup 24 | -------------------------------------------------------------------------------- /os4-scripts/deploy-istio-ingress-v1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying Istio Ingress definitions for web-api v1 only 13 | 14 | cd ${root_folder}/os4-scripts 15 | oc apply -f istio-ingress-gateway.yaml 16 | oc apply -f istio-ingress-service-web-api-v1-only.yaml 17 | 18 | _out Done deploying Istio Ingress definitions 19 | } 20 | 21 | source ${root_folder}/os4-scripts/login.sh 22 | setup 23 | -------------------------------------------------------------------------------- /os4-scripts/istio-ingress-gateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: default-gateway-ingress-http 5 | spec: 6 | selector: 7 | istio: ingressgateway # use Istio default gateway implementation 8 | servers: 9 | - port: 10 | number: 80 11 | name: http 12 | protocol: HTTP 13 | hosts: 14 | - "*" 15 | --- 16 | 17 | -------------------------------------------------------------------------------- /reactive/articles-reactive/.dockerignore: -------------------------------------------------------------------------------- 1 | .apt_generated 2 | .apt_generated_tests 3 | .settings 4 | deployment 5 | target/articles 6 | target/classes 7 | target/generated-sources 8 | target/maven-archiver 9 | target/maven-status 10 | target/reports 11 | target/test-classes 12 | target/transformed-classes 13 | target/wiring-classes 14 | target/wiring-devmode -------------------------------------------------------------------------------- /reactive/articles-reactive/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM adoptopenjdk/openjdk11-openj9:ubi-minimal 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | RUN mkdir /opt/shareclasses 11 | # OpenShift permissions: 12 | RUN chmod a+rwx -R /opt/shareclasses 13 | RUN mkdir /opt/app 14 | COPY --from=BUILD /usr/src/app/target/lib/* /opt/app/lib/ 15 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /opt/app/app.jar 16 | CMD ["java", "-Xmx128m", "-XX:+IdleTuningGcOnIdle", "-Xtune:virtualized", "-Xscmx128m", "-Xscmaxaot100m", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/app/app.jar"] 17 | -------------------------------------------------------------------------------- /reactive/articles-reactive/Dockerfile.Hotspot: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM fabric8/java-alpine-openjdk11-jre 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | COPY --from=BUILD /usr/src/app/target/lib/* /deployments/lib/ 11 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /deployments/app.jar 12 | ENTRYPOINT [ "/deployments/run-java.sh" ] -------------------------------------------------------------------------------- /reactive/articles-reactive/Dockerfile.OpenJ9-run-java: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM adoptopenjdk/openjdk11-openj9:ubi-minimal 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | RUN mkdir /opt/shareclasses 11 | # OpenShift permissions: 12 | RUN chmod a+rwx -R /opt/shareclasses 13 | RUN mkdir /opt/app 14 | COPY --from=BUILD /usr/src/app/target/lib/* /opt/app/lib/ 15 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /opt/app/app.jar 16 | ENV JAVA_APP_DIR=/opt/app \ 17 | JAVA_MAJOR_VERSION=11 18 | COPY run-java.sh /opt/app/ 19 | RUN chmod 755 /opt/app/run-java.sh 20 | ENTRYPOINT [ "/opt/app/run-java.sh" ] -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/apis/ArticleAsJson.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.apis; 2 | 3 | import javax.enterprise.context.ApplicationScoped; 4 | import javax.json.Json; 5 | import javax.json.JsonObject; 6 | 7 | import com.ibm.articles.business.Article; 8 | 9 | @ApplicationScoped 10 | public class ArticleAsJson { 11 | 12 | public ArticleAsJson() {} 13 | 14 | public JsonObject createJson(Article article) { 15 | return Json.createObjectBuilder().add("id", article.id).add("title", article.title).add("url", article.url) 16 | .add("author", article.author).build(); 17 | } 18 | } -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/apis/HealthEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.apis; 2 | 3 | import org.eclipse.microprofile.health.HealthCheck; 4 | import org.eclipse.microprofile.health.HealthCheckResponse; 5 | import org.eclipse.microprofile.health.Liveness; 6 | 7 | import javax.enterprise.context.ApplicationScoped; 8 | 9 | @Liveness 10 | @ApplicationScoped 11 | public class HealthEndpoint implements HealthCheck { 12 | 13 | @Override 14 | public HealthCheckResponse call() { 15 | return HealthCheckResponse.named("articles").withData("articles", "ok").up().build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/business/Article.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.business; 2 | 3 | public class Article { 4 | 5 | public String title; 6 | public String url; 7 | public String author; 8 | public String id; 9 | public String creationDate; 10 | 11 | } -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/business/ArticleDoesNotExist.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.business; 2 | 3 | public class ArticleDoesNotExist extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public ArticleDoesNotExist() { 8 | } 9 | 10 | public ArticleDoesNotExist(String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/business/InvalidArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.business; 2 | 3 | public class InvalidArticle extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidArticle() { 8 | } 9 | 10 | public InvalidArticle(String message) { 11 | super(message); 12 | } 13 | } -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/business/InvalidInputParameter.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.business; 2 | 3 | public class InvalidInputParameter extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidInputParameter() { 8 | } 9 | 10 | public InvalidInputParameter(String message) { 11 | super(message); 12 | } 13 | } -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/business/NoDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.business; 2 | 3 | public class NoDataAccess extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoDataAccess() { 8 | } 9 | 10 | public NoDataAccess(String message) { 11 | super(message); 12 | } 13 | 14 | public NoDataAccess(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/data/DataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.data; 2 | 3 | import com.ibm.articles.business.Article; 4 | import com.ibm.articles.business.ArticleDoesNotExist; 5 | 6 | import java.util.List; 7 | import java.util.concurrent.CompletionStage; 8 | 9 | public interface DataAccess { 10 | 11 | Article addArticle(Article article) throws NoConnectivity; 12 | 13 | Article getArticle(String id) throws NoConnectivity, ArticleDoesNotExist; 14 | 15 | List
getArticles() throws NoConnectivity; 16 | 17 | CompletionStage
addArticleReactive(Article article); 18 | 19 | CompletionStage
getArticleReactive(String id); 20 | 21 | CompletionStage> getArticlesReactive(); 22 | } -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/java/com/ibm/articles/data/NoConnectivity.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles.data; 2 | 3 | public class NoConnectivity extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoConnectivity() { 8 | } 9 | 10 | public NoConnectivity(String message) { 11 | super(message); 12 | } 13 | 14 | public NoConnectivity(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /reactive/articles-reactive/src/main/resources/application.properties.template: -------------------------------------------------------------------------------- 1 | quarkus.swagger-ui.always-include=true 2 | quarkus.swagger-ui.path=/explorer 3 | 4 | kafka.bootstrap.servers=KAFKA_BOOTSTRAP_SERVERS 5 | 6 | quarkus.datasource.url=vertx-reactive:postgresql://POSTGRES_URL/postgres 7 | quarkus.datasource.username=postgres 8 | quarkus.datasource.password=postgres 9 | 10 | custom.in-memory-store=IN_MEMORY_STORE -------------------------------------------------------------------------------- /reactive/articles-synch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM fabric8/java-alpine-openjdk11-jre 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | COPY --from=BUILD /usr/src/app/target/lib/* /deployments/lib/ 11 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /deployments/app.jar 12 | ENTRYPOINT [ "/deployments/run-java.sh" ] -------------------------------------------------------------------------------- /reactive/articles-synch/src/main/java/com/ibm/articles/Article.java: -------------------------------------------------------------------------------- 1 | package com.ibm.articles; 2 | 3 | import javax.persistence.Cacheable; 4 | import javax.persistence.Entity; 5 | import io.quarkus.hibernate.orm.panache.PanacheEntity; 6 | 7 | @Entity 8 | @Cacheable 9 | public class Article extends PanacheEntity { 10 | 11 | public Article() {} 12 | 13 | public String title; 14 | 15 | public String url; 16 | 17 | public String author; 18 | 19 | public String creationDate; 20 | } 21 | -------------------------------------------------------------------------------- /reactive/articles-synch/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.swagger-ui.always-include=true 2 | quarkus.swagger-ui.path=/explorer 3 | 4 | quarkus.datasource.url=jdbc:postgresql://database-articles.my-postgresql-operator-dev4devs-com:5432/postgres 5 | 6 | quarkus.datasource.driver=org.postgresql.Driver 7 | quarkus.hibernate-orm.database.generation=drop-and-create 8 | quarkus.hibernate-orm.log.sql=true 9 | quarkus.datasource.username=postgres 10 | quarkus.datasource.password=postgres 11 | quarkus.datasource.max-size=8 12 | quarkus.datasource.min-size=2 13 | quarkus.hibernate-orm.sql-load-script=import.sql 14 | -------------------------------------------------------------------------------- /reactive/articles-synch/src/main/resources/application.properties.template: -------------------------------------------------------------------------------- 1 | quarkus.swagger-ui.always-include=true 2 | quarkus.swagger-ui.path=/explorer 3 | 4 | quarkus.datasource.url=jdbc:postgresql://POSTGRES_URL/postgres 5 | 6 | quarkus.datasource.driver=org.postgresql.Driver 7 | quarkus.hibernate-orm.database.generation=drop-and-create 8 | quarkus.hibernate-orm.log.sql=true 9 | quarkus.datasource.username=postgres 10 | quarkus.datasource.password=postgres 11 | quarkus.datasource.max-size=8 12 | quarkus.datasource.min-size=2 13 | quarkus.hibernate-orm.sql-load-script=import.sql -------------------------------------------------------------------------------- /reactive/documentation/ReactiveMicroservices.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/ReactiveMicroservices.pdf -------------------------------------------------------------------------------- /reactive/documentation/architecture-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/architecture-small.png -------------------------------------------------------------------------------- /reactive/documentation/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/architecture.png -------------------------------------------------------------------------------- /reactive/documentation/architecture.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/architecture.pptx -------------------------------------------------------------------------------- /reactive/documentation/demo-1-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/demo-1-small.png -------------------------------------------------------------------------------- /reactive/documentation/demo-1-video-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/demo-1-video-small.gif -------------------------------------------------------------------------------- /reactive/documentation/demo-1-video.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/demo-1-video.gif -------------------------------------------------------------------------------- /reactive/documentation/demo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/demo-1.png -------------------------------------------------------------------------------- /reactive/documentation/demo-2-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/demo-2-small.png -------------------------------------------------------------------------------- /reactive/documentation/demo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/demo-2.png -------------------------------------------------------------------------------- /reactive/documentation/images/operatorhub-postgres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/images/operatorhub-postgres.png -------------------------------------------------------------------------------- /reactive/documentation/images/postgres-op-succeeded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/images/postgres-op-succeeded.png -------------------------------------------------------------------------------- /reactive/documentation/images/postgres-yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/images/postgres-yaml.png -------------------------------------------------------------------------------- /reactive/documentation/images/subscr-postgres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/images/subscr-postgres.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x30-threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x30-threads.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x30-v1-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x30-v1-graph.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x30-v1-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x30-v1-summary.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x30-v2-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x30-v2-graph.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x30-v2-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x30-v2-summary.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x300-threads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x300-threads.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x300-v1-errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x300-v1-errors.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x300-v1-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x300-v1-graph.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x300-v1-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x300-v1-summary.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x300-v2-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x300-v2-graph.png -------------------------------------------------------------------------------- /reactive/documentation/load-100x300-v2-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-100x300-v2-summary.png -------------------------------------------------------------------------------- /reactive/documentation/load-v1-requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-v1-requests.png -------------------------------------------------------------------------------- /reactive/documentation/load-v2-requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/load-v2-requests.png -------------------------------------------------------------------------------- /reactive/documentation/persistence-panache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/persistence-panache.png -------------------------------------------------------------------------------- /reactive/documentation/persistence-reactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/documentation/persistence-reactive.png -------------------------------------------------------------------------------- /reactive/iks-scripts/kafka-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kafka.strimzi.io/v1beta1 2 | kind: Kafka 3 | metadata: 4 | name: my-cluster 5 | spec: 6 | kafka: 7 | version: 2.3.0 8 | replicas: 3 9 | listeners: 10 | plain: {} 11 | tls: {} 12 | external: 13 | type: nodeport 14 | tls: false 15 | config: 16 | offsets.topic.replication.factor: 3 17 | transaction.state.log.replication.factor: 3 18 | transaction.state.log.min.isr: 2 19 | log.message.format.version: '2.3' 20 | storage: 21 | type: ephemeral 22 | zookeeper: 23 | replicas: 3 24 | storage: 25 | type: ephemeral 26 | entityOperator: 27 | topicOperator: {} 28 | userOperator: {} -------------------------------------------------------------------------------- /reactive/os4-scripts/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:12 2 | # https://hub.docker.com/_/postgres 3 | # Create the needed temp file before the first postgresSQL execution 4 | RUN mkdir temp 5 | # Create group and user 6 | RUN groupadd non-root-postgres-group 7 | RUN useradd non-root-postgres-user --group non-root-postgres-group 8 | # Set user rights to allow the on-root-postgres-user to access the temp folder 9 | RUN chown -R non-root-postgres-user:non-root-postgres-group /temp 10 | RUN chmod 777 /temp 11 | # Change to non-root privilege 12 | USER non-root-postgres 13 | -------------------------------------------------------------------------------- /reactive/os4-scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | while true; do 8 | read -p "Do you wish to cleanup = delete everything in this project? [y|n] " yn 9 | case $yn in 10 | [Yy]* ) break;; 11 | [Nn]* ) exit;; 12 | * ) echo "Please answer yes or no.";; 13 | esac 14 | done 15 | 16 | echo Cleanup 17 | source ${root_folder}/os4-scripts/login.sh 18 | oc delete project cloud-native-starter 19 | oc delete project kafka 20 | oc delete project postgres 21 | 22 | 23 | -------------------------------------------------------------------------------- /reactive/os4-scripts/delete-articles-reactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | oc delete all -l app=articles-reactive --ignore-not-found 14 | 15 | } 16 | 17 | source ${root_folder}/os4-scripts/login.sh 18 | setup 19 | -------------------------------------------------------------------------------- /reactive/os4-scripts/delete-authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | oc delete all -l app=authors --ignore-not-found 14 | oc delete is authors 15 | } 16 | 17 | source ${root_folder}/os4-scripts/login.sh 18 | setup 19 | -------------------------------------------------------------------------------- /reactive/scripts/delete-all-services.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | cd ${root_folder}/articles-reactive 14 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 15 | 16 | cd ${root_folder}/web-api-reactive 17 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 18 | 19 | cd ${root_folder}/web-app-reactive 20 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 21 | 22 | cd ${root_folder}/../authors-nodejs 23 | kubectl delete -f deployment/deployment.yaml --ignore-not-found 24 | } 25 | 26 | setup 27 | -------------------------------------------------------------------------------- /reactive/scripts/delete-articles-reactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | cd ${root_folder}/articles-reactive 14 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 15 | 16 | } 17 | 18 | setup 19 | -------------------------------------------------------------------------------- /reactive/scripts/delete-authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | cd ${root_folder}/../authors-nodejs/deployment 14 | cp deployment.yaml.template deployment.yaml 15 | kubectl delete -f deployment.yaml --ignore-not-found 16 | rm deployment.yaml 17 | } 18 | 19 | setup 20 | -------------------------------------------------------------------------------- /reactive/scripts/delete-postgres-database.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Delete postgres database 13 | 14 | cd ${root_folder}/scripts 15 | kubectl delete -f postgres-cluster.yaml -n my-postgresql-operator-dev4devs-com 16 | } 17 | 18 | setup -------------------------------------------------------------------------------- /reactive/scripts/delete-web-api-reactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | cd ${root_folder}/web-api-reactive 14 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 15 | 16 | } 17 | 18 | setup 19 | -------------------------------------------------------------------------------- /reactive/scripts/deploy-postgres-admin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying postgres admin UI 13 | 14 | eval $(minikube docker-env) 15 | 16 | kubectl create ns demo 17 | kubectl create -f https://raw.githubusercontent.com/kubedb/cli/0.9.0/docs/examples/postgres/quickstart/pgadmin.yaml 18 | 19 | _out Done deploying postgres admin UI 20 | _out Wait until the pod has been started: \"kubectl get pods -n demo --watch\" 21 | _out URL: \"minikube service pgadmin -n demo --url\" 22 | _out Credentials - user: admin, password: admin 23 | } 24 | 25 | setup -------------------------------------------------------------------------------- /reactive/scripts/deploy-postgres-operator-database.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying postgres database 13 | 14 | cd ${root_folder}/scripts 15 | kubectl create -f postgres-cluster.yaml -n my-postgresql-operator-dev4devs-com 16 | 17 | sleep 10 18 | 19 | kubectl patch svc database-articles -n my-postgresql-operator-dev4devs-com -p '{"spec": {"ports": [{"port": 5432,"targetPort": 5432,"name": "database-articles", "protocol": "TCP"}],"type": "NodePort"}}' 20 | 21 | _out Done deploying postgres cluster 22 | _out Wait until the pod has been started: \"kubectl get pods -n my-postgresql-operator-dev4devs-com --watch \| grep database-articles\" 23 | } 24 | 25 | setup -------------------------------------------------------------------------------- /reactive/scripts/deploy-postgres-operator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying postgres operator 13 | 14 | curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/0.13.0/install.sh | bash -s 0.13.0 15 | 16 | kubectl create -f https://operatorhub.io/install/postgresql-operator-dev4devs-com.yaml 17 | 18 | _out Done deploying postgres operator 19 | _out Wait until the operator has been started: \"kubectl get csv -n my-postgresql-operator-dev4devs-com --watch\" 20 | _out To doublecheck, make sure everything is green in the Minikube dashboard for all namespaces: \"minikube dashboard\" 21 | _out Once succeeded, run \"sh scripts/deploy-postgres-database.sh\" 22 | } 23 | 24 | setup -------------------------------------------------------------------------------- /reactive/scripts/deploy-postgres.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying postgres 13 | 14 | kubectl create ns my-postgresql-operator-dev4devs-com 15 | 16 | cd ${root_folder} 17 | kubectl create -f iks-scripts/postgres.yaml 18 | 19 | _out Done deploying postgres 20 | _out Wait until the pod has been started: \"kubectl get pods -n my-postgresql-operator-dev4devs-com --watch\" 21 | } 22 | 23 | setup -------------------------------------------------------------------------------- /reactive/scripts/download-run-java.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | cd ${root_folder}/articles-reactive 13 | file="${root_folder}/articles-reactive/run-java.sh" 14 | if [ -f "$file" ] 15 | then 16 | echo "$file found locally" 17 | else 18 | curl -L -o $file https://raw.githubusercontent.com/fabric8io-images/java/0c7107ef65c95ca62b5f14416bef3fd34a528d47/images/alpine/openjdk11/jre/run-java.sh 19 | fi 20 | } 21 | 22 | setup -------------------------------------------------------------------------------- /reactive/scripts/generate-load.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Generating load 13 | 14 | minikubeip=$(minikube ip) 15 | nodeport=$(kubectl get svc web-api-reactive --output 'jsonpath={.spec.ports[*].nodePort}') 16 | 17 | start=`date +%s` 18 | version=2 19 | 20 | for i in {1..5000} 21 | do 22 | echo "Times /v${version}/articles invoked: $i" 23 | curl --silent --output /dev/null -X GET "http://${minikubeip}:${nodeport}/v${version}/articles" -H "accept: application/json" 24 | done 25 | 26 | end=`date +%s` 27 | duration=$((end-start)) 28 | _out $duration 29 | 30 | } 31 | 32 | setup 33 | 34 | -------------------------------------------------------------------------------- /reactive/scripts/kafka-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kafka.strimzi.io/v1beta1 2 | kind: Kafka 3 | metadata: 4 | name: my-cluster 5 | spec: 6 | kafka: 7 | version: 2.3.0 8 | replicas: 3 9 | listeners: 10 | plain: {} 11 | tls: {} 12 | external: 13 | type: nodeport 14 | tls: false 15 | config: 16 | offsets.topic.replication.factor: 3 17 | transaction.state.log.replication.factor: 3 18 | transaction.state.log.min.isr: 2 19 | log.message.format.version: '2.3' 20 | storage: 21 | type: ephemeral 22 | zookeeper: 23 | replicas: 3 24 | storage: 25 | type: ephemeral 26 | entityOperator: 27 | topicOperator: {} 28 | userOperator: {} -------------------------------------------------------------------------------- /reactive/scripts/postgres-cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: postgresql.dev4devs.com/v1alpha1 2 | kind: Database 3 | metadata: 4 | name: database-articles 5 | namespace: my-postgresql-operator-dev4devs-com 6 | spec: 7 | databaseCpu: 30m 8 | databaseCpuLimit: 60m 9 | databaseMemoryLimit: 512Mi 10 | databaseMemoryRequest: 128Mi 11 | databaseName: postgres 12 | databaseNameKeyEnvVar: POSTGRESQL_DATABASE 13 | databasePassword: postgres 14 | databasePasswordKeyEnvVar: POSTGRESQL_PASSWORD 15 | databaseStorageRequest: 1Gi 16 | databaseUser: postgres 17 | databaseUserKeyEnvVar: POSTGRESQL_USER 18 | image: centos/postgresql-96-centos7 19 | size: 1 -------------------------------------------------------------------------------- /reactive/scripts/run-locally-web-app-reactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | minikubeip=$(minikube ip) 14 | nodeport=$(kubectl get svc web-api-reactive --ignore-not-found --output 'jsonpath={.spec.ports[*].nodePort}') 15 | if [ -z "$nodeport" ]; then 16 | _out web-api-reactive is not available. Run the command: sh scripts/deploy-web-api-reactive.sh 17 | else 18 | _out Press Ctrl-C to stop web-app-reactive 19 | _out Home page: http://localhost:8080/ 20 | 21 | cd ${root_folder}/web-app-reactive/src 22 | sed "s/endpoint-api-ip:ingress-np/${minikubeip}:${nodeport}/g" store.js.template > store.js 23 | 24 | cd ${root_folder}/web-app-reactive 25 | yarn serve 26 | fi 27 | } 28 | 29 | setup -------------------------------------------------------------------------------- /reactive/scripts/show-logs-articles-reactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | pod=$(kubectl get pods | grep articles-reactive | awk ' {print $1} ') 14 | _out $pod 15 | kubectl logs $pod articles-reactive 16 | 17 | } 18 | 19 | setup -------------------------------------------------------------------------------- /reactive/scripts/show-logs-web-api-reactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | pod=$(kubectl get pods | grep web-api-reactive | awk ' {print $1} ') 14 | _out $pod 15 | kubectl logs $pod web-api-reactive 16 | 17 | } 18 | 19 | setup -------------------------------------------------------------------------------- /reactive/scripts/start-minikube.sh: -------------------------------------------------------------------------------- 1 | minikube start --cpus 4 --memory 8192 -------------------------------------------------------------------------------- /reactive/web-api-reactive/.dockerignore: -------------------------------------------------------------------------------- 1 | .apt_generated 2 | .apt_generated_tests 3 | .settings 4 | deployment 5 | target/articles 6 | target/classes 7 | target/generated-sources 8 | target/maven-archiver 9 | target/maven-status 10 | target/reports 11 | target/test-classes 12 | target/transformed-classes 13 | target/wiring-classes 14 | target/wiring-devmode -------------------------------------------------------------------------------- /reactive/web-api-reactive/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM adoptopenjdk/openjdk11-openj9:ubi-minimal 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | RUN mkdir /opt/shareclasses 11 | # OpenShift permissions: 12 | RUN chmod a+rwx -R /opt/shareclasses 13 | RUN mkdir /opt/app 14 | COPY --from=BUILD /usr/src/app/target/lib/* /opt/app/lib/ 15 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /opt/app/app.jar 16 | CMD ["java", "-Xmx128m", "-XX:+IdleTuningGcOnIdle", "-Xtune:virtualized", "-Xscmx128m", "-Xscmaxaot100m", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/app/app.jar"] 17 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/Dockerfile.hotspot: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM fabric8/java-alpine-openjdk11-jre 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | COPY --from=BUILD /usr/src/app/target/lib/* /deployments/lib/ 11 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /deployments/app.jar 12 | ENTRYPOINT [ "/deployments/run-java.sh" ] -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/apis/HealthEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.apis; 2 | 3 | import org.eclipse.microprofile.health.Readiness; 4 | import org.eclipse.microprofile.health.HealthCheck; 5 | import org.eclipse.microprofile.health.HealthCheckResponse; 6 | 7 | import javax.enterprise.context.ApplicationScoped; 8 | 9 | @Readiness 10 | @ApplicationScoped 11 | public class HealthEndpoint implements HealthCheck { 12 | 13 | @Override 14 | public HealthCheckResponse call() { 15 | return HealthCheckResponse.named("web-api").withData("web-api", "ok").up().build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/apis/NewArticleListener.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.apis; 2 | 3 | import org.eclipse.microprofile.reactive.messaging.Incoming; 4 | import javax.enterprise.context.ApplicationScoped; 5 | import io.smallrye.reactive.messaging.annotations.Broadcast; 6 | import org.eclipse.microprofile.reactive.messaging.Outgoing; 7 | 8 | @ApplicationScoped 9 | public class NewArticleListener { 10 | 11 | @Incoming("new-article-created") 12 | @Outgoing("stream-new-article") 13 | @Broadcast 14 | public String process(String articleId) { 15 | System.out.println("Kafka message received: new-article-created - " + articleId); 16 | return articleId; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/apis/NewArticlesStreamResource.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.apis; 2 | 3 | import javax.inject.Inject; 4 | import javax.ws.rs.core.MediaType; 5 | import org.reactivestreams.Publisher; 6 | import io.smallrye.reactive.messaging.annotations.Channel; 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Path; 9 | import javax.ws.rs.Produces; 10 | import org.jboss.resteasy.annotations.SseElementType; 11 | 12 | @Path("/v2") 13 | public class NewArticlesStreamResource { 14 | 15 | @Inject 16 | @Channel("stream-new-article") Publisher newArticles; 17 | 18 | @GET 19 | @Path("/server-sent-events") 20 | @Produces(MediaType.SERVER_SENT_EVENTS) 21 | @SseElementType("text/plain") 22 | public Publisher stream() { 23 | return newArticles; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/business/Article.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class Article { 4 | 5 | public String id; 6 | public String title; 7 | public String url; 8 | public String authorName; 9 | public String authorTwitter; 10 | public String authorBlog; 11 | 12 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/business/Author.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class Author { 4 | 5 | public String name; 6 | public String twitter; 7 | public String blog; 8 | 9 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/business/CoreArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class CoreArticle { 4 | 5 | public String title; 6 | public String url; 7 | public String author; 8 | public String id; 9 | 10 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/business/InvalidArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class InvalidArticle extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidArticle() { 8 | } 9 | 10 | public InvalidArticle(String message) { 11 | super(message); 12 | } 13 | 14 | public InvalidArticle(Throwable cause) { 15 | super(cause); 16 | } 17 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/business/NoDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class NoDataAccess extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoDataAccess() { 8 | } 9 | 10 | public NoDataAccess(String message) { 11 | super(message); 12 | } 13 | 14 | public NoDataAccess(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/business/NonexistentAuthor.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class NonexistentAuthor extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public NonexistentAuthor() { 8 | } 9 | 10 | public NonexistentAuthor(String message) { 11 | super(message); 12 | } 13 | 14 | public NonexistentAuthor(Throwable cause) { 15 | super(cause); 16 | } 17 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/data/ArticlesService.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import com.ibm.webapi.business.CoreArticle; 4 | import com.ibm.webapi.business.InvalidArticle; 5 | import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; 6 | 7 | import javax.ws.rs.*; 8 | import javax.ws.rs.core.MediaType; 9 | import java.util.List; 10 | 11 | @RegisterProvider(ExceptionMapperArticles.class) 12 | public interface ArticlesService { 13 | 14 | @GET 15 | @Produces(MediaType.APPLICATION_JSON) 16 | List getArticlesFromService(@QueryParam("amount") int amount); 17 | 18 | @POST 19 | @Consumes(MediaType.APPLICATION_JSON) 20 | @Produces(MediaType.APPLICATION_JSON) 21 | CoreArticle addArticle(CoreArticle article) throws InvalidArticle; 22 | 23 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/data/ArticlesServiceReactive.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import com.ibm.webapi.business.CoreArticle; 4 | import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; 5 | 6 | import javax.ws.rs.GET; 7 | import javax.ws.rs.Produces; 8 | import javax.ws.rs.QueryParam; 9 | import javax.ws.rs.core.MediaType; 10 | import java.util.List; 11 | import java.util.concurrent.CompletionStage; 12 | 13 | @RegisterProvider(ExceptionMapperArticles.class) 14 | public interface ArticlesServiceReactive { 15 | 16 | @GET 17 | @Produces(MediaType.APPLICATION_JSON) 18 | CompletionStage> getArticlesFromService(@QueryParam("amount") int amount); 19 | 20 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/data/AuthorsService.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import com.ibm.webapi.business.Author; 4 | import com.ibm.webapi.business.NonexistentAuthor; 5 | import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; 6 | 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Produces; 9 | import javax.ws.rs.QueryParam; 10 | import javax.ws.rs.core.MediaType; 11 | 12 | @RegisterProvider(ExceptionMapperAuthors.class) 13 | public interface AuthorsService { 14 | 15 | @GET 16 | @Produces(MediaType.APPLICATION_JSON) 17 | Author getAuthor(@QueryParam("name") String authorName) throws NonexistentAuthor; 18 | 19 | } -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/data/ExceptionMapperArticles.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import com.ibm.webapi.business.InvalidArticle; 4 | import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; 5 | 6 | import javax.ws.rs.core.MultivaluedMap; 7 | import javax.ws.rs.core.Response; 8 | import javax.ws.rs.ext.Provider; 9 | 10 | @Provider 11 | public class ExceptionMapperArticles implements ResponseExceptionMapper { 12 | 13 | @Override 14 | public boolean handles(int status, MultivaluedMap headers) { 15 | return status == 204; 16 | } 17 | 18 | @Override 19 | public InvalidArticle toThrowable(Response response) { 20 | if (response.getStatus() == 204) 21 | return new InvalidArticle(); 22 | return null; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/data/ExceptionMapperAuthors.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import com.ibm.webapi.business.NonexistentAuthor; 4 | import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; 5 | 6 | import javax.ws.rs.core.MultivaluedMap; 7 | import javax.ws.rs.core.Response; 8 | import javax.ws.rs.ext.Provider; 9 | 10 | @Provider 11 | public class ExceptionMapperAuthors implements ResponseExceptionMapper { 12 | 13 | @Override 14 | public boolean handles(int status, MultivaluedMap headers) { 15 | return status == 204; 16 | } 17 | 18 | @Override 19 | public NonexistentAuthor toThrowable(Response response) { 20 | if (response.getStatus() == 204) 21 | return new NonexistentAuthor(); 22 | return null; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/java/com/ibm/webapi/data/NoConnectivity.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | public class NoConnectivity extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoConnectivity() { 8 | } 9 | 10 | public NoConnectivity(String message) { 11 | super(message); 12 | } 13 | 14 | public NoConnectivity(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /reactive/web-api-reactive/src/main/resources/application.properties.template: -------------------------------------------------------------------------------- 1 | quarkus.swagger-ui.always-include=true 2 | quarkus.swagger-ui.path=/explorer 3 | 4 | mp.messaging.incoming.new-article-created.connector=smallrye-kafka 5 | mp.messaging.incoming.new-article-created.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer 6 | 7 | kafka.bootstrap.servers=KAFKA_BOOTSTRAP_SERVERS 8 | 9 | cloud-native-starter.local=CNS_LOCAL 10 | cloud-native-starter.minikube.ip=CNS_MINIKUBE_IP 11 | cloud-native-starter.articles.port=CNS_ARTICLES_PORT 12 | cloud-native-starter.authors.port=CNS_AUTHORS_PORT 13 | 14 | # CORS is only required when using NodePorts, when using Istio Ingress the port is always the same one as the one used by the web-app 15 | quarkus.http.cors=true 16 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/.dockerignore: -------------------------------------------------------------------------------- 1 | deployment 2 | dist 3 | node_modules -------------------------------------------------------------------------------- /reactive/web-app-reactive/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY public /usr/src/app/public 5 | COPY package.json /usr/src/app/ 6 | COPY babel.config.js /usr/src/app/ 7 | 8 | WORKDIR /usr/src/app/ 9 | RUN yarn install 10 | RUN yarn build 11 | 12 | 13 | FROM nginx:latest 14 | COPY nginx.conf /etc/nginx/conf.d/default.conf 15 | COPY --from=BUILD /usr/src/app/dist /usr/share/nginx/html -------------------------------------------------------------------------------- /reactive/web-app-reactive/Dockerfile.os4: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine as BUILD 2 | COPY src /usr/src/app/src 3 | COPY public /usr/src/app/public 4 | COPY package.json /usr/src/app/ 5 | COPY babel.config.js /usr/src/app/ 6 | WORKDIR /usr/src/app/ 7 | RUN yarn install 8 | RUN yarn build 9 | 10 | # https://blog.openshift.com/deploy-vuejs-applications-on-openshift/ 11 | FROM nginx:1.17 12 | COPY nginx-os4.conf /etc/nginx/nginx.conf 13 | WORKDIR /code 14 | COPY --from=BUILD /usr/src/app/dist . 15 | EXPOSE 8080:8080 16 | CMD ["nginx", "-g", "daemon off;"] 17 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | charset utf-8; 4 | sendfile on; 5 | root /usr/share/nginx/html; 6 | 7 | location / { 8 | expires -1; 9 | add_header Pragma "no-cache"; 10 | add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; 11 | 12 | try_files $uri $uri/ /index.html = 404; 13 | } 14 | } -------------------------------------------------------------------------------- /reactive/web-app-reactive/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "0.18.1", 11 | "bootstrap-vue": "2.0.0-rc.13", 12 | "vue": "2.6.6", 13 | "vue-router": "3.0.2", 14 | "vuex": "3.0.1" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "3.4.0", 18 | "@vue/cli-service": "3.4.0", 19 | "vue-template-compiler": "2.6.6" 20 | }, 21 | "postcss": { 22 | "plugins": { 23 | "autoprefixer": {} 24 | } 25 | }, 26 | "browserslist": [ 27 | "> 1%", 28 | "last 2 versions", 29 | "not ie <= 8" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/reactive/web-app-reactive/public/favicon.ico -------------------------------------------------------------------------------- /reactive/web-app-reactive/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Cloud Native Starter: web-app 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 32 | 33 | 35 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import store from './store' 4 | import router from './router'; 5 | import BootstrapVue from 'bootstrap-vue'; 6 | 7 | import 'bootstrap/dist/css/bootstrap.css'; 8 | import 'bootstrap-vue/dist/bootstrap-vue.css'; 9 | 10 | Vue.config.productionTip = false 11 | 12 | Vue.use(BootstrapVue); 13 | 14 | new Vue({ 15 | store, 16 | router, 17 | render: h => h(App) 18 | }).$mount('#app') 19 | -------------------------------------------------------------------------------- /reactive/web-app-reactive/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import Home from './components/Home.vue'; 4 | import Login from './components/Login.vue'; 5 | import CreateArticle from './components/CreateArticle.vue'; 6 | 7 | Vue.use(Router); 8 | 9 | export default new Router({ 10 | mode: 'history', 11 | routes: [ 12 | { 13 | path: '/', 14 | name: 'home', 15 | component: Home 16 | }, 17 | { 18 | path: '/loginwithtoken', 19 | name: 'loginwithtoken', 20 | component: Login 21 | }, 22 | { 23 | path: '/createarticle', 24 | name: 'createarticle', 25 | component: CreateArticle 26 | } 27 | ], 28 | }); -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | ### Directory scripts 2 | 3 | The scripts in this directory are used to setup, deploy, and delete Cloud Native Starter on Minikube. 4 | 5 | Instruction are [here](../README.md). -------------------------------------------------------------------------------- /scripts/delete-articles-java-jee-quarkus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting articles-java-jee-quarkus 13 | 14 | cd ${root_folder}/articles-java-jee 15 | kubectl delete -f deployment/kubernetes-quarkus.yaml --ignore-not-found 16 | kubectl delete -f deployment/istio-quarkus.yaml --ignore-not-found 17 | 18 | _out Done deleting articles-java-jee-quarkus 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/delete-articles-java-jee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting articles-java-jee 13 | 14 | cd ${root_folder}/articles-java-jee 15 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 16 | kubectl delete -f deployment/istio.yaml --ignore-not-found 17 | 18 | _out Done deleting articles-java-jee 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/delete-articles-java-spring-boot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting articles-java-spring-boot 13 | 14 | cd ${root_folder}/articles-java-spring-boot 15 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 16 | kubectl delete -f deployment/istio.yaml --ignore-not-found 17 | 18 | _out Done deleting articles-java-spring-boot 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/delete-authentication-nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting authentication-nodejs 13 | 14 | cd ${root_folder}/authentication-nodejs 15 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 16 | kubectl delete -f deployment/istio.yaml --ignore-not-found 17 | kubectl delete -f deployment/istio-egress.yaml --ignore-not-found 18 | 19 | _out Done deleting authentication-nodejs 20 | } 21 | 22 | setup -------------------------------------------------------------------------------- /scripts/delete-authors-java-spring-boot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting authors-java-spring-boot 13 | 14 | cd ${root_folder}/authors-java-spring-boot 15 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 16 | kubectl delete -f deployment/istio.yaml --ignore-not-found 17 | 18 | _out Done deleting authors-java-spring-boot 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/delete-authors-nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | _out Deleting authors-nodejs 14 | 15 | kubectl delete serviceentry cloudant --ignore-not-found 16 | kubectl delete gateway istio-egressgateway --ignore-not-found 17 | kubectl delete destinationrule egressgateway-for-cloudant --ignore-not-found 18 | cd ${root_folder}/authors-nodejs/deployment 19 | kubectl delete -f deployment.yaml --ignore-not-found 20 | kubectl delete -f istio.yaml --ignore-not-found 21 | 22 | _out Done deleting authors-nodejs 23 | } 24 | 25 | setup -------------------------------------------------------------------------------- /scripts/delete-istio-ingress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting Istio Ingress definitions 13 | 14 | cd ${root_folder}/istio 15 | kubectl delete -f istio-ingress-gateway.yaml --ignore-not-found 16 | kubectl delete -f istio-ingress-service-web-api-v1-v2-80-20.yaml --ignore-not-found 17 | 18 | _out Done deleting Istio Ingress definitions 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/delete-web-app-vuejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deleting web-app-vuejs 13 | 14 | cd ${root_folder}/web-app-vuejs 15 | kubectl delete -f deployment/kubernetes.yaml --ignore-not-found 16 | kubectl delete -f deployment/istio.yaml --ignore-not-found 17 | 18 | _out Done deleting web-app-vuejs 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/deploy-istio-ingress-v1-v2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying Istio Ingress definitions for web-api v1 and v2 80 20 13 | 14 | cd ${root_folder}/istio 15 | kubectl apply -f istio-ingress-gateway.yaml 16 | kubectl delete -f istio-ingress-service-web-api-v1-only.yaml --ignore-not-found 17 | kubectl apply -f istio-ingress-service-web-api-v1-v2-80-20.yaml 18 | 19 | _out Done deploying Istio Ingress definitions 20 | } 21 | 22 | setup -------------------------------------------------------------------------------- /scripts/deploy-istio-ingress-v1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | _out Deploying Istio Ingress definitions for web-api v1 only 13 | 14 | cd ${root_folder}/istio 15 | kubectl apply -f istio-ingress-gateway.yaml 16 | kubectl apply -f istio-ingress-service-web-api-v1-only.yaml 17 | 18 | _out Done deploying Istio Ingress definitions 19 | } 20 | 21 | setup -------------------------------------------------------------------------------- /scripts/display-logs-articles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | pod=$(kubectl get pods | grep articles | awk ' {print $1} ') 14 | _out $pod 15 | kubectl logs $pod articles 16 | 17 | } 18 | 19 | setup -------------------------------------------------------------------------------- /scripts/display-logs-authors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | pod=$(kubectl get pods | grep authors | awk ' {print $1} ') 14 | _out $pod 15 | kubectl logs $pod authors 16 | 17 | } 18 | 19 | setup -------------------------------------------------------------------------------- /scripts/display-logs-web-api.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | pod=$(kubectl get pods | grep web-api | awk ' {print $1} ') 14 | _out $pod 15 | kubectl logs $pod web-api 16 | 17 | } 18 | 19 | setup -------------------------------------------------------------------------------- /scripts/get-url-authors-nodejs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | 5 | exec 3>&1 6 | 7 | function _out() { 8 | echo "$(date +'%F %H:%M:%S') $@" 9 | } 10 | 11 | function setup() { 12 | 13 | ip=$(minikube ip) 14 | port=$(kubectl get svc authors -o jsonpath='{.spec.ports[0].nodePort}') 15 | 16 | url='http://'$ip:$port'/api/v1/getauthor?name=' 17 | echo $url 18 | 19 | } 20 | 21 | _out Authors API URL is: 22 | setup -------------------------------------------------------------------------------- /scripts/open-monitoring-grafana.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | logname="open-monitoring-grafana.log" 5 | 6 | function setupLog(){ 7 | cd "${root_folder}/scripts" 8 | readonly LOG_FILE="${root_folder}/scripts/$logname" 9 | touch $LOG_FILE 10 | exec 3>&1 # Save stdout 11 | exec 4>&2 # Save stderr 12 | exec 1>$LOG_FILE 2>&1 13 | exec 3>&1 14 | } 15 | 16 | function _out() { 17 | echo "$(date +'%F %H:%M:%S') $@" 18 | } 19 | 20 | function forwardPort(){ 21 | _out forward port Grafana 22 | kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 & 23 | } 24 | 25 | #exection starts from here 26 | 27 | setupLog 28 | forwardPort 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /scripts/open-monitoring-jaeger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | root_folder=$(cd $(dirname $0); cd ..; pwd) 4 | logname="open-monitoring-jaeger.log" 5 | 6 | function setupLog(){ 7 | cd "${root_folder}/scripts" 8 | readonly LOG_FILE="${root_folder}/scripts/$logname" 9 | touch $LOG_FILE 10 | exec 3>&1 # Save stdout 11 | exec 4>&2 # Save stderr 12 | exec 1>$LOG_FILE 2>&1 13 | exec 3>&1 14 | } 15 | 16 | function _out() { 17 | echo "$(date +'%F %H:%M:%S') $@" 18 | } 19 | 20 | function forwardPort(){ 21 | _out start Jaeger 22 | kubectl port-forward -n istio-system $(kubectl get pod -n istio-system -l app=jaeger -o jsonpath='{.items[0].metadata.name}') 16686:16686 23 | } 24 | 25 | #exection starts from here 26 | 27 | setupLog 28 | forwardPort -------------------------------------------------------------------------------- /scripts/open-monitoring-prometheus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | root_folder=$(cd $(dirname $0); cd ..; pwd) 3 | logname="open-monitoring-prometheus.log" 4 | 5 | function setupLog(){ 6 | cd "${root_folder}/scripts" 7 | readonly LOG_FILE="${root_folder}/scripts/$logname" 8 | touch $LOG_FILE 9 | exec 3>&1 # Save stdout 10 | exec 4>&2 # Save stderr 11 | exec 1>$LOG_FILE 2>&1 12 | exec 3>&1 13 | } 14 | 15 | function _out() { 16 | echo "$(date +'%F %H:%M:%S') $@" 17 | } 18 | 19 | function forwardPort(){ 20 | _out port forward Prometheus 21 | kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=prometheus -o jsonpath='{.items[0].metadata.name}') 9090:9090 & 22 | } 23 | 24 | #exection starts from here 25 | 26 | setupLog 27 | forwardPort -------------------------------------------------------------------------------- /security/IKS/authorization-w-rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: security.istio.io/v1beta1 2 | kind: AuthorizationPolicy 3 | metadata: 4 | name: articlesaccess 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: articles 9 | rules: 10 | - from: 11 | - source: 12 | principals: ["cluster.local/ns/default/sa/web-api"] 13 | to: 14 | - operation: 15 | methods: ["GET", "POST"] 16 | --- 17 | -------------------------------------------------------------------------------- /security/IKS/authorization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: security.istio.io/v1beta1 2 | kind: AuthorizationPolicy 3 | metadata: 4 | name: articlesaccess 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: articles 9 | --- 10 | -------------------------------------------------------------------------------- /security/IKS/configmap.yaml: -------------------------------------------------------------------------------- 1 | kind: ConfigMap 2 | apiVersion: v1 3 | metadata: 4 | name: security-url-config 5 | data: 6 | QUARKUS_OIDC_AUTH_SERVER_URL: "http://keycloak:8080/auth/realms/quarkus" 7 | 8 | -------------------------------------------------------------------------------- /security/IKS/istio-setup-ingress-gateway.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function createSubDomain() { 4 | ingress_ip=$(kubectl get svc -n istio-system | awk '/istio-ingressgateway/ {print $4}') 5 | ibmcloud ks nlb-dns create classic --cluster $MYCLUSTER --ip $ingress_ip 6 | } 7 | 8 | function getIngressURL() { 9 | ingress_url=$(ibmcloud ks nlb-dns ls --cluster $MYCLUSTER | awk '/-0001./ {print $1}') 10 | export INGRESSURL=$ingress_url 11 | echo "------------------------------------------------------------------------" 12 | echo Ingress-URL: $INGRESSURL 13 | echo Cluster Name: $MYCLUSTER 14 | echo "------------------------------------------------------------------------" 15 | } 16 | 17 | createSubDomain 18 | getIngressURL 19 | -------------------------------------------------------------------------------- /security/IKS/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: install.istio.io/v1alpha1 2 | kind: IstioOperator 3 | metadata: 4 | namespace: istio-system 5 | name: demo-istiocontrolplane 6 | spec: 7 | profile: demo 8 | -------------------------------------------------------------------------------- /security/IKS/mtls.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "security.istio.io/v1beta1" 2 | kind: "PeerAuthentication" 3 | metadata: 4 | name: "default" 5 | namespace: "default" 6 | spec: 7 | mtls: 8 | mode: STRICT 9 | -------------------------------------------------------------------------------- /security/IKS/oc-get-admin-password.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ADMIN_PASSWORD=$(oc get secret credential-example-keycloak -o go-template='{{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}') 3 | echo "Admin Password: $ADMIN_PASSWORD" -------------------------------------------------------------------------------- /security/IKS/oc-get-keycloak-urls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | KEYCLOAK_URL=https://$(oc get route keycloak --template='{{ .spec.host }}')/auth && 3 | echo "" && 4 | echo "Keycloak: $KEYCLOAK_URL" && 5 | echo "Keycloak Admin Console: $KEYCLOAK_URL/admin" && 6 | echo "Keycloak Account Console: $KEYCLOAK_URL/realms/myrealm/account" && 7 | echo "Keycloak [auth-server-url]: $KEYCLOAK_URL/realms/quarkus" 8 | -------------------------------------------------------------------------------- /security/KEYCLOAK-SETUP.md: -------------------------------------------------------------------------------- 1 | # Setup Keycloak 2 | 3 | ## Import the existing realm configuration 4 | 5 | ### STEP 1: Create new realm 6 | 7 | ![](images/keycloak-config-1.png) 8 | 9 | ### STEP 2: Import file `quarkus-realm.json` 10 | 11 | ![](images/keycloak-config-2.png) 12 | 13 | ### STEP 3: Verify the name `quarkus`of the imported realm 14 | 15 | ![](images/keycloak-config-3.png) 16 | 17 | ### STEP 4: Verify the imported realm settings 18 | 19 | ![](images/keycloak-config-4.png) 20 | 21 | ## Users and role mappings in existing realm 22 | 23 | ### STEP 1: Press `view all users` 24 | 25 | You should see following users: `admin`, `alice`, `jdoe` 26 | 27 | ![](images/keycloak-users.png) 28 | 29 | ### STEP 2: Verify the role mapping 30 | 31 | ![](images/keycloak-user.png) -------------------------------------------------------------------------------- /security/articles-secure/.dockerignore: -------------------------------------------------------------------------------- 1 | deployment/ 2 | target/ 3 | -------------------------------------------------------------------------------- /security/articles-secure/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/resources/META-INF/resources 2 | 3 | # Eclipse 4 | .project 5 | .classpath 6 | .settings/ 7 | bin/ 8 | 9 | # IntelliJ 10 | .idea 11 | *.ipr 12 | *.iml 13 | *.iws 14 | 15 | # NetBeans 16 | nb-configuration.xml 17 | 18 | # Visual Studio Code 19 | .vscode 20 | .factorypath 21 | 22 | # OSX 23 | .DS_Store 24 | 25 | # Vim 26 | *.swp 27 | *.swo 28 | 29 | # patch 30 | *.orig 31 | *.rej 32 | 33 | # Maven 34 | target/ 35 | pom.xml.tag 36 | pom.xml.releaseBackup 37 | pom.xml.versionsBackup 38 | release.properties -------------------------------------------------------------------------------- /security/articles-secure/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/articles-secure/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /security/articles-secure/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /security/articles-secure/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM adoptopenjdk/openjdk11-openj9:ubi-minimal 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | RUN mkdir /opt/shareclasses 11 | # OpenShift permissions: 12 | RUN chmod a+rwx -R /opt/shareclasses 13 | RUN mkdir /opt/app 14 | COPY --from=BUILD /usr/src/app/target/lib/* /opt/app/lib/ 15 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /opt/app/app.jar 16 | EXPOSE 8082 17 | CMD ["java", "-Xmx128m", "-XX:+IdleTuningGcOnIdle", "-Xtune:virtualized", "-Xscmx128m", "-Xscmaxaot100m", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/app/app.jar"] 18 | -------------------------------------------------------------------------------- /security/articles-secure/src/main/docker/Dockerfile.native: -------------------------------------------------------------------------------- 1 | #### 2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode 3 | # 4 | # Before building the docker image run: 5 | # 6 | # mvn package -Pnative -Dquarkus.native.container-build=true 7 | # 8 | # Then, build the image with: 9 | # 10 | # docker build -f src/main/docker/Dockerfile.native -t quarkus/web-api-secure . 11 | # 12 | # Then run the container using: 13 | # 14 | # docker run -i --rm -p 8080:8080 quarkus/web-api-secure 15 | # 16 | ### 17 | FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1 18 | WORKDIR /work/ 19 | COPY --chown=1001:root target/*-runner /work/application 20 | 21 | EXPOSE 8080 22 | USER 1001 23 | 24 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] -------------------------------------------------------------------------------- /security/articles-secure/src/main/java/com/ibm/webapi/Article.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | public class Article { 4 | 5 | public Article() { 6 | } 7 | 8 | public String id; 9 | public String title; 10 | public String url; 11 | public String authorName; 12 | 13 | } -------------------------------------------------------------------------------- /security/articles-secure/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | // When running locally, uncomment the next line, add your Keycloak URL, must end on '/auth/realms/quarkus' 2 | quarkus.oidc.auth-server-url=https://YOUR_URL/auth/realms/quarkus 3 | 4 | quarkus.oidc.client-id=backend-service 5 | quarkus.oidc.credentials.secret=secret 6 | 7 | quarkus.http.port=8082 8 | quarkus.http.cors=true 9 | 10 | resteasy.role.based.security=true 11 | -------------------------------------------------------------------------------- /security/images/application-sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/application-sample.gif -------------------------------------------------------------------------------- /security/images/architecture-local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/architecture-local.png -------------------------------------------------------------------------------- /security/images/keycloak-config-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-config-1.png -------------------------------------------------------------------------------- /security/images/keycloak-config-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-config-2.png -------------------------------------------------------------------------------- /security/images/keycloak-config-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-config-3.png -------------------------------------------------------------------------------- /security/images/keycloak-config-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-config-4.png -------------------------------------------------------------------------------- /security/images/keycloak-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-content.png -------------------------------------------------------------------------------- /security/images/keycloak-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-setup-01.png -------------------------------------------------------------------------------- /security/images/keycloak-setup-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-setup-02.png -------------------------------------------------------------------------------- /security/images/keycloak-setup-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-setup-03.png -------------------------------------------------------------------------------- /security/images/keycloak-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-user.png -------------------------------------------------------------------------------- /security/images/keycloak-users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/images/keycloak-users.png -------------------------------------------------------------------------------- /security/web-api-secure/.dockerignore: -------------------------------------------------------------------------------- 1 | deployment/ 2 | target/ 3 | -------------------------------------------------------------------------------- /security/web-api-secure/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/resources/META-INF/resources 2 | 3 | # Eclipse 4 | .project 5 | .classpath 6 | .settings/ 7 | bin/ 8 | 9 | # IntelliJ 10 | .idea 11 | *.ipr 12 | *.iml 13 | *.iws 14 | 15 | # NetBeans 16 | nb-configuration.xml 17 | 18 | # Visual Studio Code 19 | .vscode 20 | .factorypath 21 | 22 | # OSX 23 | .DS_Store 24 | 25 | # Vim 26 | *.swp 27 | *.swo 28 | 29 | # patch 30 | *.orig 31 | *.rej 32 | 33 | # Maven 34 | target/ 35 | pom.xml.tag 36 | pom.xml.releaseBackup 37 | pom.xml.versionsBackup 38 | release.properties -------------------------------------------------------------------------------- /security/web-api-secure/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/web-api-secure/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /security/web-api-secure/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /security/web-api-secure/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/maven-openjdk11 as BUILD 2 | COPY src /usr/src/app/src 3 | COPY pom.xml /usr/src/app 4 | WORKDIR /usr/src/app 5 | RUN mvn package 6 | 7 | FROM adoptopenjdk/openjdk11-openj9:ubi-minimal 8 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 9 | ENV AB_ENABLED=jmx_exporter 10 | RUN mkdir /opt/shareclasses 11 | # OpenShift permissions: 12 | RUN chmod a+rwx -R /opt/shareclasses 13 | RUN mkdir /opt/app 14 | COPY --from=BUILD /usr/src/app/target/lib/* /opt/app/lib/ 15 | COPY --from=BUILD /usr/src/app/target/*-runner.jar /opt/app/app.jar 16 | EXPOSE 8081 17 | CMD ["java", "-Xmx128m", "-XX:+IdleTuningGcOnIdle", "-Xtune:virtualized", "-Xscmx128m", "-Xscmaxaot100m", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/app/app.jar"] 18 | -------------------------------------------------------------------------------- /security/web-api-secure/deployment/web-api-sa.yaml: -------------------------------------------------------------------------------- 1 | kind: Deployment 2 | apiVersion: apps/v1 3 | metadata: 4 | name: web-api 5 | labels: 6 | app: web-api 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: web-api 11 | replicas: 1 12 | template: 13 | metadata: 14 | annotations: 15 | sidecar.istio.io/inject: "true" 16 | labels: 17 | app: web-api 18 | version: v1 19 | spec: 20 | serviceAccountName: web-api 21 | containers: 22 | - name: web-api 23 | image: docker.io/haraldu/web-api:secure-v1 24 | imagePullPolicy: Always 25 | ports: 26 | - containerPort: 8081 27 | env: 28 | - name: QUARKUS_OIDC_AUTH_SERVER_URL 29 | valueFrom: 30 | configMapKeyRef: 31 | name: security-url-config 32 | key: QUARKUS_OIDC_AUTH_SERVER_URL 33 | -------------------------------------------------------------------------------- /security/web-api-secure/src/main/docker/Dockerfile.native: -------------------------------------------------------------------------------- 1 | #### 2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode 3 | # 4 | # Before building the docker image run: 5 | # 6 | # mvn package -Pnative -Dquarkus.native.container-build=true 7 | # 8 | # Then, build the image with: 9 | # 10 | # docker build -f src/main/docker/Dockerfile.native -t quarkus/web-api-secure . 11 | # 12 | # Then run the container using: 13 | # 14 | # docker run -i --rm -p 8080:8080 quarkus/web-api-secure 15 | # 16 | ### 17 | FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1 18 | WORKDIR /work/ 19 | COPY --chown=1001:root target/*-runner /work/application 20 | 21 | EXPOSE 8080 22 | USER 1001 23 | 24 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/Article.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | public class Article { 4 | 5 | public Article() { 6 | } 7 | 8 | public String id; 9 | public String title; 10 | public String url; 11 | public String authorName; 12 | public String authorTwitter; 13 | public String authorBlog; 14 | 15 | } -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/ArticlesService.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; 4 | import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; 5 | import javax.ws.rs.*; 6 | import javax.ws.rs.core.MediaType; 7 | import java.util.List; 8 | import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; 9 | 10 | @RegisterClientHeaders 11 | @RegisterRestClient 12 | @RegisterProvider(ExceptionMapperArticles.class) 13 | public interface ArticlesService { 14 | 15 | @GET 16 | @Produces(MediaType.APPLICATION_JSON) 17 | List getArticlesFromService(@QueryParam("amount") int amount); 18 | } -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/CoreArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | public class CoreArticle { 4 | 5 | public String title; 6 | public String url; 7 | public String author; 8 | public String id; 9 | 10 | } -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/ExceptionMapperArticles.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | import com.ibm.webapi.InvalidArticle; 4 | import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; 5 | 6 | import javax.ws.rs.core.MultivaluedMap; 7 | import javax.ws.rs.core.Response; 8 | import javax.ws.rs.ext.Provider; 9 | 10 | @Provider 11 | public class ExceptionMapperArticles implements ResponseExceptionMapper { 12 | 13 | @Override 14 | public boolean handles(int status, MultivaluedMap headers) { 15 | return status == 204; 16 | } 17 | 18 | @Override 19 | public InvalidArticle toThrowable(Response response) { 20 | if (response.getStatus() == 204) 21 | return new InvalidArticle(); 22 | return null; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/InvalidArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | public class InvalidArticle extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidArticle() { 8 | } 9 | 10 | public InvalidArticle(String message) { 11 | super(message); 12 | } 13 | 14 | public InvalidArticle(Throwable cause) { 15 | super(cause); 16 | } 17 | } -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/NoConnectivity.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | public class NoConnectivity extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoConnectivity() { 8 | } 9 | 10 | public NoConnectivity(String message) { 11 | super(message); 12 | } 13 | 14 | public NoConnectivity(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /security/web-api-secure/src/main/java/com/ibm/webapi/NoDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi; 2 | 3 | public class NoDataAccess extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoDataAccess() { 8 | } 9 | 10 | public NoDataAccess(String message) { 11 | super(message); 12 | } 13 | 14 | public NoDataAccess(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /security/web-api-secure/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # When running locally, uncomment the next line, add your Keycloak URL, must end on '/auth/realms/quarkus' 2 | quarkus.oidc.auth-server-url=https://YOUR-URL/auth/realms/quarkus 3 | 4 | quarkus.oidc.client-id=backend-service 5 | quarkus.oidc.credentials.secret=secret 6 | 7 | quarkus.http.port=8081 8 | quarkus.http.cors=true 9 | 10 | org.eclipse.microprofile.rest.client.propagateHeaders=Authorization 11 | 12 | -------------------------------------------------------------------------------- /security/web-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY public /usr/src/app/public 5 | COPY package.json /usr/src/app/ 6 | COPY babel.config.js /usr/src/app/ 7 | 8 | WORKDIR /usr/src/app/ 9 | RUN yarn install 10 | RUN yarn build 11 | 12 | 13 | FROM nginx:latest 14 | COPY nginx.conf /etc/nginx/conf.d/default.conf 15 | COPY --from=BUILD /usr/src/app/dist /usr/share/nginx/html -------------------------------------------------------------------------------- /security/web-app/Dockerfile.os4: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine as BUILD 2 | COPY src /usr/src/app/src 3 | COPY public /usr/src/app/public 4 | COPY package.json /usr/src/app/ 5 | COPY babel.config.js /usr/src/app/ 6 | WORKDIR /usr/src/app/ 7 | RUN yarn install 8 | RUN yarn build 9 | 10 | # https://blog.openshift.com/deploy-vuejs-applications-on-openshift/ 11 | FROM nginx:1.17 12 | COPY nginx-os4.conf /etc/nginx/nginx.conf 13 | WORKDIR /code 14 | COPY --from=BUILD /usr/src/app/dist . 15 | # Change to non-root privilege 16 | # RUN useradd -u 8877 worker 17 | # USER worker 18 | EXPOSE 8080:8080 19 | CMD ["nginx", "-g", "daemon off;"] 20 | -------------------------------------------------------------------------------- /security/web-app/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /security/web-app/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | charset utf-8; 4 | sendfile on; 5 | root /usr/share/nginx/html; 6 | 7 | location / { 8 | expires -1; 9 | add_header Pragma "no-cache"; 10 | add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; 11 | 12 | try_files $uri $uri/ /index.html = 404; 13 | } 14 | } -------------------------------------------------------------------------------- /security/web-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build --dest dist" 8 | }, 9 | "dependencies": { 10 | "axios": "0.18.1", 11 | "bootstrap-vue": "2.0.0-rc.13", 12 | "keycloak-js": "10.0.2", 13 | "vue": "2.6.6", 14 | "vue-router": "3.0.2", 15 | "vuex": "3.0.1" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "3.4.0", 19 | "@vue/cli-service": "3.4.0", 20 | "vue-template-compiler": "2.6.6" 21 | }, 22 | "postcss": { 23 | "plugins": { 24 | "autoprefixer": {} 25 | } 26 | }, 27 | "browserslist": [ 28 | "> 1%", 29 | "last 2 versions", 30 | "not ie <= 8" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /security/web-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/security/web-app/public/favicon.ico -------------------------------------------------------------------------------- /security/web-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Cloud Native Starter: web-app 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /security/web-app/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import Home from './components/Home.vue'; 4 | 5 | Vue.use(Router); 6 | 7 | export default new Router({ 8 | mode: 'history', 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'home', 13 | component: Home 14 | } 15 | ], 16 | }); -------------------------------------------------------------------------------- /template.local.env: -------------------------------------------------------------------------------- 1 | IBMCLOUD_API_KEY=xxx 2 | IBM_CLOUD_REGION=us-south 3 | CLUSTER_NAME=cloud-native 4 | REGISTRY_NAMESPACE=cloud-native 5 | IBM_CLOUD_CF_API=https://api.ng.bluemix.net 6 | IBM_CLOUD_CF_ORG= 7 | IBM_CLOUD_CF_SPACE=dev 8 | AUTHORS_DB=local 9 | CLOUDANT_URL= 10 | 11 | ## OpenShift 4 Env 12 | APITOKEN= 13 | OS4SERVER= 14 | PROJECT=cloud-native-starter 15 | REGISTRY=image-registry.openshift-image-registry.svc:5000 16 | REGISTRYURL= 17 | ## End OpenShift 4 Env 18 | 19 | -------------------------------------------------------------------------------- /web-api-java-jee/.dockerignore: -------------------------------------------------------------------------------- 1 | .apt_generated 2 | .apt_generated_tests 3 | .settings 4 | deployment 5 | target/articles 6 | target/classes 7 | target/generated-sources 8 | target/lib 9 | target/maven-archiver 10 | target/maven-status 11 | target/reports 12 | target/test-classes 13 | target/transformed-classes 14 | target/wiring-classes 15 | target/wiring-devmode -------------------------------------------------------------------------------- /web-api-java-jee/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM open-liberty:19.0.0.9-kernel-java11 2 | 3 | COPY liberty-opentracing-zipkintracer /opt/ol/wlp/usr/ 4 | COPY liberty/server.xml /config/ 5 | COPY key.jks /config/ 6 | 7 | ADD target/web-api.war /config/dropins/ 8 | 9 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 10 | # https://github.com/WASdev/ci.docker 11 | RUN configure.sh 12 | 13 | EXPOSE 9080 -------------------------------------------------------------------------------- /web-api-java-jee/Dockerfile.java: -------------------------------------------------------------------------------- 1 | FROM open-liberty:19.0.0.9-kernel-java11 2 | 3 | COPY liberty-opentracing-zipkintracer /opt/ol/wlp/usr/ 4 | COPY liberty/server.xml /config/ 5 | COPY key.jks /config/ 6 | 7 | ADD target/web-api.war /config/dropins/ 8 | 9 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 10 | # https://github.com/WASdev/ci.docker 11 | RUN configure.sh 12 | 13 | EXPOSE 9080 -------------------------------------------------------------------------------- /web-api-java-jee/Dockerfile.nojava: -------------------------------------------------------------------------------- 1 | FROM maven:3.5-jdk-8 as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY pom.xml /usr/src/app 5 | RUN mvn -f /usr/src/app/pom.xml clean package 6 | 7 | 8 | FROM open-liberty:19.0.0.9-kernel-java11 9 | 10 | COPY liberty-opentracing-zipkintracer /opt/ol/wlp/usr/ 11 | 12 | COPY liberty/server.xml /config/ 13 | 14 | COPY key.jks /config/ 15 | 16 | COPY --from=BUILD /usr/src/app/target/web-api.war /config/dropins/ 17 | 18 | # This script will add the requested XML snippets, grow image to be fit-for-purpose and apply interim fixes 19 | # https://github.com/WASdev/ci.docker 20 | RUN configure.sh 21 | 22 | EXPOSE 9080 -------------------------------------------------------------------------------- /web-api-java-jee/deployment/istio-service-v1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: web-api 5 | spec: 6 | host: web-api 7 | subsets: 8 | - name: v1 9 | labels: 10 | version: v1 11 | --- -------------------------------------------------------------------------------- /web-api-java-jee/deployment/istio-service-v2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: web-api 5 | spec: 6 | host: web-api 7 | subsets: 8 | - name: v1 9 | labels: 10 | version: v1 11 | - name: v2 12 | labels: 13 | version: v2 14 | --- -------------------------------------------------------------------------------- /web-api-java-jee/deployment/kubernetes-service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | annotations: 5 | webapi: "true" 6 | name: web-api 7 | labels: 8 | app: web-api 9 | spec: 10 | selector: 11 | app: web-api 12 | ports: 13 | - port: 9080 14 | name: http 15 | type: NodePort 16 | --- 17 | -------------------------------------------------------------------------------- /web-api-java-jee/key.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/web-api-java-jee/key.jks -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/apis/HealthEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.apis; 2 | 3 | import org.eclipse.microprofile.health.Readiness; 4 | import org.eclipse.microprofile.health.HealthCheck; 5 | import org.eclipse.microprofile.health.HealthCheckResponse; 6 | 7 | import javax.enterprise.context.ApplicationScoped; 8 | 9 | @Readiness 10 | @ApplicationScoped 11 | public class HealthEndpoint implements HealthCheck { 12 | 13 | @Override 14 | public HealthCheckResponse call() { 15 | return HealthCheckResponse.named("web-api").withData("web-api", "ok").up().build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/apis/JAXRSConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.apis; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JAXRSConfiguration extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/apis/ManageResponse.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.apis; 2 | 3 | public class ManageResponse { 4 | 5 | public String message; 6 | 7 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/business/Article.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class Article { 4 | 5 | public String id; 6 | public String title; 7 | public String url; 8 | public String authorName; 9 | public String authorTwitter; 10 | public String authorBlog; 11 | 12 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/business/Author.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class Author { 4 | 5 | public String name; 6 | public String twitter; 7 | public String blog; 8 | 9 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/business/CoreArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class CoreArticle { 4 | 5 | public String title; 6 | public String url; 7 | public String author; 8 | public String id; 9 | 10 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/business/InvalidArticle.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class InvalidArticle extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidArticle() { 8 | } 9 | 10 | public InvalidArticle(String message) { 11 | super(message); 12 | } 13 | 14 | public InvalidArticle(Throwable cause) { 15 | super(cause); 16 | } 17 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/business/NoDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class NoDataAccess extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoDataAccess() { 8 | } 9 | 10 | public NoDataAccess(String message) { 11 | super(message); 12 | } 13 | 14 | public NoDataAccess(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/business/NonexistentAuthor.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.business; 2 | 3 | public class NonexistentAuthor extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2L; 6 | 7 | public NonexistentAuthor() { 8 | } 9 | 10 | public NonexistentAuthor(String message) { 11 | super(message); 12 | } 13 | 14 | public NonexistentAuthor(Throwable cause) { 15 | super(cause); 16 | } 17 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/ArticlesDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import java.util.List; 4 | import com.ibm.webapi.business.CoreArticle; 5 | import com.ibm.webapi.business.InvalidArticle; 6 | 7 | public interface ArticlesDataAccess { 8 | public CoreArticle addArticle(CoreArticle article) throws NoConnectivity, InvalidArticle; 9 | 10 | public List getArticles(int amount) throws NoConnectivity; 11 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/ArticlesService.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import java.util.List; 4 | import javax.ws.rs.Consumes; 5 | import javax.ws.rs.GET; 6 | import javax.ws.rs.POST; 7 | import javax.ws.rs.Produces; 8 | import javax.ws.rs.core.MediaType; 9 | import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; 10 | import com.ibm.webapi.business.CoreArticle; 11 | import com.ibm.webapi.business.InvalidArticle; 12 | 13 | @RegisterProvider(ExceptionMapperArticles.class) 14 | public interface ArticlesService { 15 | 16 | @GET 17 | @Produces(MediaType.APPLICATION_JSON) 18 | public List getArticlesFromService(); 19 | 20 | @POST 21 | @Consumes(MediaType.APPLICATION_JSON) 22 | @Produces(MediaType.APPLICATION_JSON) 23 | public CoreArticle addArticle(CoreArticle article) throws InvalidArticle; 24 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/AuthorsDataAccess.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import com.ibm.webapi.business.Author; 4 | import com.ibm.webapi.business.NonexistentAuthor; 5 | 6 | public interface AuthorsDataAccess { 7 | public Author getAuthor(String name) throws NoConnectivity, NonexistentAuthor; 8 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/AuthorsService.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import javax.ws.rs.GET; 4 | import javax.ws.rs.Produces; 5 | import javax.ws.rs.core.MediaType; 6 | import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; 7 | import com.ibm.webapi.business.Author; 8 | import com.ibm.webapi.business.NonexistentAuthor; 9 | 10 | @RegisterProvider(ExceptionMapperArticles.class) 11 | public interface AuthorsService { 12 | 13 | @GET 14 | @Produces(MediaType.APPLICATION_JSON) 15 | public Author getAuthor(String name) throws NonexistentAuthor; 16 | 17 | } -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/DataAccessManager.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import javax.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class DataAccessManager { 7 | 8 | public static ArticlesDataAccess getArticlesDataAccess() { 9 | if (singletonArticles == null) { 10 | singletonArticles = new ArticlesServiceDataAccess(); 11 | } 12 | return singletonArticles; 13 | } 14 | 15 | private static ArticlesDataAccess singletonArticles = null; 16 | 17 | public static AuthorsDataAccess getAuthorsDataAccess() { 18 | if (singletonAuthors == null) { 19 | singletonAuthors = new AuthorsServiceDataAccess(); 20 | } 21 | return singletonAuthors; 22 | } 23 | 24 | private static AuthorsDataAccess singletonAuthors = null; 25 | } 26 | -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/ExceptionMapperArticles.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import javax.ws.rs.core.MultivaluedMap; 4 | import javax.ws.rs.core.Response; 5 | import javax.ws.rs.ext.Provider; 6 | import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; 7 | import com.ibm.webapi.business.InvalidArticle; 8 | 9 | @Provider 10 | public class ExceptionMapperArticles implements ResponseExceptionMapper { 11 | 12 | @Override 13 | public boolean handles(int status, MultivaluedMap headers) { 14 | return status == 204; 15 | } 16 | 17 | @Override 18 | public InvalidArticle toThrowable(Response response) { 19 | switch (response.getStatus()) { 20 | case 204: 21 | return new InvalidArticle(); 22 | } 23 | return null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/ExceptionMapperAuthors.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | import javax.ws.rs.core.MultivaluedMap; 4 | import javax.ws.rs.core.Response; 5 | import javax.ws.rs.ext.Provider; 6 | import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; 7 | import com.ibm.webapi.business.NonexistentAuthor; 8 | 9 | @Provider 10 | public class ExceptionMapperAuthors implements ResponseExceptionMapper { 11 | 12 | @Override 13 | public boolean handles(int status, MultivaluedMap headers) { 14 | return status == 204; 15 | } 16 | 17 | @Override 18 | public NonexistentAuthor toThrowable(Response response) { 19 | switch (response.getStatus()) { 20 | case 204: 21 | return new NonexistentAuthor(); 22 | } 23 | return null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web-api-java-jee/src/main/java/com/ibm/webapi/data/NoConnectivity.java: -------------------------------------------------------------------------------- 1 | package com.ibm.webapi.data; 2 | 3 | public class NoConnectivity extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public NoConnectivity() { 8 | } 9 | 10 | public NoConnectivity(String message) { 11 | super(message); 12 | } 13 | 14 | public NoConnectivity(Throwable cause) { 15 | super(cause); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web-app-vuejs/.dockerignore: -------------------------------------------------------------------------------- 1 | deployment 2 | dist 3 | node_modules -------------------------------------------------------------------------------- /web-app-vuejs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY public /usr/src/app/public 5 | COPY package.json /usr/src/app/ 6 | COPY babel.config.js /usr/src/app/ 7 | 8 | WORKDIR /usr/src/app/ 9 | RUN yarn install 10 | RUN yarn build 11 | 12 | 13 | FROM nginx:latest 14 | COPY nginx.conf /etc/nginx/conf.d/default.conf 15 | COPY --from=BUILD /usr/src/app/dist /usr/share/nginx/html -------------------------------------------------------------------------------- /web-app-vuejs/Dockerfile.nonroot: -------------------------------------------------------------------------------- 1 | FROM node:8-alpine as BUILD 2 | 3 | COPY src /usr/src/app/src 4 | COPY public /usr/src/app/public 5 | COPY package.json /usr/src/app/ 6 | COPY babel.config.js /usr/src/app/ 7 | 8 | WORKDIR /usr/src/app/ 9 | RUN yarn install 10 | RUN yarn build 11 | 12 | 13 | FROM nginx:alpine 14 | 15 | COPY nginx-8081.conf /etc/nginx/nginx.conf 16 | COPY --from=BUILD /usr/src/app/dist /usr/share/nginx/html 17 | 18 | RUN mkdir -p /var/cache/nginx/client_temp && \ 19 | chmod -R 777 /var/log/nginx /var/cache/nginx /var/run \ 20 | && chgrp -R 0 /etc/nginx \ 21 | && chmod -R g+rwX /etc/nginx \ 22 | && rm /etc/nginx/conf.d/default.conf 23 | 24 | EXPOSE 8081 25 | -------------------------------------------------------------------------------- /web-app-vuejs/Dockerfile.os4: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine as BUILD 2 | COPY src /usr/src/app/src 3 | COPY public /usr/src/app/public 4 | COPY package.json /usr/src/app/ 5 | COPY babel.config.js /usr/src/app/ 6 | WORKDIR /usr/src/app/ 7 | RUN yarn install 8 | RUN yarn build 9 | 10 | # https://blog.openshift.com/deploy-vuejs-applications-on-openshift/ 11 | FROM nginx:1.17 12 | COPY nginx-os4.conf /etc/nginx/nginx.conf 13 | WORKDIR /code 14 | COPY --from=BUILD /usr/src/app/dist . 15 | EXPOSE 8080:8080 16 | CMD ["nginx", "-g", "daemon off;"] 17 | -------------------------------------------------------------------------------- /web-app-vuejs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /web-app-vuejs/deployment/istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: web-app 5 | spec: 6 | host: web-app 7 | subsets: 8 | - name: v1 9 | labels: 10 | version: v1 11 | --- 12 | -------------------------------------------------------------------------------- /web-app-vuejs/deployment/kubernetes-minishift.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: web-app 5 | labels: 6 | app: web-app 7 | spec: 8 | selector: 9 | app: web-app 10 | ports: 11 | - port: 80 12 | name: http 13 | type: NodePort 14 | --- 15 | 16 | kind: Deployment 17 | apiVersion: apps/v1beta1 18 | metadata: 19 | name: web-app 20 | spec: 21 | replicas: 1 22 | template: 23 | metadata: 24 | annotations: 25 | sidecar.istio.io/inject: "true" 26 | labels: 27 | app: web-app 28 | version: v1 29 | spec: 30 | containers: 31 | - name: web-app 32 | image: Running this command requires a running 'istio' VM, but no VM is running./cloud-native-starter/web-app:latest 33 | ports: 34 | - containerPort: 80 35 | restartPolicy: Always 36 | --- 37 | -------------------------------------------------------------------------------- /web-app-vuejs/deployment/kubernetes-openshift.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: web-app 5 | labels: 6 | app: web-app 7 | spec: 8 | selector: 9 | app: web-app 10 | ports: 11 | - port: 80 12 | name: http 13 | type: NodePort 14 | --- 15 | 16 | kind: Deployment 17 | apiVersion: apps/v1beta1 18 | metadata: 19 | name: web-app 20 | spec: 21 | replicas: 1 22 | template: 23 | metadata: 24 | annotations: 25 | sidecar.istio.io/inject: "true" 26 | labels: 27 | app: web-app 28 | version: v1 29 | spec: 30 | containers: 31 | - name: web-app 32 | image: docker-registry.default.svc:5000/cloud-native-starter/web-app:1 33 | ports: 34 | - containerPort: 80 35 | restartPolicy: Always 36 | --- 37 | -------------------------------------------------------------------------------- /web-app-vuejs/deployment/kubernetes.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: web-app 5 | labels: 6 | app: web-app 7 | spec: 8 | selector: 9 | app: web-app 10 | ports: 11 | - port: 80 12 | name: http 13 | type: NodePort 14 | --- 15 | 16 | kind: Deployment 17 | apiVersion: apps/v1 18 | metadata: 19 | name: web-app 20 | labels: 21 | app: web-app 22 | spec: 23 | selector: 24 | matchLabels: 25 | app: web-app 26 | replicas: 1 27 | template: 28 | metadata: 29 | annotations: 30 | sidecar.istio.io/inject: "true" 31 | labels: 32 | app: web-app 33 | version: v1 34 | spec: 35 | containers: 36 | - name: web-app 37 | image: web-app:1 38 | ports: 39 | - containerPort: 80 40 | restartPolicy: Always 41 | --- 42 | -------------------------------------------------------------------------------- /web-app-vuejs/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | charset utf-8; 4 | sendfile on; 5 | root /usr/share/nginx/html; 6 | 7 | location / { 8 | expires -1; 9 | add_header Pragma "no-cache"; 10 | add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; 11 | 12 | try_files $uri $uri/ /index.html = 404; 13 | } 14 | } -------------------------------------------------------------------------------- /web-app-vuejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "0.18.1", 11 | "bootstrap-vue": "2.0.0-rc.13", 12 | "vue": "2.6.6", 13 | "vue-router": "3.0.2", 14 | "vuex": "3.0.1" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "3.4.0", 18 | "@vue/cli-service": "3.4.0", 19 | "vue-template-compiler": "2.6.6" 20 | }, 21 | "postcss": { 22 | "plugins": { 23 | "autoprefixer": {} 24 | } 25 | }, 26 | "browserslist": [ 27 | "> 1%", 28 | "last 2 versions", 29 | "not ie <= 8" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /web-app-vuejs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/web-app-vuejs/public/favicon.ico -------------------------------------------------------------------------------- /web-app-vuejs/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Cloud Native Starter: web-app 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /web-app-vuejs/src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 32 | 33 | 35 | -------------------------------------------------------------------------------- /web-app-vuejs/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import store from './store' 4 | import router from './router'; 5 | import BootstrapVue from 'bootstrap-vue'; 6 | 7 | import 'bootstrap/dist/css/bootstrap.css'; 8 | import 'bootstrap-vue/dist/bootstrap-vue.css'; 9 | 10 | Vue.config.productionTip = false 11 | 12 | Vue.use(BootstrapVue); 13 | 14 | new Vue({ 15 | store, 16 | router, 17 | render: h => h(App) 18 | }).$mount('#app') 19 | -------------------------------------------------------------------------------- /web-app-vuejs/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import Home from './components/Home.vue'; 4 | import Login from './components/Login.vue'; 5 | import CreateArticle from './components/CreateArticle.vue'; 6 | 7 | Vue.use(Router); 8 | 9 | export default new Router({ 10 | mode: 'history', 11 | routes: [ 12 | { 13 | path: '/', 14 | name: 'home', 15 | component: Home 16 | }, 17 | { 18 | path: '/loginwithtoken', 19 | name: 'loginwithtoken', 20 | component: Login 21 | }, 22 | { 23 | path: '/createarticle', 24 | name: 'createarticle', 25 | component: CreateArticle 26 | } 27 | ], 28 | }); -------------------------------------------------------------------------------- /workshop-one-service/images/cnsl1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop-one-service/images/cnsl1.png -------------------------------------------------------------------------------- /workshop/images/architecture-authors.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/architecture-authors.gif -------------------------------------------------------------------------------- /workshop/images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/architecture.png -------------------------------------------------------------------------------- /workshop/images/architecture.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/architecture.pptx -------------------------------------------------------------------------------- /workshop/images/authors-java-classdiagram-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-classdiagram-01.png -------------------------------------------------------------------------------- /workshop/images/authors-java-classdiagram-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-classdiagram-02.png -------------------------------------------------------------------------------- /workshop/images/authors-java-container-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-container-image.png -------------------------------------------------------------------------------- /workshop/images/authors-java-container-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-container-overview.png -------------------------------------------------------------------------------- /workshop/images/authors-java-health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-health.png -------------------------------------------------------------------------------- /workshop/images/authors-java-kubernetes-deployment-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-kubernetes-deployment-overview.png -------------------------------------------------------------------------------- /workshop/images/authors-java-openapi-explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-openapi-explorer.png -------------------------------------------------------------------------------- /workshop/images/authors-java-service-pod-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/authors-java-service-pod-container.png -------------------------------------------------------------------------------- /workshop/images/classoverview-articles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/classoverview-articles.jpg -------------------------------------------------------------------------------- /workshop/images/classoverview-webapi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/classoverview-webapi.jpg -------------------------------------------------------------------------------- /workshop/images/cns-basic-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-basic-setup-01.png -------------------------------------------------------------------------------- /workshop/images/cns-container-articels-service-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-container-articels-service-03.png -------------------------------------------------------------------------------- /workshop/images/cns-container-deployment-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-container-deployment-01.png -------------------------------------------------------------------------------- /workshop/images/cns-container-deployment-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-container-deployment-02.png -------------------------------------------------------------------------------- /workshop/images/cns-container-web-api-v1-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-container-web-api-v1-04.png -------------------------------------------------------------------------------- /workshop/images/cns-container-web-app-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-container-web-app-05.png -------------------------------------------------------------------------------- /workshop/images/cns-introduction-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/cns-introduction-01.png -------------------------------------------------------------------------------- /workshop/images/dockerhub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/dockerhub.png -------------------------------------------------------------------------------- /workshop/images/docs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/docs.gif -------------------------------------------------------------------------------- /workshop/images/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/email.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-cluster-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-cluster-02.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-cluster-access.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-cluster-access.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-cluster.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-key.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-pods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-pods.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-registry-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-registry-container.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-registry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-registry.png -------------------------------------------------------------------------------- /workshop/images/ibm-cloud-services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/ibm-cloud-services.png -------------------------------------------------------------------------------- /workshop/images/istio-installation-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/istio-installation-01.png -------------------------------------------------------------------------------- /workshop/images/istio-installation-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/istio-installation-02.png -------------------------------------------------------------------------------- /workshop/images/microprofile-starter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/microprofile-starter.gif -------------------------------------------------------------------------------- /workshop/images/microprofiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/microprofiles.png -------------------------------------------------------------------------------- /workshop/images/registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/registration.png -------------------------------------------------------------------------------- /workshop/images/resliency-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/resliency-01.png -------------------------------------------------------------------------------- /workshop/images/resliency-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/resliency-02.png -------------------------------------------------------------------------------- /workshop/images/rest-api-classdiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/rest-api-classdiagram.png -------------------------------------------------------------------------------- /workshop/images/rest-api-open-api.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/rest-api-open-api.gif -------------------------------------------------------------------------------- /workshop/images/rest-api-sequencediagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/rest-api-sequencediagram.png -------------------------------------------------------------------------------- /workshop/images/traffic-new-architecture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-new-architecture.gif -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment01.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment02.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment03.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment04.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment05.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment06.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment07.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment07.gif -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment08.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment09.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment10.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment11.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment12.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment13.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment14.png -------------------------------------------------------------------------------- /workshop/images/traffic-routing-deployment15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing-deployment15.gif -------------------------------------------------------------------------------- /workshop/images/traffic-routing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/traffic-routing.gif -------------------------------------------------------------------------------- /workshop/images/windows-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/windows-setup-01.png -------------------------------------------------------------------------------- /workshop/images/windows-setup-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/cloud-native-starter/62f55c434c6928847981af9ef171550df827fbec/workshop/images/windows-setup-02.png --------------------------------------------------------------------------------