apiVersion: v1 kind: Namespace metadata: name: pxe labels: workload.edge.ncr.com: platform annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: dhcphosts.dnsmasq.kvaps.cf annotations: controller-gen.kubebuilder.io/version: v0.8.0 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} spec: group: dnsmasq.kvaps.cf names: kind: DhcpHosts listKind: DhcpHostsList plural: dhcphosts singular: dhcphosts scope: Namespaced versions: - name: v1beta1 additionalPrinterColumns: - name: Controller type: string jsonPath: .spec.controller - name: Age type: date jsonPath: .metadata.creationTimestamp schema: openAPIV3Schema: type: object description: DhcpHosts is the Schema for the dhcphosts API properties: apiVersion: type: string 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' kind: type: string 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' metadata: type: object spec: type: object description: DhcpHostsSpec defines the desired state of DhcpHosts properties: controller: type: string hosts: type: array items: type: object description: DnsmasqDhcpHost holds the mapping between Macs and IP that will be added to dnsmasq dhcp-hosts file. properties: hostname: type: string clientID: type: string ignore: type: boolean ip: type: string leaseTime: type: string macs: type: array items: type: string setTags: type: array items: type: string tags: type: array items: type: string status: type: object description: DhcpHostsStatus defines the observed state of DhcpHosts served: true storage: true subresources: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: dhcpoptions.dnsmasq.kvaps.cf annotations: controller-gen.kubebuilder.io/version: v0.8.0 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} spec: group: dnsmasq.kvaps.cf names: kind: DhcpOptions listKind: DhcpOptionsList plural: dhcpoptions singular: dhcpoptions scope: Namespaced versions: - name: v1beta1 additionalPrinterColumns: - name: Controller type: string jsonPath: .spec.controller - name: Age type: date jsonPath: .metadata.creationTimestamp schema: openAPIV3Schema: type: object description: DhcpOptions is the Schema for the dhcpoptions API properties: apiVersion: type: string 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' kind: type: string 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' metadata: type: object spec: type: object description: DhcpOptionsSpec defines the desired state of DhcpOptions properties: controller: type: string options: type: array items: type: object description: DhcpOption defines dhcp-option for dnsmasq properties: encap: type: string key: type: string pattern: ^([0-9]+|option:.+|option6:.+)$ leaseTime: type: string tags: type: array items: type: string values: type: array items: type: string viEncap: type: string required: - key - values status: type: object description: DhcpOptionsStatus defines the observed state of DhcpOptions served: true storage: true subresources: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: dnshosts.dnsmasq.kvaps.cf annotations: controller-gen.kubebuilder.io/version: v0.8.0 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} spec: group: dnsmasq.kvaps.cf names: kind: DnsHosts listKind: DnsHostsList plural: dnshosts singular: dnshosts scope: Namespaced versions: - name: v1beta1 additionalPrinterColumns: - name: Controller type: string jsonPath: .spec.controller - name: Age type: date jsonPath: .metadata.creationTimestamp schema: openAPIV3Schema: type: object description: DnsHosts is the Schema for the dnshosts API properties: apiVersion: type: string 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' kind: type: string 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' metadata: type: object spec: type: object description: DnsHostsSpec defines the desired state of DnsHosts properties: controller: type: string hosts: type: array items: type: object description: DnsHost holds the mapping between IP and hostnames that will be added to dnsmasq hosts file. properties: hostnames: type: array description: Hostnames for the above IP address. items: type: string ip: type: string description: IP address of the host file entry. required: - ip status: type: object description: DnsHostsStatus defines the observed state of DnsHosts served: true storage: true subresources: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: dnsmasqoptions.dnsmasq.kvaps.cf annotations: controller-gen.kubebuilder.io/version: v0.8.0 pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} spec: group: dnsmasq.kvaps.cf names: kind: DnsmasqOptions listKind: DnsmasqOptionsList plural: dnsmasqoptions singular: dnsmasqoptions scope: Namespaced versions: - name: v1beta1 additionalPrinterColumns: - name: Controller type: string jsonPath: .spec.controller - name: Age type: date jsonPath: .metadata.creationTimestamp schema: openAPIV3Schema: type: object description: DnsmasqOptions is the Schema for the dnsmasqoptions API properties: apiVersion: type: string 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' kind: type: string 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' metadata: type: object spec: type: object description: DnsmasqOptionsSpec defines the desired state of DnsmasqOptions properties: controller: type: string options: type: array items: type: object description: DnsmasqOption defines option for dnsmasq properties: key: type: string enum: - dhcp-range - dhcp-host - dhcp-userclass - dhcp-circuitid - dhcp-remoteid - dhcp-subscrid - dhcp-ignore - dhcp-broadcast - mx-host - dhcp-boot - dhcp-option - dhcp-option-force - server - rev-server - local - domain - dhcp-vendorclass - alias - dhcp-vendorclass - srv-host - txt-record - ptr-record - bootp-dynamic - dhcp-mac - dhcp-ignore-names - rebind-domain-ok - dhcp-match - dhcp-name-match - tag-if - naptr-record - dhcp-generate-names - cname - pxe-service - add-mac - dhcp-duid - host-record - caa-record - dns-rr - auth-zone - synth-domain values: type: array items: type: string required: - key - values status: type: object description: DnsmasqOptionsStatus defines the observed state of DnsmasqOptions served: true storage: true subresources: {} --- apiVersion: v1 kind: ServiceAccount metadata: name: dnsmasq-controller namespace: pxe annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: dnsmasq-controller-leader-election namespace: pxe annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} rules: - resources: - configmaps apiGroups: - "" verbs: - get - list - watch - create - update - patch - delete - resources: - configmaps/status apiGroups: - "" verbs: - get - update - patch - resources: - events apiGroups: - "" verbs: - create --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: dnsmasq-controller annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} rules: - resources: - dhcphosts - dhcpoptions - dnsmasqoptions apiGroups: - dnsmasq.kvaps.cf verbs: - get - list - watch - create - delete - update - resources: - dnshosts apiGroups: - dnsmasq.kvaps.cf verbs: - get - list - watch - resources: - ienodes apiGroups: - dsds.edge.ncr.com verbs: - get - list - watch - resources: - configmaps apiGroups: - "" verbs: - get - list - watch - resources: - deployments apiGroups: - apps verbs: - get - create - patch - delete - list - update - watch - resources: - services apiGroups: - "" verbs: - get - create - delete - list - watch - resources: - secrets apiGroups: - "" verbs: - get - list - watch - resources: - nodes apiGroups: - "" verbs: - get - list - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: dnsmasq-controller-leader-election namespace: pxe annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} roleRef: name: dnsmasq-controller-leader-election kind: Role apiGroup: rbac.authorization.k8s.io subjects: - name: dnsmasq-controller namespace: pxe kind: ServiceAccount --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: dnsmasq-controller annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} roleRef: name: dnsmasq-controller kind: ClusterRole apiGroup: rbac.authorization.k8s.io subjects: - name: dnsmasq-controller namespace: pxe kind: ServiceAccount --- apiVersion: v1 kind: ConfigMap metadata: name: ipxe-template namespace: pxe annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a labels: {} data: IPXE_LOCATION: /opt/nodes IPXE_TEMPLATE_LOCATION: /etc/node-ipxe-template.tmpl node-ipxe-template.tmpl: | #!ipxe echo iPXE NCR {{.IEN_NAME}} show unixtime kernel http://{{.VIP}}:30095/vmlinuz initrd=initrd fetch=http://{{.VIP}}:30095/filesystem.squashfs BOOTIF={{.MAC}} ip={{.NODE_IP}}::{{.GATEWAY_4}}:{{.SUBNET_MASK}}:{{.IEN_NAME}}::off boot=live components locale=en_GB.UTF-8 setkmap=gb mirror/country=GB hostname=pxe-{{.IEN_NAME}} ncr/opmode=install {{.NCR_ACTIVATION_CODE}} ncr/edge_endpoint={{.API_ENDPOINT}} initrd http://{{.VIP}}:30095/initrd # shell boot || # If everything failed, give the user some options echo Boot failed prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell || --- apiVersion: apps/v1 kind: Deployment metadata: name: dnsmasq-controller labels: app: dnsmasq-controller role: dhcp platform.edge.ncr.com/component: pxe-controller namespace: pxe annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a spec: selector: matchLabels: app: dnsmasq-controller role: dhcp platform.edge.ncr.com/component: pxe-controller template: metadata: labels: app: dnsmasq-controller role: dhcp platform.edge.ncr.com/component: pxe-controller annotations: pallet.edge.ncr.com/created: "2023-02-16T21:26:39Z" pallet.edge.ncr.com/name: pxe pallet.edge.ncr.com/revision: 696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/source: https://github.com/ncrvoyix-swt-retail/edge-infra/tree/696897a3df910b6e84a88c9336907a17b18159c1 pallet.edge.ncr.com/team: '@ncrvoyix-swt-retail/sds' pallet.edge.ncr.com/version: 7.7.7-rc.1676582799+commit.696897a spec: terminationGracePeriodSeconds: 10 serviceAccountName: dnsmasq-controller hostNetwork: true priorityClassName: system-cluster-critical containers: - name: dnsmasq image: us-east1-docker.pkg.dev/ret-edge-pltf-infra/workloads/dnsmasq-controller@sha256:3f992c47121a4b3074c02e892f6ccf15dd01c8777fe5f3a19fe5880214cfeb6a args: - --watch-namespace=$(NAMESPACE) - --metrics-addr=:0 - --enable-leader-election=true - --dhcp - -- - --dhcp-broadcast - --dhcp-authoritative - --leasefile-ro - --enable-tftp - --tftp-root=/opt env: - name: NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace resources: limits: cpu: "100m" memory: 30Mi requests: cpu: 100m memory: 20Mi securityContext: capabilities: add: - NET_ADMIN command: ["/dnsmasq-controller"] imagePullPolicy: IfNotPresent volumeMounts: - name: nodes mountPath: /opt/nodes - name: pxe-controller image: us-east1-docker.pkg.dev/ret-edge-pltf-infra/workloads/pxe-controller@sha256:ea961dc8c22600632dd4f5b7e1f0fa0974901b7749f98b20ff2f82c97b407b6c env: - name: IPXE_LOCATION valueFrom: configMapKeyRef: name: ipxe-template key: IPXE_LOCATION - name: IPXE_TEMPLATE_LOCATION valueFrom: configMapKeyRef: name: ipxe-template key: IPXE_TEMPLATE_LOCATION - name: EDGE_API value: https://$env.$domain/api/v2 volumeMounts: - name: nodes mountPath: /opt/nodes - name: ipxe-template readOnly: true mountPath: "/etc/node-ipxe-template.tmpl" subPath: "node-ipxe-template.tmpl" - name: boot readOnly: true mountPath: "/boot" imagePullPolicy: IfNotPresent tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists - key: CriticalAddonsOnly operator: Exists affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - preference: matchExpressions: - key: node.ncr.com/class operator: In values: - server weight: 100 imagePullSecrets: - name: edge-docker-pull-secret volumes: - name: boot hostPath: path: /boot - name: ipxe-template configMap: name: ipxe-template - name: nodes emptyDir: {} strategy: type: Recreate