Added support to set builder and fn pod specs via helm chart (#2461)

The users can now set the pod spec for builder and fn pods via helm chart.
Currently we have set some default securitycontext for the pods. Before there were no permissions set and the user would by default enter root when kubectl exec into pod. Now the permissions have been set and the user will not be able to access root directory in poolmgr and newdeploy pods.
This commit is contained in:
Ankit Chawla
2022-06-27 16:52:28 +05:30
committed by GitHub
parent 21ea35b02a
commit 473acc4e2b
18 changed files with 287 additions and 8 deletions
+15
View File
@@ -25,6 +25,7 @@ import (
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/yaml"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
)
@@ -113,3 +114,17 @@ func ConvertConfigSecrets(ctx context.Context, fn *fv1.Function, kc kubernetes.I
}
return envFromSources, nil
}
func GetSpecFromConfigMap(ctx context.Context, kubeClient kubernetes.Interface, cm string, cmns string) (*apiv1.PodSpec, error) {
podSpecPatch, err := kubeClient.CoreV1().ConfigMaps(cmns).Get(ctx, cm, metav1.GetOptions{})
if err != nil {
return nil, err
}
var additionalSpec apiv1.PodSpec
err = yaml.Unmarshal([]byte(podSpecPatch.Data["spec"]), &additionalSpec)
return &additionalSpec, err
}