через cloud build, вот лог ошибки
Starting Step #7 - "Apply deploy"
Step #7 - "Apply deploy": Already have image (with digest): gcr.io/cloud-builders/gke-deploy
Step #7 - "Apply deploy": Applying deployment.
Step #7 - "Apply deploy": Getting access to cluster "cut2size-kuber-1-cluster" in "us-west1-a".
Step #7 - "Apply deploy": Configuration files to be used: [{kind: Application, name: cut2size-production} {kind: Deployment, name: cut2size-production} {kind: HorizontalPodAutoscaler, name: cut2size-production-hpa-xup6} {kind: Service, name: cut2size-production-service}]
Step #7 - "Apply deploy": Applying configuration files to cluster.
Step #7 - "Apply deploy": Warning: autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler
Step #7 - "Apply deploy": The request is invalid: patch: Invalid value: "map[metadata:map[annotations:map[gcb-build-id:c01d4a4e-74c9-4d3e-bdc6-292f9fe4b375 kubectl.kubernetes.io/last-applied-configuration:{\"apiVersion\":\"autoscaling/v2beta2\",\"kind\":\"HorizontalPodAutoscaler\",\"metadata\":{\"annotations\":{\"gcb-build-id\":\"c01d4a4e-74c9-4d3e-bdc6-292f9fe4b375\",\"gcb-trigger-id\":\"bf907d4c-6828-41d8-8dc8-ce30014f936b\"},\"labels\":{\"app\":\"cut2size-production\",\"app.kubernetes.io/managed-by\":\"gcp-cloud-build-deploy\",\"app.kubernetes.io/name\":\"cut2size-production\",\"app.kubernetes.io/version\":\"d88b204c4dca75e9cfc2b3c8366ba2e0afbac59f\"},\"managedFields\":[{\"apiVersion\":\"autoscaling/v2beta2\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:labels\":{\".\":{},\"f:app\":{}}},\"f:spec\":{\"f:maxReplicas\":{},\"f:metrics\":{},\"f:minReplicas\":{},\"f:scaleTargetRef\":{\"f:apiVersion\":{},\"f:kind\":{},\"f:name\":{}}}},\"manager\":\"GoogleCloudConsole\",\"operation\":\"Update\",\"time\":\"2021-06-15T09:33:28Z\"},{\"apiVersion\":\"autoscaling/v2beta2\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:annotations\":{\".\":{},\"f:autoscaling.alpha.kubernetes.io/conditions\":{}}},\"f:status\":{\"f:currentReplicas\":{}}},\"manager\":\"vpa-recommender\",\"operation\":\"Update\",\"time\":\"2021-06-15T09:33:44Z\"}],\"name\":\"cut2size-production-hpa-xup6\",\"namespace\":\"default\"},\"spec\":{\"maxReplicas\":5,\"metrics\":[{\"resource\":{\"name\":\"cpu\",\"targetAverageUtilization\":80},\"type\":\"Resource\"}],\"minReplicas\":1,\"scaleTargetRef\":{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"name\":\"cut2size-production\"}}}\n] labels:map[app.kubernetes.io/version:d88b204c4dca75e9cfc2b3c8366ba2e0afbac59f] managedFields:[map[apiVersion:autoscaling/v2beta2 fieldsType:FieldsV1 fieldsV1:map[f:metadata:map[f:labels:map[.:map[] f:app:map[]]] f:spec:map[f:maxReplicas:map[] f:metrics:map[] f:minReplicas:map[] f:scaleTargetRef:map[f:apiVersion:map[] f:kind:map[] f:name:map[]]]] manager:GoogleCloudConsole operation:Update time:2021-06-15T09:33:28Z] map[apiVersion:autoscaling/v2beta2 fieldsType:FieldsV1 fieldsV1:map[f:metadata:map[f:annotations:map[.:map[] f:autoscaling.alpha.kubernetes.io/conditions:map[]]] f:status:map[f:currentReplicas:map[]]] manager:vpa-recommender operation:Update time:2021-06-15T09:33:44Z]]] spec:map[metrics:[map[resource:map[name:cpu targetAverageUtilization:80] type:Resource]]]]": strict decoding error: unknown field "spec.metrics[0].resource.targetAverageUtilization"
Step #7 - "Apply deploy": Error: failed to apply deployment: failed to apply HorizontalPodAutoscaler configuration file with name "cut2size-production-hpa-xup6" to cluster: failed to apply config from string: command to apply kubernetes config from string to cluster failed: exit status 1
Finished Step #7 - "Apply deploy"
ERROR
ERROR: build step 7 "gcr.io/cloud-builders/gke-deploy" failed: step exited with non-zero status: 1
Никаких изменений в .yml файл не вносилось. Пробовал гуглить, не получилось пофиксить, это можно как-то пофиксить или нужно специалиста искать?
Судя по ошибке, у вас используется устаревший api: The request is invalid: patch: Invalid value: "map[metadata:map[annotations:map[gcb-build-id:c01d4a4e-74c9-4d3e-bdc6-292f9fe4b375 kubectl.kubernetes.io/last-applied-configuration:{\"apiVersion\":\"autoscaling/v2beta2\",\"kind\":\"HorizontalPodAutoscaler\" Нужно переписать ваши ямлики под autoscaling/v2, так как кластер обновился до 1.26, видимо
Обсуждают сегодня