{"id":21712251,"url":"https://github.com/ashutoshsahoo/spring-boot-kubernetes-mysql","last_synced_at":"2025-08-19T04:31:34.611Z","repository":{"id":44117701,"uuid":"112958110","full_name":"ashutoshsahoo/spring-boot-kubernetes-mysql","owner":"ashutoshsahoo","description":"Demo project for Spring Boot,Kubernetes, MySQL with PVC","archived":false,"fork":false,"pushed_at":"2024-06-14T08:33:10.000Z","size":37,"stargazers_count":21,"open_issues_count":2,"forks_count":48,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-09T20:54:14.498Z","etag":null,"topics":["dockerfile","gradle","java","kubernetes","mysql","mysql-database","mysql-replication","palantir-docker","pvc","spring","spring-boot","spring-boot-3","spring-boot-kubernetes"],"latest_commit_sha":null,"homepage":"https://ashutoshsahoo.github.io/spring-boot-kubernetes-mysql/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashutoshsahoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-03T19:46:36.000Z","updated_at":"2024-06-14T08:25:00.000Z","dependencies_parsed_at":"2024-06-14T09:43:36.595Z","dependency_job_id":"707ba93e-c9ad-4a19-9b7b-8650df579602","html_url":"https://github.com/ashutoshsahoo/spring-boot-kubernetes-mysql","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutoshsahoo%2Fspring-boot-kubernetes-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutoshsahoo%2Fspring-boot-kubernetes-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutoshsahoo%2Fspring-boot-kubernetes-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashutoshsahoo%2Fspring-boot-kubernetes-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashutoshsahoo","download_url":"https://codeload.github.com/ashutoshsahoo/spring-boot-kubernetes-mysql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230318629,"owners_count":18207812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerfile","gradle","java","kubernetes","mysql","mysql-database","mysql-replication","palantir-docker","pvc","spring","spring-boot","spring-boot-3","spring-boot-kubernetes"],"created_at":"2024-11-25T23:36:25.066Z","updated_at":"2025-08-19T04:31:34.581Z","avatar_url":"https://github.com/ashutoshsahoo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot Kubernetes and MySQL\n\nSample project to test and deploy spring boot application with mysql database in kubernetes.\n\n## Prerequisite\n\n- Docker with kubernetes enabled\n- Kubernetes command-line tool(kubectl)\n- JDK 21 LTS\n- Gradle 8\n\n## Start application\n\n- Create secrets and start mysql database\n\n```sh\nkubectl apply -f deployment/secrets.yaml\nkubectl apply -f deployment/mysql-deployment.yaml\n\n```\n\n- Build application and deploy in kubernetes\n\n```sh\ngradle clean build -i --stacktrace\ndocker build -t ashutoshsahoo/spring-boot-kubernetes-mysql:6.2.0 . \nkubectl apply -f deployment/app-k8s.yaml\n\n```\n\n- Test application :\n\n```curl\ncurl -X GET \\\n  http://localhost:31371/api/v1/pets \\\n  -H 'Accept: application/json' \\\n  -H 'Content-Type: application/json'\n  \n```\n\nResponse should be :\n\n```json\n[\n  {\n    \"name\": \"Puffball\",\n    \"owner\": \"Diane\",\n    \"species\": \"hamster\",\n    \"sex\": \"f\",\n    \"birth\": \"1999-03-30\",\n    \"death\": null\n  }\n]\n```\n\n### Delete deployment, service, secret and pvc\n\n```sh\nkubectl delete -f deployment/app-k8s.yaml\nkubectl delete -f deployment/mysql-deployment.yaml\nkubectl delete -f deployment/secrets.yaml\n\n```\n\n### Code Analysis\n\nSet the Sonarqube URL and token in [gradle.properties](./gradle.properties) file.\n\n```shell\n gradle clean build sonar --stacktrace\n```\n\n### Reference\n\n- [Spring Boot](https://spring.io/projects/spring-boot)\n- [Gradle Docker image build plugin](https://plugins.gradle.org/plugin/com.palantir.docker)\n- [OpenJDK Docker](https://hub.docker.com/_/openjdk)\n- [MySQL Docker](https://hub.docker.com/_/mysql)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashutoshsahoo%2Fspring-boot-kubernetes-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashutoshsahoo%2Fspring-boot-kubernetes-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashutoshsahoo%2Fspring-boot-kubernetes-mysql/lists"}