Certificate Controller: Assignment 2 and 3 #71
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.
This PR introduces the following methods and functionalities in the
CertificateReconcilerfor managing certificates in Kubernetes:1.
ReconcileMethod:Reconcilemethod is responsible for checking the state of theCertificateresource and performing necessary actions such as:Certificateresource does not have an expiry date (i.e., it is being created for the first time), the method:ValidForfield from theCertificateSpec.Certificatewith appropriate conditions (e.g., Pending, Issued).2.
createOrUpdateCertificateMethod:Secretresource that stores the certificate's PEM-encoded public and private keys.Certificateresource), allowing Kubernetes to clean up the secret automatically if theCertificateresource is deleted.3.
updateStatusMethod:Certificateresource.metav1.Condition) and optionally,expiredAtandrenewedAttimestamps.ConditionIssued,ConditionRenewed, etc.) are updated using this method along with the certificate's expiry and renewal times.Certificateresource, updates its conditions, and persists the changes.Key Functionalities:
Certificateresource is created and stores it in a KubernetesSecret.Certificateresource with relevant conditions, expiry dates, and renewal dates.