Different versions of K8S support different cronjob versions and policy version#116
Different versions of K8S support different cronjob versions and policy version#116wuchang0201 wants to merge 1 commit intoalipay:mainfrom
Conversation
ac670df to
029f9e8
Compare
| @@ -1,8 +1,12 @@ | |||
| {{- if .Values.enableAuditApiserver }} | |||
| {{- $policyVersion := default "v1beta1" -}} | |||
| {{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}} | |||
There was a problem hiding this comment.
What version does "semverCompare" represent?
if it represent the version of kubernetes, i can not understand the "semver" ?
There was a problem hiding this comment.
Has these code been tested?
There was a problem hiding this comment.
Has these code been tested?
Yes, there are test result images above it
| {{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}} | ||
| apiVersion: batch/v1 | ||
| {{- else if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} | ||
| apiVersion: batch/v1beta1 |
There was a problem hiding this comment.
Is there any other diff with "v1beta1" and "v1" of CronJob?
There was a problem hiding this comment.
Is there any other diff with "v1beta1" and "v1" of CronJob?
From k8s 1.19 to 1.29, there are only v1beta1 and v1
README-zh_CN.md
Outdated
| # install lunettes | ||
| # 该过程开启apiserver的审计功能,apiserver会发生重启 | ||
| helm upgrade --install lunettes oci://registry-1.docker.io/lunettes/lunettes-chart --version [version] | ||
|
|
There was a problem hiding this comment.
Please remove useless blank lines to avoid conflicts with other pr merges
There was a problem hiding this comment.
Please remove useless blank lines to avoid conflicts with other pr merges
done
docs/quick_start.md
Outdated
| ```bash | ||
| helm upgrade --install lunettes oci://registry-1.docker.io/lunettes/lunettes-chart --version [version] | ||
|
|
There was a problem hiding this comment.
Please remove useless blank lines to avoid conflicts with other pr merges
There was a problem hiding this comment.
Please remove useless blank lines to avoid conflicts with other pr merges
done
| @@ -1,4 +1,8 @@ | |||
| {{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}} | |||
There was a problem hiding this comment.
Why not use the same method here as in the previous policyversion?
There was a problem hiding this comment.
Why not use the same method here as in the previous policyversion?
Directly using nested yaml files will result in an error and requires passing variables
| @@ -1,8 +1,12 @@ | |||
| {{- if .Values.enableAuditApiserver }} | |||
| {{- $policyVersion := default "v1beta1" -}} | |||
| {{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}} | |||
There was a problem hiding this comment.
Has these code been tested?
029f9e8 to
6e3551b
Compare


if kubernetes version < 1.21 and >1.19,cronjob and policy version should be batch/v1beta1