-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Use Cert Manager to Create Certificates for News Aggregator Server #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouln't this PR be pointed to a branch with helm ?
Changed base branch |
cmd/server/certs/tls.crt
Outdated
@@ -0,0 +1,10 @@ | |||
-----BEGIN CERTIFICATE----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if you are using cert-manager there is no need to push certs anymore, they can be created dynamically using cert-manager
pls integrate that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed certs from git
cmd/server/start_server.go
Outdated
@@ -91,10 +112,69 @@ func ConfAndRun() error { | |||
|
|||
setupRoutes(server) | |||
|
|||
c := config.GetConfigOrDie() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
news-aggregator is just a pure https server, it should not care about certs
it should read certs from the file system
you can attach certs generated by k8s to the file system of news-aggregator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
cmd/server/start_server.go
Outdated
} | ||
|
||
// loadCertsFromSecrets loads certificates from Kubernetes secrets | ||
func loadCertsFromSecrets() (string, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls check my comment above, this should not be there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
operator/Makefile
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
i think we get rid of makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulled data from prev PRs. Deleted
operator/Taskfile.yml
Outdated
@@ -1,252 +1,158 @@ | |||
version: '3' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changed again ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't changed, I've just have not pulled data from prev PR's. Resolved
templates/_self_signed_ca_issuer.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be under helm chart right?
+ integrate helm values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to helm chart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added values for issuer and secrets in helm
…o feature/cert-manager
@@ -4,9 +4,3 @@ description: A Helm chart for Kubernetes | |||
type: application | |||
version: 0.1.0 | |||
appVersion: "1.16.0" | |||
dependencies: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong branch, added dependencies
- server auth | ||
- client auth | ||
dnsNames: | ||
- "go-gator-server" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have such dns name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is creating without dnsNames, removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want you to put a dns name which you use. not just removing it.
what dns name do you use?
go-gator/templates/cert_secret.yaml
Outdated
@@ -0,0 +1,5 @@ | |||
apiVersion: v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the secret will be created automatically by certificate CR (cert-manager)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But how do we assign it to the deployment? It will add random sequence of letters after cert name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can specify secret name in the cert itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,17 @@ | |||
apiVersion: cert-manager.io/v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need that cert? how is this used? I see you have almost similar below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
templates/0_namespace.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templates folder can be completely removed since you moved to helm charts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in helm PR, to avoid duplication
go.mod
Outdated
@@ -8,41 +8,89 @@ require ( | |||
github.com/PuerkitoBio/goquery v1.9.2 | |||
github.com/gin-gonic/gin v1.10.0 | |||
github.com/jarcoal/httpmock v1.3.1 | |||
github.com/spf13/cobra v1.8.0 | |||
github.com/spf13/cobra v1.8.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure from where this changes are, but I will revert to previous version
Introduce Certificate Generation using Helm Chart of Cert-Manager
Summary
This pull request introduces the implementation of certificate generation and management using Cert-Manager.
The main focus is on integrating certificate creation and retrieval within our news aggregator, using Kubernetes' Golang client to manage and apply the certificates dynamically when running the server.
Key Changes
Certificate Resource Creation:
Secret Management:
defaultSecretName
.Certificate and Key Handling:
defaultCertName
anddefaultPrivateKey
, they are retrieved from secret, generated bycert-manager
.Server Configuration: