diff --git a/pkg/model/components/addonmanifests/remap.go b/pkg/model/components/addonmanifests/remap.go index 571900b410..a2647e99dd 100644 --- a/pkg/model/components/addonmanifests/remap.go +++ b/pkg/model/components/addonmanifests/remap.go @@ -87,10 +87,7 @@ func addServiceAccountRole(context *model.KopsModelContext, objects kubemanifest } for _, object := range objects { - if object.Kind() != "Deployment" { - continue - } - if object.APIVersion() != "apps/v1" { + if !hasPodSpecTemplate(object) { continue } podSpec := &corev1.PodSpec{} @@ -160,3 +157,12 @@ func addLabels(addon *addonsapi.AddonSpec, objects kubemanifest.ObjectList) erro } return nil } + +func hasPodSpecTemplate(object *kubemanifest.Object) bool { + if object.Kind() == "Deployment" || object.Kind() == "DaemonSet" { + if object.APIVersion() == "apps/v1" { + return true + } + } + return false +}