colearendt / helm

Helm charts for miscellaneous services that I use regularly
6 stars 3 forks source link

Postgrest chart, unknown field "rollingUpdate" in io.k8s.api.apps.v1.DeploymentSpec #28

Closed yevon closed 2 years ago

yevon commented 2 years ago

I was trying to use the postgrest chart, but I'm receiving this error:

Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(Deployment.spec): unknown field "rollingUpdate" in io.k8s.api.apps.v1.DeploymentSpec, ValidationError(Deployment.spec): unknown field "type" in io.k8s.api.apps.v1.DeploymentSpec]

Any ideas what could it be?

I'm using this values.yaml file (default provided but modified):

replicaCount: 1

versionOverride: ""

image:
  repository: postgrest/postgrest
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

imagePullSecrets: []

nameOverride: ""
fullnameOverride: ""

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ""

strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1
    maxSurge: 1

initContainers: {}

command: []
args: []

postgrest:
  dbUri: "postgres://XXXX:XXXX@XXXX/XXXX"
  dbSchema: "XXXX"
  dbAnonRole: "XXXX"
  dbPool: ""
  dbPoolTimeout: ""
  dbExtraSearchPath: ""
  dbChannel: ""
  dbChannelEnabled: ""
  serverHost: "XXX.XXX.X.XXX"
  serverPort: "XXXX"
  openApiServerProxyUri: ""
  jwtSecret: ""
  secretIsBase64: ""
  jwtAud: ""
  roleClaimKey: ""
  maxRows: ""
  preRequest: ""
  rootSpec: ""
  rawMediaTypes: ""

secret: {}

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

pod:
  annotations: {}
  containerPort: 9000
  env: []
  readinessProbe:
    httpGet:
      path: /
      port: http
    initialDelaySeconds: 5
    periodSeconds: 5
  livenessProbe: {}
  startupProbe: {}
  volumes: []
  volumeMounts: []
  securityContext: {}

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: "XXXX-prod"
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: XXXX.COM
      paths: []
  tls:
    - secretName: XXXX-tls
      hosts:
        - XXXX.COM

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 100
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}
yevon commented 2 years ago

Error on my side, closing this.

colearendt commented 2 years ago

No worries! Thanks for reaching out! I hope the chart is helpful šŸ˜„

yevon commented 2 years ago

Reopening it. I thought it was due to a bad line ending encoding but I corrected it and it continues giving the same error message:

Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(Deployment.spec): unknown field "rollingUpdate" in io.k8s.api.apps.v1.DeploymentSpec, ValidationError(Deployment.spec): unknown field "type" in io.k8s.api.apps.v1.DeploymentSpec]

Did you experience it? I don't really understand why it happens, it seems correct the default config file (values.yaml).

colearendt commented 2 years ago

Sorry about the inconvenience, you're right! I did experience this, but I worked around it šŸ™ˆ I don't know why I didn't just fix it when I found. šŸ˜ž

FYI, a workaround is to use values like the following, which unset the defaults and then set them at the proper hierarchy:

strategy:
  type: null
  rollingUpdate: null
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: "25%"
      maxSurge: "25%"

I have fixed in v0.3.0 in #29 though! So your values should work fine once I merge that!

yevon commented 2 years ago

Working nicely now, thanks!