-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from OpenCHAMI/rainest/dhcp-refactor
Add CoreDHCP to Helm
- Loading branch information
Showing
12 changed files
with
174 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: coredhcp | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
config.yaml: | | ||
server4: | ||
listen: | ||
- 0.0.0.0:67 | ||
plugins: | ||
# Base CoreDHCP config | ||
- server_id: {{ .Values.coredhcp.config.server_id }} | ||
- dns: {{ .Values.coredhcp.config.dns | join " " }} | ||
- router: {{ .Values.coredhcp.config.router }} | ||
- netmask: {{ .Values.coredhcp.config.netmask }} | ||
- range: /leases/leases.txt {{ .Values.coredhcp.config.range.start }} {{ .Values.coredhcp.config.range.end }} {{ .Values.coredhcp.config.range.duration }} | ||
# | ||
# CoreSMD config | ||
# Args: ochami_base_url boot_script_base_url ca_cert_path cache_update_interval long_lease_time single_port_mode | ||
# SMD does not currently provide HTTPS, but we have to provide a cert for the positional arguments, so "" in arg 3 disables HTTPS. | ||
# We need single port mode to allow TFTP requests to traverse container network NAT tables successfully. | ||
- coresmd: http://smd:{{ .Values.smd.service.port }} http://bss:{{ .Values.bss.service.port }} "" 30s 1h true | ||
# | ||
# Optionally include the file plugin here if it matters which IPs get assigned to which | ||
# MACs. Otherwise, unknown MACs get passed to the bootloop "catch-all" plugin below. | ||
# | ||
{{ if .Values.coredhcp.leaseMap.name }} | ||
- file /static/{{ .Values.coredhcp.leaseMap.key }} | ||
{{ end }} | ||
# Args: storage_path ipxe_script_path short_lease_time ip_pool_start ip_pool_end | ||
- bootloop: /leases/coredhcp.db default {{ .Values.coredhcp.config.unrecognized_range.duration }} {{ .Values.coredhcp.config.unrecognized_range.start }} {{ .Values.coredhcp.config.unrecognized_range.end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: coredhcp | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: coredhcp | ||
spec: | ||
replicas: {{ .Values.coredhcp.deployment.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app: coredhcp | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: coredhcp | ||
annotations: | ||
checksum/config: {{ include (print $.Template.BasePath "/coredhcp/configmap.yaml") . | sha256sum }} | ||
spec: | ||
containers: | ||
- name: coredhcp | ||
image: {{ .Values.coredhcp.deployment.image.repository }}/{{ .Values.coredhcp.deployment.image.name }}:{{ .Values.coredhcp.deployment.image.tag }} | ||
imagePullPolicy: {{ .Values.coredhcp.deployment.image.pullPolicy }} | ||
args: | ||
- "/coredhcp" | ||
- "-L" | ||
- "debug" | ||
ports: | ||
# TODO ideall we'd run as non-root with DHCP and TFTP traffic forwarded to high ports from the Service, | ||
# but upstream coresmd currently hardcodes port 69 | ||
- name: dhcp | ||
containerPort: 67 | ||
protocol: UDP | ||
- name: tftp | ||
containerPort: 69 | ||
protocol: UDP | ||
volumeMounts: | ||
- mountPath: /leases | ||
name: leases | ||
- mountPath: /etc/coredhcp/ | ||
name: config | ||
{{- if .Values.coredhcp.leaseMap.name }} | ||
- mountPath: /static | ||
name: static | ||
{{- end }} | ||
volumes: | ||
- name: leases | ||
emptyDir: | ||
sizeLimit: 512M | ||
- name: config | ||
configMap: | ||
name: coredhcp | ||
{{- if .Values.coredhcp.leaseMap.name }} | ||
- name: static | ||
configMap: | ||
name: {{ .Values.coredhcp.leaseMap.name }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: {{ .Release.Namespace }} | ||
name: coredhcp | ||
{{- with .Values.coredhcp.service.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ .Values.coredhcp.service.type }} | ||
ports: | ||
- port: {{ .Values.coredhcp.service.dhcp.port }} | ||
targetPort: 67 | ||
name: dhcp | ||
protocol: UDP | ||
- port: {{ .Values.coredhcp.service.tftp.port }} | ||
targetPort: 69 | ||
name: tftp | ||
protocol: UDP | ||
selector: | ||
app: coredhcp |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters