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
CertificateReconciler
for managing certificates in Kubernetes:1.
Reconcile
Method:Reconcile
method is responsible for checking the state of theCertificate
resource and performing necessary actions such as:Certificate
resource does not have an expiry date (i.e., it is being created for the first time), the method:ValidFor
field from theCertificateSpec
.Certificate
with appropriate conditions (e.g., Pending, Issued).2.
createOrUpdateCertificate
Method:Secret
resource that stores the certificate's PEM-encoded public and private keys.Certificate
resource), allowing Kubernetes to clean up the secret automatically if theCertificate
resource is deleted.3.
updateStatus
Method:Certificate
resource.metav1.Condition
) and optionally,expiredAt
andrenewedAt
timestamps.ConditionIssued
,ConditionRenewed
, etc.) are updated using this method along with the certificate's expiry and renewal times.Certificate
resource, updates its conditions, and persists the changes.Key Functionalities:
Certificate
resource is created and stores it in a KubernetesSecret
.Certificate
resource with relevant conditions, expiry dates, and renewal dates.