Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide Rewrite #7

Merged
merged 6 commits into from
Aug 27, 2024
Merged

Conversation

robertmcnees
Copy link

This PR suggests several changes to the existing material. I tried to preserve the structure and fundamental teachings of the existing guide.

There are a few general topics in this PR.

Reduction in tooling
I removed references to Kind and Kustomize. Removing references to Kind and instead using Docker Desktop with kubernetes necessitated a change to the container spec when creating the deployment. Removing references to Kustomize required the addition of a project and 2 additional yaml files (only used in the final section of the guide) to manage the deployment and service creation.

All required code in this repository
The previous guide instructed users to load a deployment located in Ryan Baxter's personal repository with Kustomize. When I removed Kustomize from the guide, it made sense to have all of the code required for the tutorial managed in this repository. This necessitated a second app in the project and restructured all of the existing code files.

Code rename and restructure
Previously the guide included a single project located in the app folder. It wasn't clear to me what the app should be throughout much of the tutorial. The code provided in the app folder was written to call a second application. These instructions were not given until the end of the guide, making me wonder what I should have been deploying throughout the guide. The code in Ryan's repository was the base 'hello world' example and is what I based all teachings around in the restructured guide. Ryan's code came into the project as hello-spring-k8s and is the foundation for the guide. The existing code in the app folder was moved to hello-caller and only used at the end to demonstrate service registration and discovery.

Called out sections separately
When following along with the guide, it naturally fell into 4 distinct sections. I created headings and links so that the user can more easily navigate to the section that they are looking for.

Created multiple solution yaml files
Since the guide focuses primarily on creating kubernetes resources, I chose to only provide solutions to the Java projects. Because this guide does not focus on the Java code nor help users build an application step by step, I removed references to starting a new project with Spring Initializr. This helped reduce the size of the guide and focus only on what is being taught in the guide. Instead of focusing on the Java code, I added multiple folders in the k8s-artifacts folder that have yaml files that correspond to the sections of the guide. My hope is that his more easily allows the user the ability to jump in at a specific point if they want to.

Project Maintenance
I updated all Spring Boot applications to the latest version. The Maven wrapper was updated. I also added GitHub configuration files for CI as well as Dependabot.

Robert McNees added 2 commits July 2, 2024 06:31
The guide contained several sections that had become dated or could
be optimized by using fewer external tools. This large commit
attempts to tackle the bulk of the work at once since the guide
instructions updated in the README are very much tied to the coding
examples.

There are a few major themes of this commit:

Reduced reliance on additional tooling. References to Kind and
Kustomize were removed.

All code required is in this repository. An additional project was added
to this repository and files were restructured accordingly.

Improved navigation. The instructions are broken into multiple parts.

Multiple solution folders. Each section has a corresponding set of
solution assets.

Code update. Spring Boot and Maven versions were updated.
This commit adds configuration files required to establish
GitHub Actions as the CI system as well as Dependabot.
@robertmcnees robertmcnees added the enhancement New feature or request label Jul 2, 2024
@robertmcnees robertmcnees self-assigned this Jul 2, 2024
@robertmcnees
Copy link
Author

Asking for a review from @ryanjbaxter and perhaps @rstoyanchev as the original authors of the guide.

@robertmcnees
Copy link
Author

This PR should address issues #6 #5 #3 #2

@ryanjbaxter
Copy link

@robertmcnees remind me is there a way to build the guide so I can see the final result making it easier to read an review?

@robertmcnees
Copy link
Author

I need to pull out the .DS_Store files from this PR. Apparently I checked those files in with my first commit before noticing they were not excluded in .gitignore. With my second commit I added .DS_Store to .gitignore but the damage was done.

It might take a few steps to get those files off of this PR but I'll get it fixed.

@robertmcnees
Copy link
Author

@ryanjbaxter The easiest way to view the code is to pull down the code and view the README in IntelliJ.

Robert McNees added 4 commits July 24, 2024 09:29
This commit is required so that files that were originally included
in the PR can now be removed in a future commit.
Addressing GH issue 8. The prestop command is not required.
As of Spring Boot 3.4 the build-image command will not include
a shell that will also fail on deployment.
@robertmcnees
Copy link
Author

robertmcnees commented Jul 24, 2024

Added a commit to address #8. preStop is not required. Additionally, as of Spring Boot 3.4 the instructions in this guide will throw an error.

@ryanjbaxter
Copy link

This looks good.

I would consider adding a note about building container on ARM64 (Mx chips for Macs) architectures. While the default buildpack will work it is built using a different architecture and when you run the apps on ARM64 the performance of the containers are pretty poor. To solve this DaShaun has been managing a buildpack for compiling containers for ARM64. To use it when you are on a Mac you would need to do ./mvnw spring-boot:build-image -Dspring-boot.build-image.builder=dashaun/builder:tiny.

@robertmcnees
Copy link
Author

@ryanjbaxter Probably best if you merge this PR. It should be all ready to go as is. My apologies I didn't merge myself and clear this off my list before last week.

@ryanjbaxter ryanjbaxter merged commit fec82f0 into spring-guides:main Aug 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants