fix[k8s]: app replication works at scale

This commit is contained in:
Aditya
2024-07-05 19:14:30 +05:30
parent 5448c1fe6d
commit fb7b32682d
+3 -2
View File
@@ -754,7 +754,7 @@ func fixk8sRoles() {
}, },
Rules: []rbacv1.PolicyRule{ Rules: []rbacv1.PolicyRule{
{ {
APIGroups: []string{""}, APIGroups: []string{"", "apps"},
Resources: resourceTypes, Resources: resourceTypes,
Verbs: []string{"create", "list"}, Verbs: []string{"create", "list"},
}, },
@@ -1026,6 +1026,7 @@ func deployK8sWorker(image string, identifier string, env []string) error {
log.Printf("[ERROR] %s is not a valid number for replication", replicaNumberStr) log.Printf("[ERROR] %s is not a valid number for replication", replicaNumberStr)
} else { } else {
replicaNumber = tmpInt replicaNumber = tmpInt
} }
} }
@@ -3200,7 +3201,7 @@ func sendWorkerRequest(workflowExecution shuffle.ExecutionRequest, image string,
debugCommand := fmt.Sprintf("docker service logs shuffle-workers 2>&1 -f | grep %s", workflowExecution.ExecutionId) debugCommand := fmt.Sprintf("docker service logs shuffle-workers 2>&1 -f | grep %s", workflowExecution.ExecutionId)
if isKubernetes == "true" { if isKubernetes == "true" {
debugCommand = fmt.Sprintf("kubectl logs -n %s %s | grep %s", kubernetesNamespace, identifier, workflowExecution.ExecutionId) debugCommand = fmt.Sprintf("kubectl logs -n %s container=shuffle-worker | grep %s", kubernetesNamespace, workflowExecution.ExecutionId)
} }
log.Printf("[DEBUG] Ran worker from request with execution ID: %s. Worker URL: %s. DEBUGGING:\n%s", workflowExecution.ExecutionId, streamUrl, debugCommand) log.Printf("[DEBUG] Ran worker from request with execution ID: %s. Worker URL: %s. DEBUGGING:\n%s", workflowExecution.ExecutionId, streamUrl, debugCommand)