-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace plain yaml manifest with helm chart #870
Conversation
Hi @huww98. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
92a586e
to
4303f57
Compare
688faf5
to
71be64c
Compare
this should cover the current ECS/non-ECS, and also ACK/ACK-edge cases
.Values.controller.replicas .Release.Namespce
to help review, I generate a diff with live ACK cluster with: diff -u -N /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/LIVE-1568119544/apps.v1.DaemonSet.kube-system.csi-plugin /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/MERGED-1853621355/apps.v1.DaemonSet.kube-system.csi-plugin
--- /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/LIVE-1568119544/apps.v1.DaemonSet.kube-system.csi-plugin 2024-04-09 17:52:56
+++ /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/MERGED-1853621355/apps.v1.DaemonSet.kube-system.csi-plugin 2024-04-09 17:52:56
@@ -2,9 +2,9 @@
kind: DaemonSet
metadata:
annotations:
- deprecated.daemonset.template.generation: "1"
+ deprecated.daemonset.template.generation: "2"
creationTimestamp: "2024-04-01T06:14:41Z"
- generation: 1
+ generation: 2
name: csi-plugin
namespace: kube-system
resourceVersion: "21730396"
@@ -33,7 +33,7 @@
- args:
- --endpoint=$(CSI_ENDPOINT)
- --v=2
- - --driver=oss,nas,disk
+ - --driver=disk,nas,oss
env:
- name: CSI_ENDPOINT
value: unix://var/lib/kubelet/csi-plugins/driverplugin.csi.alibabacloud.com-replace/csi.sock
@@ -97,8 +97,6 @@
name: run-csi
- mountPath: /host/sys/fs/cgroup/blkio/kubepods.slice
name: cgroupv1-blkio
- - mountPath: /host/usr/
- name: ossconnectordir
- mountPath: /host/var/run/efc
name: efc-metrics-dir
- mountPath: /host/var/run/ossfs
@@ -188,14 +186,14 @@
hostPID: true
initContainers:
- args:
- - --driver=oss,nas,disk
+ - --driver=disk,nas,oss
image: registry-cn-beijing-vpc.ack.aliyuncs.com/acs/csi-plugin:v1.28.6-01f3845-aliyun-init
imagePullPolicy: IfNotPresent
name: init
resources:
limits:
cpu: 200m
- memory: 200Mi
+ memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
diff -u -N /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/LIVE-1568119544/apps.v1.Deployment.kube-system.csi-provisioner /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/MERGED-1853621355/apps.v1.Deployment.kube-system.csi-provisioner
--- /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/LIVE-1568119544/apps.v1.Deployment.kube-system.csi-provisioner 2024-04-09 17:52:56
+++ /var/folders/kc/jv1f0gpx6671wxsfd_0hzbbm0000gp/T/MERGED-1853621355/apps.v1.Deployment.kube-system.csi-provisioner 2024-04-09 17:52:56
@@ -4,7 +4,7 @@
annotations:
deployment.kubernetes.io/revision: "1"
creationTimestamp: "2024-04-01T06:14:20Z"
- generation: 1
+ generation: 2
name: csi-provisioner
namespace: kube-system
resourceVersion: "21730216"
@@ -47,6 +47,10 @@
operator: NotIn
values:
- virtual-kubelet
+ - key: alibabacloud.com/is-edge-worker
+ operator: NotIn
+ values:
+ - "true"
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
@@ -62,7 +66,7 @@
- args:
- --endpoint=$(CSI_ENDPOINT)
- --v=2
- - --driver=nas,disk,oss
+ - --driver=disk,nas,oss
env:
- name: CLUSTER_ID
value: cf08b25a9078c4bb6ae876776450d1324
@@ -118,8 +122,6 @@
volumeMounts:
- mountPath: /host/etc
name: etc
- - mountPath: /host/run/csi-tool
- name: run-csi
- mountPath: /mnt
mountPropagation: Bidirectional
name: host-mnt
@@ -222,7 +224,7 @@
resources:
limits:
cpu: 500m
- memory: 8Gi
+ memory: 1Gi
requests:
cpu: 10m
memory: 16Mi
@@ -271,7 +273,7 @@
resources:
limits:
cpu: 500m
- memory: 8Gi
+ memory: 1Gi
requests:
cpu: 10m
memory: 16Mi
@@ -367,10 +369,6 @@
name: nas-provisioner-dir
- emptyDir: {}
name: oss-provisioner-dir
- - hostPath:
- path: /run/csi-tool
- type: DirectoryOrCreate
- name: run-csi
status:
availableReplicas: 2
conditions: values-diff.yaml: images:
registry: registry-cn-beijing-vpc.ack.aliyuncs.com
controller:
tag: "v1.28.6-01f3845-aliyun"
plugin:
tag: "v1.28.6-01f3845-aliyun"
pluginInit:
tag: "v1.28.6-01f3845-aliyun-init"
deploy:
clusterID: cxxxxxxxx where kubectl is patched to suppress order changes: diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go b/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go
index 2afa6b17e9b..517e3c7708a 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/diff/diff.go
@@ -22,6 +22,7 @@ import (
"os"
"path/filepath"
"regexp"
+ "slices"
"strings"
"github.com/jonboulle/clockwork"
@@ -562,6 +563,53 @@ func NewDiffer(from, to string) (*Differ, error) {
return &differ, nil
}
+func canonicalize(obj runtime.Object) {
+ a, err := meta.Accessor(obj)
+ if err != nil {
+ return
+ }
+ anno := a.GetAnnotations()
+ delete(anno, "kubectl.kubernetes.io/last-applied-configuration")
+ a.SetAnnotations(anno)
+
+ var templ map[string]interface{}
+ gvk := obj.GetObjectKind().GroupVersionKind()
+ switch gvk.Kind {
+ case "Deployment", "StatefulSet", "DaemonSet":
+ obj := obj.(*unstructured.Unstructured)
+ t, found, err := unstructured.NestedMap(obj.Object, "spec", "template", "spec")
+ if !found {
+ return
+ }
+ if err != nil {
+ panic(err)
+ }
+ templ = t
+ default:
+ return
+ }
+ slices.SortFunc(templ["volumes"].([]any), func(i, j any) int {
+ return strings.Compare(i.(map[string]any)["name"].(string), j.(map[string]any)["name"].(string))
+ })
+ slices.SortFunc(templ["containers"].([]any), func(i, j any) int {
+ return strings.Compare(i.(map[string]any)["name"].(string), j.(map[string]any)["name"].(string))
+ })
+ for _, container := range templ["containers"].([]any) {
+ c := container.(map[string]any)
+ if c["env"] != nil {
+ slices.SortFunc(c["env"].([]any), func(i, j any) int {
+ return strings.Compare(i.(map[string]any)["name"].(string), j.(map[string]any)["name"].(string))
+ })
+ }
+ if c["volumeMounts"] != nil {
+ slices.SortFunc(c["volumeMounts"].([]any), func(i, j any) int {
+ return strings.Compare(i.(map[string]any)["mountPath"].(string), j.(map[string]any)["mountPath"].(string))
+ })
+ }
+ }
+ unstructured.SetNestedMap(obj.(*unstructured.Unstructured).Object, templ, "spec", "template", "spec")
+}
+
// Diff diffs to versions of a specific object, and print both versions to directories.
func (d *Differ) Diff(obj Object, printer Printer, showManagedFields bool) error {
from, err := d.From.getObject(obj)
@@ -586,6 +634,8 @@ func (d *Differ) Diff(obj Object, printer Printer, showManagedFields bool) error
}
from, to = m.From(), m.To()
}
+ canonicalize(from)
+ canonicalize(to)
if err := d.From.Print(obj.Name(), from, printer); err != nil {
return err |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huww98, mowangdk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
/kind documentation
What this PR does / why we need it:
this should cover the current ECS/non-ECS, and also ACK/ACK-edge cases
I would like to build a single source of truth to cover all the manifest spread over everywhere.
net changes from previous yaml:
registry-cn-hangzhou.ack.aliyuncs.com
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: