Skip to content

Conversation

@razvansodoleanu
Copy link
Collaborator

Added sources for mutating webhook to allow the usage of mixed profile MIG gpus in AI Center pipelines.

kind: MutatingWebhookConfiguration
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove this as not required

@@ -0,0 +1 @@
Initial commit mig mutating webhook
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add instruction explaining why/ -- how to deploy/use it

Comment on lines +41 to +43
if key == "ca.crt" {

caPEM = value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if key == "ca.crt" {
caPEM = value
if key == "ca.crt" {
caPEM = value

same at other places

clientTLSCert = &tls.Config{RootCAs: certpool}

} else {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to have a separate function to generate cert


k8sSecretsClient = k8sclientset.CoreV1().Secrets(currentNamespace)

ctx = context.Background()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: usually context is declared at top and passed down to child functions whenever required


ctx = context.Background()

_, err = k8sSecretsClient.Get(ctx, "migmutatingwebhook-tls", metav1.GetOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constant for "migmutatingwebhook-tls"


func CreateCertSecret(serverCert, serverKey, caCert string) {

kuebConfigFilePath := filepath.Join("/etc", "rancher", "rke2", "rke2.yaml")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using rke2.yaml we can either use config from KUBECONFIG or in cluster config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants