expose worker and apps using service type ClusterIP
Signed-off-by: Pascal Sthamer <10992664+P4sca1@users.noreply.github.com>
This commit is contained in:
@@ -747,7 +747,7 @@ func handleBackendImageDownload(ctx context.Context, images string) error {
|
||||
//log.Printf("[DEBUG] Removing existing image (s): %s", images)
|
||||
newImages := []string{}
|
||||
|
||||
successful := []string{}
|
||||
successful := []string{}
|
||||
for _, curimage := range strings.Split(images, ",") {
|
||||
curimage = strings.TrimSpace(curimage)
|
||||
if shuffle.ArrayContains(handled, curimage) {
|
||||
@@ -1067,9 +1067,9 @@ func deployK8sWorker(image string, identifier string, env []string) error {
|
||||
}
|
||||
|
||||
labels := map[string]string{
|
||||
"app.kubernetes.io/name": "shuffle-worker",
|
||||
"app.kubernetes.io/instance": identifier,
|
||||
// "app.kubernetes.io/version": "",
|
||||
// Well-known Kubernetes labels
|
||||
"app.kubernetes.io/name": "shuffle-worker",
|
||||
"app.kubernetes.io/instance": identifier,
|
||||
"app.kubernetes.io/part-of": "shuffle",
|
||||
"app.kubernetes.io/managed-by": "shuffle-orborus",
|
||||
// Keep legacy labels for backward compatibility
|
||||
@@ -1212,7 +1212,6 @@ func deployK8sWorker(image string, identifier string, env []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// kubectl expose deployment shuffle-workers --type=NodePort --port=33333 --target-port=33333
|
||||
service := &corev1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: identifier,
|
||||
@@ -1227,7 +1226,7 @@ func deployK8sWorker(image string, identifier string, env []string) error {
|
||||
TargetPort: intstr.FromInt(33333),
|
||||
},
|
||||
},
|
||||
Type: corev1.ServiceTypeNodePort,
|
||||
Type: corev1.ServiceTypeClusterIP,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1271,7 +1270,6 @@ func deployWorker(image string, identifier string, env []string, executionReques
|
||||
Resources: container.Resources{},
|
||||
}
|
||||
|
||||
|
||||
// This is just to test the mounting locally so
|
||||
// I can control from what source I'm mounting
|
||||
// the certs to. Default behaviour is:
|
||||
|
||||
@@ -489,13 +489,16 @@ func deployk8sApp(image string, identifier string, env []string) error {
|
||||
name := strings.ReplaceAll(identifier, "_", "-")
|
||||
|
||||
labels := map[string]string{
|
||||
"app.kubernetes.io/name": "shuffle-app",
|
||||
"app.kubernetes.io/instance": name,
|
||||
// "app.kubernetes.io/version": "",
|
||||
// Well-known Kubernetes labels
|
||||
"app.kubernetes.io/name": "shuffle-app",
|
||||
"app.kubernetes.io/instance": name,
|
||||
"app.kubernetes.io/part-of": "shuffle",
|
||||
"app.kubernetes.io/managed-by": "shuffle-worker",
|
||||
// Keep legacy labels for backward compatibility
|
||||
"app": name,
|
||||
// TODO: Add Shuffle specific labels
|
||||
// "app.shuffler.io/name": "APP_NAME",
|
||||
// "app.shuffler.io/version": "APP_VERSION",
|
||||
}
|
||||
|
||||
matchLabels := map[string]string{
|
||||
@@ -614,7 +617,6 @@ func deployk8sApp(image string, identifier string, env []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// kubectl expose deployment {podName} --type=NodePort --port=80 --target-port=80
|
||||
service := &corev1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
@@ -629,7 +631,7 @@ func deployk8sApp(image string, identifier string, env []string) error {
|
||||
TargetPort: intstr.FromInt(80),
|
||||
},
|
||||
},
|
||||
Type: corev1.ServiceTypeNodePort,
|
||||
Type: corev1.ServiceTypeClusterIP,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -917,7 +919,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env []
|
||||
// Add more volume binds if possible
|
||||
if len(volumeBinds) > 0 {
|
||||
|
||||
// Only use mounts, not direct binds
|
||||
// Only use mounts, not direct binds
|
||||
hostConfig.Binds = []string{}
|
||||
hostConfig.Mounts = []mount.Mount{}
|
||||
for _, bind := range volumeBinds {
|
||||
@@ -931,7 +933,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env []
|
||||
sourceFolder := bindSplit[0]
|
||||
destinationFolder := bindSplit[1]
|
||||
|
||||
readOnly := false
|
||||
readOnly := false
|
||||
if len(bindSplit) > 2 {
|
||||
mode := bindSplit[2]
|
||||
if mode == "ro" {
|
||||
@@ -940,9 +942,9 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env []
|
||||
}
|
||||
|
||||
builtMount := mount.Mount{
|
||||
Type: mount.TypeBind,
|
||||
Source: sourceFolder,
|
||||
Target: destinationFolder,
|
||||
Type: mount.TypeBind,
|
||||
Source: sourceFolder,
|
||||
Target: destinationFolder,
|
||||
ReadOnly: readOnly,
|
||||
}
|
||||
|
||||
@@ -1853,18 +1855,18 @@ func executionInit(workflowExecution shuffle.WorkflowExecution) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Validates RERUN of single actions
|
||||
// Identified by:
|
||||
// Validates RERUN of single actions
|
||||
// Identified by:
|
||||
// 1. Predefined result from previous exec
|
||||
// 2. Only ONE action
|
||||
// 3. Every predefined result having result.Action.Category == "rerun"
|
||||
/*
|
||||
if len(workflowExecution.Workflow.Actions) == 1 && len(workflowExecution.Results) > 0 {
|
||||
finished := shuffle.ValidateFinished(ctx, extra, workflowExecution)
|
||||
if finished {
|
||||
return nil
|
||||
if len(workflowExecution.Workflow.Actions) == 1 && len(workflowExecution.Results) > 0 {
|
||||
finished := shuffle.ValidateFinished(ctx, extra, workflowExecution)
|
||||
if finished {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
nextActions = append(nextActions, startAction)
|
||||
@@ -1954,7 +1956,6 @@ func executionInit(workflowExecution shuffle.WorkflowExecution) error {
|
||||
//log.Printf("Successfully downloaded and built %s", image)
|
||||
}
|
||||
|
||||
|
||||
visited := []string{}
|
||||
executed := []string{}
|
||||
environments := []string{}
|
||||
@@ -3777,7 +3778,7 @@ func checkStandaloneRun() {
|
||||
if !strings.Contains(backendUrl, "http") {
|
||||
log.Printf("[ERROR] Backend URL should start with http:// or https://")
|
||||
return
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Format:
|
||||
@@ -3851,7 +3852,7 @@ func checkStandaloneRun() {
|
||||
continue
|
||||
}
|
||||
|
||||
// This is to handle reruns of SINGLE actions
|
||||
// This is to handle reruns of SINGLE actions
|
||||
if result.Action.Category == "rerun" {
|
||||
newResults = append(newResults, result)
|
||||
continue
|
||||
@@ -3905,7 +3906,6 @@ func checkStandaloneRun() {
|
||||
|
||||
log.Printf("\n\n\n[DEBUG] Finished resetting execution %s. Body: %s. Starting execution.\n\n\n", newresp.Status, string(body))
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Initial loop etc
|
||||
|
||||
Reference in New Issue
Block a user