You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/10/24 17:31:07 UTC
[GitHub] [flink-kubernetes-operator] morhidi commented on pull request #409: [FLINK-29708] Convert CR Error field to JSON with enriched exception …
morhidi commented on PR #409:
URL: https://github.com/apache/flink-kubernetes-operator/pull/409#issuecomment-1289362006
I tested it and it almost works great, apart from the minor things, Gyula mentioned. There'll be probably issues with JSON encoding: I've tested it with the following invalid CR (missing volumes):
```
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
name: basic-example
spec:
image: flink:1.15
flinkVersion: v1_15
flinkConfiguration:
taskmanager.numberOfTaskSlots: "2"
serviceAccount: flink
podTemplate:
apiVersion: v1
kind: Pod
metadata:
name: pod-template
spec:
containers:
- name: flink-main-container
volumeMounts:
- mountPath: /opt/flink/log
name: flink-logs
- mountPath: /opt/flink/downloads
name: downloads
jobManager:
resource:
memory: "2048m"
cpu: 1
taskManager:
resource:
memory: "2048m"
cpu: 1
job:
jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
parallelism: 2
upgradeMode: stateless
```
It resulted in an string, that might not be a valid JSON:
```
{"type":"org.apache.flink.kubernetes.operator.exception.ReconciliationException","message":"org.apache.flink.client.deployment.ClusterDeploymentException:
Could not create Kubernetes cluster \"basic-example\".","throwableList":[{"type":"org.apache.flink.client.deployment.ClusterDeploymentException","message":"Could
not create Kubernetes cluster \"basic-example\"."},{"type":"io.fabric8.kubernetes.client.KubernetesClientException","message":"Failure
executing: POST at: https://127.0.0.1:53846/apis/apps/v1/namespaces/default/deployments.
Message: Deployment.apps \"basic-example\" is invalid: [spec.template.spec.containers[0].volumeMounts[0].name:
Not found: \"flink-logs\", spec.template.spec.containers[0].volumeMounts[1].name:
Not found: \"downloads\"]. Received status: Status(apiVersion=v1, code=422,
details=StatusDetails(causes=[StatusCause(field=spec.template.spec.containers[0].volumeMounts[0].name,
message=Not found: \"flink-logs\", reason=FieldValueNotFound, additionalProperties={}),
StatusCause(field=spec.template.spec.containers[0].volumeMounts[1].name, message=Not
found: \"downloads\", reason=FieldValueNotFound, additionalProperties={})],
group=apps, kind=Deployment, name=basic-example, retryAfterSeconds=null, uid=null,
additionalProperties={}), kind=Status, message=Deployment.apps \"basic-example\"
is invalid: [spec.template.spec.containers[0].volumeMounts[0].name: Not found:
\"flink-logs\", spec.template.spec.containers[0].volumeMounts[1].name: Not found:
\"downloads\"], metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null,
selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={})."}]}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org