@@ -58,7 +58,7 @@ const (
5858)
5959
6060func init () {
61- viper .SetDefault (addonSANameKey , "kubeblocks-addon-installer " )
61+ viper .SetDefault (constant . KBServiceAccountName , "kubeblocks" )
6262 viper .SetDefault (addonHelmInstallOptKey , []string {
6363 "--atomic" ,
6464 "--cleanup-on-fail" ,
@@ -543,7 +543,6 @@ func (r *helmTypeInstallStage) Handle(ctx context.Context) {
543543 chartsPath ,
544544 "--namespace" ,
545545 "$(RELEASE_NS)" ,
546- "--create-namespace" ,
547546 }, viper .GetStringSlice (addonHelmInstallOptKey )... )
548547
549548 installValues := addon .Spec .Helm .BuildMergedValues (addon .Spec .InstallSpec )
@@ -861,19 +860,7 @@ func createHelmJobProto(addon *extensionsv1alpha1.Addon) (*batchv1.Job, error) {
861860 Name : getJobMainContainerName (addon ),
862861 Image : viper .GetString (constant .KBToolsImage ),
863862 ImagePullPolicy : corev1 .PullPolicy (viper .GetString (constant .CfgAddonJobImgPullPolicy )),
864- // TODO: need have image that is capable of following settings, current settings
865- // may expose potential security risk, as this pod is using cluster-admin clusterrole.
866- // SecurityContext: &corev1.SecurityContext{
867- // RunAsNonRoot: &[]bool{true}[0],
868- // RunAsUser: &[]int64{1001}[0],
869- // AllowPrivilegeEscalation: &[]bool{false}[0],
870- // Capabilities: &corev1.Capabilities{
871- // Drop: []corev1.Capability{
872- // "ALL",
873- // },
874- // },
875- // },
876- Command : []string {"helm" },
863+ Command : []string {"helm" },
877864 Env : []corev1.EnvVar {
878865 {
879866 Name : "RELEASE_NAME" ,
@@ -911,7 +898,7 @@ func createHelmJobProto(addon *extensionsv1alpha1.Addon) (*batchv1.Job, error) {
911898 },
912899 Spec : corev1.PodSpec {
913900 RestartPolicy : corev1 .RestartPolicyNever ,
914- ServiceAccountName : viper .GetString ("KUBEBLOCKS_ADDON_SA_NAME" ),
901+ ServiceAccountName : viper .GetString (constant . KBServiceAccountName ),
915902 Containers : []corev1.Container {container },
916903 Volumes : []corev1.Volume {},
917904 Tolerations : []corev1.Toleration {},
0 commit comments