@@ -62,7 +62,7 @@ const (
6262)
6363
6464func init () {
65- viper .SetDefault (addonSANameKey , "kubeblocks-addon-installer " )
65+ viper .SetDefault (constant . KBServiceAccountName , "kubeblocks" )
6666 viper .SetDefault (addonHelmInstallOptKey , []string {
6767 "--atomic" ,
6868 "--cleanup-on-fail" ,
@@ -598,7 +598,6 @@ func (r *helmTypeInstallStage) Handle(ctx context.Context) {
598598 chartsPath ,
599599 "--namespace" ,
600600 "$(RELEASE_NS)" ,
601- "--create-namespace" ,
602601 }, viper .GetStringSlice (addonHelmInstallOptKey )... )
603602
604603 installValues := addon .Spec .Helm .BuildMergedValues (addon .Spec .InstallSpec )
@@ -916,19 +915,7 @@ func createHelmJobProto(addon *extensionsv1alpha1.Addon) (*batchv1.Job, error) {
916915 Name : getJobMainContainerName (addon ),
917916 Image : viper .GetString (constant .KBToolsImage ),
918917 ImagePullPolicy : corev1 .PullPolicy (viper .GetString (constant .CfgAddonJobImgPullPolicy )),
919- // TODO: need have image that is capable of following settings, current settings
920- // may expose potential security risk, as this pod is using cluster-admin clusterrole.
921- // SecurityContext: &corev1.SecurityContext{
922- // RunAsNonRoot: &[]bool{true}[0],
923- // RunAsUser: &[]int64{1001}[0],
924- // AllowPrivilegeEscalation: &[]bool{false}[0],
925- // Capabilities: &corev1.Capabilities{
926- // Drop: []corev1.Capability{
927- // "ALL",
928- // },
929- // },
930- // },
931- Command : []string {"helm" },
918+ Command : []string {"helm" },
932919 Env : []corev1.EnvVar {
933920 {
934921 Name : "RELEASE_NAME" ,
@@ -966,7 +953,7 @@ func createHelmJobProto(addon *extensionsv1alpha1.Addon) (*batchv1.Job, error) {
966953 },
967954 Spec : corev1.PodSpec {
968955 RestartPolicy : corev1 .RestartPolicyNever ,
969- ServiceAccountName : viper .GetString ("KUBEBLOCKS_ADDON_SA_NAME" ),
956+ ServiceAccountName : viper .GetString (constant . KBServiceAccountName ),
970957 Containers : []corev1.Container {container },
971958 Volumes : []corev1.Volume {},
972959 Tolerations : []corev1.Toleration {},
0 commit comments