no matches for kind “Deployment” in version "extensions/v1beta1

后端 未结 5 963
春和景丽
春和景丽 2020-12-01 03:06

I have been having the issue while deploying mojaloop .kubernetes is responding with an error log like

I have checked my Kubernetes version and 1.16 is the version s

5条回答
  •  生来不讨喜
    2020-12-01 03:40

    This was annoying me because I am testing lots of helm packages so I wrote a quick script - which could be modified to sort your workflow perhaps see below

    New workflow First fetch the chart as a tgz to your working directory

    helm fetch repo/chart
    

    then in your working directly run bash script below - which I named helmk

    helmk myreleasename mynamespace chart.tgz [any parameters for kubectl create]
    

    Contents of helmk - need to edit your kubeconfig clustername to work

    #!/bin/bash
    echo usage $0 releasename namespace chart.tgz [createparameter1] [createparameter2] ... [createparameter n]
    echo This will use your namespace then shift back to default so be careful!!
    kubectl create namespace $2   #this will create harmless error if namespace exists have to ignore
    kubectl config set-context MYCLUSTERNAME --namespace $2
    helm template -n $1 --namespace $2 $3 | kubectl convert -f /dev/stdin | kubectl create --save-config=true ${@:4}  -f /dev/stdin
    #note the --namespace parameter in helm template above seems to be ignored so we have to manually switch context
    kubectl config set-context MYCLUSTERNAME --namespace default
    

    It's a slightly dangerous hack since I manually switch to your new desired namespace context then back again so only to be used for single user devs really or comment that out.

    You will get a warning about using the kubectl convert facility like this

    If you need to edit the YAML to customise - just replace one of the /dev/stdin to intermediate files but It's probably better to get it up using "create" with a save-config as I have and then simply "apply" your changes which means that they will be recorded in kubernetes too. Good luck

提交回复
热议问题