anchore / anchore-engine

A service that analyzes docker images and scans for vulnerabilities
Apache License 2.0
1.59k stars 272 forks source link

Helm Chart Installation fails with Kubernetes 1.16 #351

Open elliotdobson opened 4 years ago

elliotdobson commented 4 years ago

Is this a BUG REPORT or a FEATURE REQUEST? (choose one): BUG REPORT

Version of Anchore Engine and Anchore CLI if applicable: 1.4.4

What happened: When applying the helm chart we ran into this error: error: unable to recognize "anchore_deploy.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

What did you expect to happen: Deployment to work.

How to reproduce the issue: On Kubernetes v1.16 or newer helm template anchore-engine --namespace=anchore --name=anchore | kubectl apply -f -

Anything else we need to know: charts/postgresql/templates/deployment.yaml: apiVersion: extensions/v1beta1 is not supported in Kubernetes v1.16 and newer, and needs to be changed to apiVersion: apps/v1

This should work for Kubernetes v1.9 and above. https://kubernetes.io/blog/2019/09/18/kubernetes-1-16-release-announcement/

ebcarty commented 4 years ago

I believe we should be able to update the source anchore-engine/charts/postgresql/templates/deployment.yaml to use apps/v1 instead of extensions/v1beta1

In the meantime*...

  1. helm fetch stable/anchore-engine --untar
  2. helm install anchore -f anchore-values.yaml ./anchore-engine -n anchore

or with a single command... helm pull --untar stable/anchore-engine && sed -i 's#extensions/v1beta1#apps/v1#g' ./anchore-engine/charts/postgresql/templates/deployment.yaml && helm install anchore ./anchore-engine Thanks to Brady for sharing on a helm chart issue.

lucky-sideburn commented 4 years ago

sed -i 's/extensions\/v1beta1/apps\/v1/g' anchore-engine/charts/postgresql/templates/deployment.yaml

it works for me

zhill commented 4 years ago

this is a known issue we're working on. See https://github.com/anchore/anchore-charts/issues/16

zhill commented 4 years ago

A new version of the chart is available in our own repo and we'll be deprecating the official stable repo version. See: https://github.com/anchore/anchore-charts and the repo is at https://charts.anchore.io for a repo-add operation if you want to try it out.