Open
Conversation
- Missing credentials for Google Container Registry - Missing Secret Resource - Missing storageClass resource - WebApp targeted port 5432 for the postgres service but the exposed port was 5432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
This training exercise comes with several intentional bugs. The goal of this mock scenario is to troubleshoot these issues and get the application up and running.
Discovered Issues
Missing credentials for Google Container Registry
Description
The webapp StatefulSet fetches a container image from a private Google registry. To access this image we would require proper authentication to the registry.
Discovery Process
Pods have Kubernetes events that provide meaningful information. These events can be checked by describing the pod.
From the context of the event message, I was able to determine that we needed credentials to access the container image.
Solution
Given the situation, I saw two quick and easy approaches to resolving this issue.
I went with the later approach, given it's a good demonstration of basic docker skills.
Missing Secret Resource
Description
The StatefulSets postgres and webapp have a reference to a secretKeyRef within there container env. This reference is invalid because there is no Secret resource defined.
Discovery Process
This was discovered by looking at the pod events.
Solution
Add the secret resource. This will also establish the password that will be used for the postgres service.
Missing storageClass resource
Description
The gold storage class was referenced but not defined.
Discovery Process
This was discovered by looking at the pod events.
Solution
Add the storageClass resource.
Unreachable Port
Description
The WebApp targeted port 5432 for the postgres service but the exposed postgres port was set to 5432.
Discovery Process
Pods have logs on the application level. Similar to the describe command, we can fetch logs for a pod.
While reviewing the logs, I noticed the application was unable to connect to the Postgres service on the expected port. After examining the code, I found that it was attempting to reach a port that hadn’t been exposed.
Solution
To resolve this issue we could either update the port number within the application or the exposed port within the kubernetes manifest. I chose to go with the later.