diff --git a/cluster-provision/k8s/1.22/manifests/whereabouts/whereabouts-v0.5.yaml b/cluster-provision/k8s/1.22/manifests/whereabouts/whereabouts-v0.5.4.yaml similarity index 92% rename from cluster-provision/k8s/1.22/manifests/whereabouts/whereabouts-v0.5.yaml rename to cluster-provision/k8s/1.22/manifests/whereabouts/whereabouts-v0.5.4.yaml index 2adba7b963..c84c7916d7 100644 --- a/cluster-provision/k8s/1.22/manifests/whereabouts/whereabouts-v0.5.yaml +++ b/cluster-provision/k8s/1.22/manifests/whereabouts/whereabouts-v0.5.4.yaml @@ -161,6 +161,24 @@ rules: - pods verbs: - list + - watch +- apiGroups: + - k8s.cni.cncf.io + resources: + - network-attachment-definitions + verbs: + - get + - list + - watch +- apiGroups: + - "" + - events.k8s.io + resources: + - events + verbs: + - create + - patch + - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -184,8 +202,10 @@ metadata: name: ip-reconciler namespace: kube-system spec: + concurrencyPolicy: Forbid jobTemplate: spec: + backoffLimit: 0 template: metadata: labels: @@ -195,7 +215,7 @@ spec: - command: - /ip-reconciler - -log-level=verbose - image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5-amd64 + image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5.4-amd64 name: whereabouts resources: requests: @@ -211,7 +231,9 @@ spec: - hostPath: path: /etc/cni/net.d name: cni-net-dir + ttlSecondsAfterFinished: 300 schedule: '*/5 * * * *' + successfulJobsHistoryLimit: 0 --- apiVersion: apps/v1 kind: DaemonSet @@ -233,12 +255,18 @@ spec: tier: node spec: containers: - - env: + - args: + - -c + - | + SLEEP=false /install-cni.sh && /ip-control-loop -log-level debug + command: + - /bin/sh + env: - name: WHEREABOUTS_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5-amd64 + image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5.4-amd64 name: whereabouts resources: limits: diff --git a/cluster-provision/k8s/1.23/manifests/whereabouts/whereabouts-v0.5.yaml b/cluster-provision/k8s/1.23/manifests/whereabouts/whereabouts-v0.5.4.yaml similarity index 92% rename from cluster-provision/k8s/1.23/manifests/whereabouts/whereabouts-v0.5.yaml rename to cluster-provision/k8s/1.23/manifests/whereabouts/whereabouts-v0.5.4.yaml index 2adba7b963..c84c7916d7 100644 --- a/cluster-provision/k8s/1.23/manifests/whereabouts/whereabouts-v0.5.yaml +++ b/cluster-provision/k8s/1.23/manifests/whereabouts/whereabouts-v0.5.4.yaml @@ -161,6 +161,24 @@ rules: - pods verbs: - list + - watch +- apiGroups: + - k8s.cni.cncf.io + resources: + - network-attachment-definitions + verbs: + - get + - list + - watch +- apiGroups: + - "" + - events.k8s.io + resources: + - events + verbs: + - create + - patch + - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -184,8 +202,10 @@ metadata: name: ip-reconciler namespace: kube-system spec: + concurrencyPolicy: Forbid jobTemplate: spec: + backoffLimit: 0 template: metadata: labels: @@ -195,7 +215,7 @@ spec: - command: - /ip-reconciler - -log-level=verbose - image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5-amd64 + image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5.4-amd64 name: whereabouts resources: requests: @@ -211,7 +231,9 @@ spec: - hostPath: path: /etc/cni/net.d name: cni-net-dir + ttlSecondsAfterFinished: 300 schedule: '*/5 * * * *' + successfulJobsHistoryLimit: 0 --- apiVersion: apps/v1 kind: DaemonSet @@ -233,12 +255,18 @@ spec: tier: node spec: containers: - - env: + - args: + - -c + - | + SLEEP=false /install-cni.sh && /ip-control-loop -log-level debug + command: + - /bin/sh + env: - name: WHEREABOUTS_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5-amd64 + image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5.4-amd64 name: whereabouts resources: limits: diff --git a/cluster-provision/k8s/1.24/manifests/whereabouts/whereabouts-v0.5.yaml b/cluster-provision/k8s/1.24/manifests/whereabouts/whereabouts-v0.5.4.yaml similarity index 92% rename from cluster-provision/k8s/1.24/manifests/whereabouts/whereabouts-v0.5.yaml rename to cluster-provision/k8s/1.24/manifests/whereabouts/whereabouts-v0.5.4.yaml index 2adba7b963..c84c7916d7 100644 --- a/cluster-provision/k8s/1.24/manifests/whereabouts/whereabouts-v0.5.yaml +++ b/cluster-provision/k8s/1.24/manifests/whereabouts/whereabouts-v0.5.4.yaml @@ -161,6 +161,24 @@ rules: - pods verbs: - list + - watch +- apiGroups: + - k8s.cni.cncf.io + resources: + - network-attachment-definitions + verbs: + - get + - list + - watch +- apiGroups: + - "" + - events.k8s.io + resources: + - events + verbs: + - create + - patch + - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -184,8 +202,10 @@ metadata: name: ip-reconciler namespace: kube-system spec: + concurrencyPolicy: Forbid jobTemplate: spec: + backoffLimit: 0 template: metadata: labels: @@ -195,7 +215,7 @@ spec: - command: - /ip-reconciler - -log-level=verbose - image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5-amd64 + image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5.4-amd64 name: whereabouts resources: requests: @@ -211,7 +231,9 @@ spec: - hostPath: path: /etc/cni/net.d name: cni-net-dir + ttlSecondsAfterFinished: 300 schedule: '*/5 * * * *' + successfulJobsHistoryLimit: 0 --- apiVersion: apps/v1 kind: DaemonSet @@ -233,12 +255,18 @@ spec: tier: node spec: containers: - - env: + - args: + - -c + - | + SLEEP=false /install-cni.sh && /ip-control-loop -log-level debug + command: + - /bin/sh + env: - name: WHEREABOUTS_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5-amd64 + image: ghcr.io/k8snetworkplumbingwg/whereabouts:v0.5.4-amd64 name: whereabouts resources: limits: diff --git a/hack/bump-whereabouts.sh b/hack/bump-whereabouts.sh index 4bae7b05a2..5f7ca624c6 100755 --- a/hack/bump-whereabouts.sh +++ b/hack/bump-whereabouts.sh @@ -49,6 +49,7 @@ cd - manifests_dir=doc [[ -d ${tmp_dir}/whereabouts/doc/crds ]] && manifests_dir=doc/crds cp hack/kustomization/whereabouts/*.yaml ${tmp_dir}/whereabouts/${manifests_dir}/ +sed -i "s/##VERSION##/${whereabouts_version}/" ${tmp_dir}/whereabouts/${manifests_dir}/patch-*.yaml target_dir="cluster-provision/k8s/${provider}/manifests/whereabouts" mkdir -p ${target_dir} diff --git a/hack/kustomization/whereabouts/kustomization.yaml b/hack/kustomization/whereabouts/kustomization.yaml index eb54eb1e6c..148d6b15be 100644 --- a/hack/kustomization/whereabouts/kustomization.yaml +++ b/hack/kustomization/whereabouts/kustomization.yaml @@ -7,5 +7,16 @@ resources: - ./whereabouts.cni.cncf.io_ippools.yaml - ./whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml -transformers: - - patch-ip-reconciler-job.yaml +patches: +- path: patch-ip-reconciler-job.yaml + target: + group: batch + version: v1beta1 + kind: CronJob + name: ip-reconciler +- path: patch-daemonset-install.yaml + target: + group: apps + version: v1 + kind: DaemonSet + name: whereabouts diff --git a/hack/kustomization/whereabouts/patch-daemonset-install.yaml b/hack/kustomization/whereabouts/patch-daemonset-install.yaml new file mode 100644 index 0000000000..0fa8b0b809 --- /dev/null +++ b/hack/kustomization/whereabouts/patch-daemonset-install.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: whereabouts +spec: + template: + spec: + containers: + - name: whereabouts + image: ghcr.io/k8snetworkplumbingwg/whereabouts:##VERSION##-amd64 diff --git a/hack/kustomization/whereabouts/patch-ip-reconciler-job.yaml b/hack/kustomization/whereabouts/patch-ip-reconciler-job.yaml index 5af1fa3d48..efdb4e8b23 100644 --- a/hack/kustomization/whereabouts/patch-ip-reconciler-job.yaml +++ b/hack/kustomization/whereabouts/patch-ip-reconciler-job.yaml @@ -1,14 +1,12 @@ -# TODO: remove after whereabouts contains https://github.com/k8snetworkplumbingwg/whereabouts/pull/150 -apiVersion: builtin -kind: LabelTransformer +apiVersion: batch/v1beta1 +kind: CronJob metadata: - name: patch-ip-reconciler-job -labels: - app: whereabouts -fieldSpecs: -- path: spec/jobTemplate/spec/template/metadata/labels - create: true - kind: CronJob - metadata: - name: ip-reconciler - + name: ip-reconciler +spec: + jobTemplate: + spec: + template: + spec: + containers: + - name: whereabouts + image: ghcr.io/k8snetworkplumbingwg/whereabouts:##VERSION##-amd64