我开发了Java Flink代码,我想将其部署为docker镜像,并作为jobManager和TaskManager yamls进行测试,以运行应用程序。但是我面临着使服务启动和运行的问题。我已按照以下步骤在 kubernates 中部署代码。
低于错误,
C:\Deployment\Flink>kubectl apply -f Flink-JobManager.yaml 作业 "flink-on-kubernetes-jobmanager" 无效:spec.template:无效值:core。PodTemplateSpec{ObjectMeta:v1.ObjectMeta{Name:", GenerateName:", Namespace:", SelfLink:", UID:", ResourceVersion:", Generation:0, CreationTimestamp:v1.时间{时间:时间。时间{wall:0x0, ext:0, loc:(*time.Location((nil(}}, DeleteTimestamp:(*v1.Time((nil(, DeleteGracePeriodSeconds:(*int64((nil(, Labels:map[string]string{"job-name":"flink-on-kubernetes-jobmanager", "app":"flink", "controller-uid":"bb738bd8-1729-11ea-8e51-7acc0f0eb42c", "instance":"flink-on-kubernetes-jobmanager"}, Annotations:map[string]string(nil(, OwnerReferences:[]v1.OwnerReference(nil(, Initializers:(*v1.Initializers((nil(, Finalizers:[]string(nil(, ClusterName:"}, Spec:core.PodSpec{Volumes:[]core.Volume(nil(, InitContainers:[]core.Container(nil(, Containers:[]core.容器{核心。Container{Name:"jobmanager", Image:"flink-on-kubernetes:0.0.1", Command:[]string{"/opt/flink/bin/standalone-job.sh"}, Args:[]string{"start-foreground", "-Djobmanager.rpc.address=flink-on-kubernetes-jobmanager", "-Dparallelism.default=1", "-Dblob.server.port=6124", "-Dqueryable-state.server.ports=6125"}, WorkingDir:"", Ports:[]core.ContainerPort{core.ContainerPort{Name:"rpc", HostPort:0, ContainerPort:6123, Protocol:"TCP", HostIP:"}, core.ContainerPort{Name:"blob", HostPort:0, ContainerPort:6124, Protocol:"TCP", HostIP:"}, core.ContainerPort{Name:"query", HostPort:0, ContainerPort:6125, Protocol:"TCP", HostIP:"}, core.ContainerPort{Name:"ui", HostPort:0, ContainerPort:8081, Protocol:"TCP", HostIP:"}}, EnvFrom:[]core.EnvFromSource(nil(, Env:[]core.EnvVar(nil(, Resources:core.资源要求{限制:核心.ResourceList(nil(, Requests:core.ResourceList(nil(}, VolumeMounts:[]core.VolumeMount(nil(, VolumeDevices:[]core.VolumeDevice(nil(, LivenessProbe:(*core.Probe((nil(, RereadynessProbe:(*core.探测((无(,生命周期:(*核心。Lifecycle((nil(, TerminationMessagePath:"/dev/termination-log", TerminationMessagePolicy:"File", ImagePullPolicy:"Always", SecurityContext:(*core.SecurityContext((nil(, Stdin:false, StdinOnce:false, TTY:false}}, RestartPolicy:"OnFailure", TerminationGracePeriodSeconds:(*int64((0xc00ba42298(, ActiveDeadlineSeconds:(*int64((nil(, DNSPolicy:"ClusterFirst", NodeSelector:map[string]string(nil(, ServiceAccountName:", AutomountServiceAccountToken:(*bool((nil(, NodeName:", SecurityContext:(*core.PodSecurityContext((0xc005751650(, ImagePullSecrets:[]core.LocalObjectReference(nil(, 主机名:", 子域:", affinity:(*core.Affinity((nil(, SchedulerName:"default-scheduler", Tolerations:[]core.Toleration(nil(, HostAliases:[]core.HostAlias(nil(, PriorityClassName:", Priority:(*int32((nil(, DNSConfig:(*core.PodDNSConfig((nil(, ReadinessGates:[]core.PodReadinessGate(nil(, RuntimeClassName:(*string((nil(, EnableServiceLinks:(*bool((nil(}}: field is imdenable
问题是您正在尝试修改部署中的不可变字段。例如,将标签添加到spec.template.metadata.labels(除了在部署匹配标签中设置的标签,例如"app"和"component"(会导致此错误。
可以 (a( 删除部署并重新部署,或 (b( 标识并删除中断重新部署的属性。