diff --git a/whereabouts/Chart.yaml b/whereabouts/Chart.yaml index 50554c5..c4f9e46 100644 --- a/whereabouts/Chart.yaml +++ b/whereabouts/Chart.yaml @@ -15,9 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.8.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.16.0 +appVersion: 0.8.0 diff --git a/whereabouts/crds/whereabouts.cni.cncf.io_ippools.yaml b/whereabouts/crds/whereabouts.cni.cncf.io_ippools.yaml index c912654..8e0ef36 100644 --- a/whereabouts/crds/whereabouts.cni.cncf.io_ippools.yaml +++ b/whereabouts/crds/whereabouts.cni.cncf.io_ippools.yaml @@ -1,9 +1,9 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: ippools.whereabouts.cni.cncf.io spec: group: whereabouts.cni.cncf.io @@ -20,14 +20,19 @@ spec: description: IPPool is the Schema for the ippools API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -41,14 +46,17 @@ spec: properties: id: type: string + ifname: + type: string podref: type: string required: - id + - podref type: object - description: Allocations is the set of allocated IPs for the given - range. Its` indices are a direct mapping to the IP with the same - index/offset for the pool's range. + description: |- + Allocations is the set of allocated IPs for the given range. Its` indices are a direct mapping to the + IP with the same index/offset for the pool's range. type: object range: description: Range is a RFC 4632/4291-style string that represents @@ -61,9 +69,3 @@ spec: type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/whereabouts/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml b/whereabouts/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml index 82d9547..f95cdfb 100644 --- a/whereabouts/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml +++ b/whereabouts/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml @@ -1,9 +1,9 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: overlappingrangeipreservations.whereabouts.cni.cncf.io spec: group: whereabouts.cni.cncf.io @@ -21,14 +21,19 @@ spec: API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -38,19 +43,15 @@ spec: properties: containerid: type: string + ifname: + type: string podref: type: string required: - - containerid + - podref type: object required: - spec type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/whereabouts/templates/cluster_role.yaml b/whereabouts/templates/cluster_role.yaml index 148ae90..17f3b42 100644 --- a/whereabouts/templates/cluster_role.yaml +++ b/whereabouts/templates/cluster_role.yaml @@ -22,6 +22,11 @@ rules: - leases verbs: - '*' +- apiGroups: [""] + resources: + - nodes + verbs: + - get - apiGroups: [""] resources: - pods @@ -44,3 +49,4 @@ rules: - create - patch - update + - get diff --git a/whereabouts/templates/configmap.yaml b/whereabouts/templates/configmap.yaml new file mode 100644 index 0000000..a2c6327 --- /dev/null +++ b/whereabouts/templates/configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "whereabouts.fullname" . }}-config + {{- include "whereabouts.namespace" . | nindent 2 }} + labels: + {{- include "whereabouts.labels" . | nindent 4 }} + annotations: + kubernetes.io/description: | + Configmap containing user customizable cronjob schedule +data: + cron-expression: {{ .Values.cron.schedule | quote }} # Default schedule is once per day at 4:30am. Users may configure this value to their liking. diff --git a/whereabouts/templates/cronjob.yaml b/whereabouts/templates/cronjob.yaml deleted file mode 100644 index 9a3eb65..0000000 --- a/whereabouts/templates/cronjob.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: batch/v1beta1 -kind: CronJob -metadata: - name: {{ include "whereabouts.fullname" . }} - {{- include "whereabouts.namespace" . | nindent 2 }} - labels: - {{- include "whereabouts.labels" . | nindent 4 }} -spec: - concurrencyPolicy: Forbid - successfulJobsHistoryLimit: {{ .Values.successfulJobsHistoryLimit | default "0" }} - schedule: "*/5 * * * *" - jobTemplate: - spec: - backoffLimit: 0 - template: - metadata: - labels: - name: whereabouts - {{- include "whereabouts.selectorLabels" . | nindent 12 }} - spec: - priorityClassName: "system-node-critical" - serviceAccountName: {{ include "whereabouts.serviceAccountName" . }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 12 }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 16 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - resources: - {{- toYaml .Values.resources | nindent 16 }} - command: - - /ip-reconciler - - -log-level=verbose - volumeMounts: - - name: cni-net-dir - mountPath: /host/etc/cni/net.d - volumes: - - name: cni-net-dir - hostPath: - path: /etc/cni/net.d - restartPolicy: OnFailure - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 12 }} - {{- end }} diff --git a/whereabouts/templates/daemonset.yaml b/whereabouts/templates/daemonset.yaml index fda9b24..3fd07fa 100644 --- a/whereabouts/templates/daemonset.yaml +++ b/whereabouts/templates/daemonset.yaml @@ -32,11 +32,22 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + command: [ "/bin/sh" ] + args: + - -c + - > + SLEEP=false /install-cni.sh && + /ip-control-loop -log-level debug securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: + - name: NODENAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName - name: WHEREABOUTS_NAMESPACE valueFrom: fieldRef: @@ -48,6 +59,8 @@ spec: mountPath: /host/opt/cni/bin - name: cni-net-dir mountPath: /host/etc/cni/net.d + - name: cron-scheduler-configmap + mountPath: /cron-schedule volumes: - name: cnibin hostPath: @@ -55,6 +68,13 @@ spec: - name: cni-net-dir hostPath: path: /etc/cni/net.d + - name: cron-scheduler-configmap + configMap: + name: {{ include "whereabouts.fullname" .}}-config + defaultMode: 0744 + items: + - key: "cron-expression" + path: "config" {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/whereabouts/values.yaml b/whereabouts/values.yaml index a68593b..84bcfd8 100644 --- a/whereabouts/values.yaml +++ b/whereabouts/values.yaml @@ -6,7 +6,10 @@ image: repository: ghcr.io/k8snetworkplumbingwg/whereabouts pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "latest-amd64" + tag: "v0.8.0" + +cron: + schedule: "30 4 * * *" # default is daily at 04:30 updateStrategy: RollingUpdate imagePullSecrets: []