From a2e08348ea0be05d5065bf09f8a586297c79b670 Mon Sep 17 00:00:00 2001 From: Gaurav Mehta Date: Tue, 24 Jan 2023 15:42:23 +1100 Subject: [PATCH] initial commit for harvester-seeder helm chart --- charts/harvester-seeder/.helmignore | 23 +++ charts/harvester-seeder/Chart.yaml | 27 +++ .../harvester-seeder/charts/boots/.helmignore | 23 +++ .../harvester-seeder/charts/boots/Chart.yaml | 24 +++ .../charts/boots/templates/_helpers.tpl | 62 ++++++ .../charts/boots/templates/deployment.yaml | 90 +++++++++ .../charts/boots/templates/role-binding.yaml | 12 ++ .../charts/boots/templates/role.yaml | 24 +++ .../charts/boots/templates/service.yaml | 15 ++ .../boots/templates/serviceaccount.yaml | 12 ++ .../harvester-seeder/charts/boots/values.yaml | 60 ++++++ .../harvester-seeder/charts/rufio/.helmignore | 23 +++ .../harvester-seeder/charts/rufio/Chart.yaml | 24 +++ .../charts/rufio/templates/_helpers.tpl | 62 ++++++ .../charts/rufio/templates/deployment.yaml | 57 ++++++ .../charts/rufio/templates/role-binding.yaml | 12 ++ .../charts/rufio/templates/role.yaml | 93 +++++++++ .../charts/rufio/templates/service.yaml | 15 ++ .../rufio/templates/serviceaccount.yaml | 12 ++ .../harvester-seeder/charts/rufio/values.yaml | 42 +++++ .../harvester-seeder/templates/_helpers.tpl | 62 ++++++ .../templates/deployment.yaml | 62 ++++++ charts/harvester-seeder/templates/rbac.yaml | 178 ++++++++++++++++++ .../templates/role-binding.yaml | 25 +++ .../harvester-seeder/templates/service.yaml | 15 ++ .../templates/serviceaccount.yaml | 12 ++ charts/harvester-seeder/values.yaml | 37 ++++ 27 files changed, 1103 insertions(+) create mode 100644 charts/harvester-seeder/.helmignore create mode 100644 charts/harvester-seeder/Chart.yaml create mode 100644 charts/harvester-seeder/charts/boots/.helmignore create mode 100644 charts/harvester-seeder/charts/boots/Chart.yaml create mode 100644 charts/harvester-seeder/charts/boots/templates/_helpers.tpl create mode 100644 charts/harvester-seeder/charts/boots/templates/deployment.yaml create mode 100644 charts/harvester-seeder/charts/boots/templates/role-binding.yaml create mode 100644 charts/harvester-seeder/charts/boots/templates/role.yaml create mode 100644 charts/harvester-seeder/charts/boots/templates/service.yaml create mode 100644 charts/harvester-seeder/charts/boots/templates/serviceaccount.yaml create mode 100644 charts/harvester-seeder/charts/boots/values.yaml create mode 100644 charts/harvester-seeder/charts/rufio/.helmignore create mode 100644 charts/harvester-seeder/charts/rufio/Chart.yaml create mode 100644 charts/harvester-seeder/charts/rufio/templates/_helpers.tpl create mode 100644 charts/harvester-seeder/charts/rufio/templates/deployment.yaml create mode 100644 charts/harvester-seeder/charts/rufio/templates/role-binding.yaml create mode 100644 charts/harvester-seeder/charts/rufio/templates/role.yaml create mode 100644 charts/harvester-seeder/charts/rufio/templates/service.yaml create mode 100644 charts/harvester-seeder/charts/rufio/templates/serviceaccount.yaml create mode 100644 charts/harvester-seeder/charts/rufio/values.yaml create mode 100644 charts/harvester-seeder/templates/_helpers.tpl create mode 100644 charts/harvester-seeder/templates/deployment.yaml create mode 100644 charts/harvester-seeder/templates/rbac.yaml create mode 100644 charts/harvester-seeder/templates/role-binding.yaml create mode 100644 charts/harvester-seeder/templates/service.yaml create mode 100644 charts/harvester-seeder/templates/serviceaccount.yaml create mode 100644 charts/harvester-seeder/values.yaml diff --git a/charts/harvester-seeder/.helmignore b/charts/harvester-seeder/.helmignore new file mode 100644 index 000000000..0e8a0eb3 --- /dev/null +++ b/charts/harvester-seeder/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/harvester-seeder/Chart.yaml b/charts/harvester-seeder/Chart.yaml new file mode 100644 index 000000000..b916f9b2 --- /dev/null +++ b/charts/harvester-seeder/Chart.yaml @@ -0,0 +1,27 @@ +apiVersion: v2 +name: harvester-seeder +description: A Helm chart for Harvester Seeder + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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.0.0-dev + +# 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. +# It is recommended to use it with quotes. +appVersion: v0.1.0 + +maintainers: +- name: harvester diff --git a/charts/harvester-seeder/charts/boots/.helmignore b/charts/harvester-seeder/charts/boots/.helmignore new file mode 100644 index 000000000..0e8a0eb3 --- /dev/null +++ b/charts/harvester-seeder/charts/boots/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/harvester-seeder/charts/boots/Chart.yaml b/charts/harvester-seeder/charts/boots/Chart.yaml new file mode 100644 index 000000000..543fbf88 --- /dev/null +++ b/charts/harvester-seeder/charts/boots/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: boots +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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.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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/charts/harvester-seeder/charts/boots/templates/_helpers.tpl b/charts/harvester-seeder/charts/boots/templates/_helpers.tpl new file mode 100644 index 000000000..5329d02f --- /dev/null +++ b/charts/harvester-seeder/charts/boots/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "boots.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "boots.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "boots.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "boots.labels" -}} +helm.sh/chart: {{ include "boots.chart" . }} +{{ include "boots.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "boots.selectorLabels" -}} +app.kubernetes.io/name: {{ include "boots.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "boots.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "boots.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/harvester-seeder/charts/boots/templates/deployment.yaml b/charts/harvester-seeder/charts/boots/templates/deployment.yaml new file mode 100644 index 000000000..cad49bf1 --- /dev/null +++ b/charts/harvester-seeder/charts/boots/templates/deployment.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "boots.fullname" . }} + labels: + {{- include "boots.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + strategy: + type: Recreate + selector: + matchLabels: + {{- include "boots.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "boots.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "boots.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: BOOTS_EXTRA_KERNEL_ARGS + value: tink_worker_image=quay.io/tinkerbell/tink-worker:latest + - name: DATA_MODEL_VERSION + value: kubernetes + - name: FACILITY_CODE + value: lab1 + - name: HTTP_BIND + value: 0.0.0.0:8080 + - name: PUBLIC_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: MIRROR_BASE_URL + value: "http://$(PUBLIC_IP):8080" + - name: PUBLIC_FQDN + value: "$(PUBLIC_IP):8080" + - name: TINKERBELL_GRPC_AUTHORITY + value: tink-server.tink-system:42113 + - name: TINKERBELL_TLS + value: "false" + args: + - -log-level + - debug + - -dhcp-addr + - 0.0.0.0:67 + ports: + - name: dhcp + containerPort: 67 + protocol: UDP + - name: tftp + containerPort: 69 + protocol: UDP + - name: syslog + containerPort: 514 + protocol: UDP + - name: http + containerPort: 8080 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/harvester-seeder/charts/boots/templates/role-binding.yaml b/charts/harvester-seeder/charts/boots/templates/role-binding.yaml new file mode 100644 index 000000000..1687785d --- /dev/null +++ b/charts/harvester-seeder/charts/boots/templates/role-binding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "boots.fullname" . }}-role +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "boots.fullname" . }}-role +subjects: +- kind: ServiceAccount + name: {{ include "boots.fullname" . }} + namespace: {{ .Release.Namespace }} \ No newline at end of file diff --git a/charts/harvester-seeder/charts/boots/templates/role.yaml b/charts/harvester-seeder/charts/boots/templates/role.yaml new file mode 100644 index 000000000..7f410bbf --- /dev/null +++ b/charts/harvester-seeder/charts/boots/templates/role.yaml @@ -0,0 +1,24 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "boots.fullname" . }}-role +rules: +- apiGroups: + - tinkerbell.org + resources: + - hardware + - hardware/status + verbs: + - get + - list + - watch + - update +- apiGroups: + - tinkerbell.org + resources: + - workflows + - workflows/status + verbs: + - get + - list + - watch \ No newline at end of file diff --git a/charts/harvester-seeder/charts/boots/templates/service.yaml b/charts/harvester-seeder/charts/boots/templates/service.yaml new file mode 100644 index 000000000..5b0dead8 --- /dev/null +++ b/charts/harvester-seeder/charts/boots/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "boots.fullname" . }} + labels: + {{- include "boots.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: 8080 + targetPort: http + protocol: TCP + name: http + selector: + {{- include "boots.selectorLabels" . | nindent 4 }} diff --git a/charts/harvester-seeder/charts/boots/templates/serviceaccount.yaml b/charts/harvester-seeder/charts/boots/templates/serviceaccount.yaml new file mode 100644 index 000000000..67c0802b --- /dev/null +++ b/charts/harvester-seeder/charts/boots/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "boots.serviceAccountName" . }} + labels: + {{- include "boots.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/harvester-seeder/charts/boots/values.yaml b/charts/harvester-seeder/charts/boots/values.yaml new file mode 100644 index 000000000..d56ec986 --- /dev/null +++ b/charts/harvester-seeder/charts/boots/values.yaml @@ -0,0 +1,60 @@ +# Default values for boots. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: gmehta3/boots + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: dev + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi +limits: + cpu: 500m + memory: 128Mi +requests: + cpu: 10m + memory: 64Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/harvester-seeder/charts/rufio/.helmignore b/charts/harvester-seeder/charts/rufio/.helmignore new file mode 100644 index 000000000..0e8a0eb3 --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/harvester-seeder/charts/rufio/Chart.yaml b/charts/harvester-seeder/charts/rufio/Chart.yaml new file mode 100644 index 000000000..7344b1f7 --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: rufio +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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.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. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/charts/harvester-seeder/charts/rufio/templates/_helpers.tpl b/charts/harvester-seeder/charts/rufio/templates/_helpers.tpl new file mode 100644 index 000000000..dac674c1 --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "rufio.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "rufio.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "rufio.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "rufio.labels" -}} +helm.sh/chart: {{ include "rufio.chart" . }} +{{ include "rufio.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "rufio.selectorLabels" -}} +app.kubernetes.io/name: {{ include "rufio.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "rufio.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "rufio.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/harvester-seeder/charts/rufio/templates/deployment.yaml b/charts/harvester-seeder/charts/rufio/templates/deployment.yaml new file mode 100644 index 000000000..7c35e6c1 --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/templates/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "rufio.fullname" . }} + labels: + {{- include "rufio.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "rufio.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "rufio.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "rufio.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + - name: probe + containerPort: 8081 + protocol: TCP + - name: leader + containerPort: 9443 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/harvester-seeder/charts/rufio/templates/role-binding.yaml b/charts/harvester-seeder/charts/rufio/templates/role-binding.yaml new file mode 100644 index 000000000..2d8c021b --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/templates/role-binding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "rufio.fullname" . }}-manager-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "rufio.fullname" . }}-manager-role +subjects: +- kind: ServiceAccount + name: {{ include "rufio.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} \ No newline at end of file diff --git a/charts/harvester-seeder/charts/rufio/templates/role.yaml b/charts/harvester-seeder/charts/rufio/templates/role.yaml new file mode 100644 index 000000000..c7422a2c --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/templates/role.yaml @@ -0,0 +1,93 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: {{ include "rufio.fullname" . }}-manager-role +rules: +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - baseboardmanagements + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - baseboardmanagements/finalizers + verbs: + - update +- apiGroups: + - bmc.tinkerbell.org + resources: + - baseboardmanagements/status + verbs: + - get + - patch + - update +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmcjobs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmcjobs/finalizers + verbs: + - update +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmcjobs/status + verbs: + - get + - patch + - update +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmctasks + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmctasks/finalizers + verbs: + - update +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmctasks/status + verbs: + - get + - patch + - update diff --git a/charts/harvester-seeder/charts/rufio/templates/service.yaml b/charts/harvester-seeder/charts/rufio/templates/service.yaml new file mode 100644 index 000000000..1ebdf425 --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "rufio.fullname" . }} + labels: + {{- include "rufio.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: 9443 + targetPort: http + protocol: TCP + name: http + selector: + {{- include "rufio.selectorLabels" . | nindent 4 }} diff --git a/charts/harvester-seeder/charts/rufio/templates/serviceaccount.yaml b/charts/harvester-seeder/charts/rufio/templates/serviceaccount.yaml new file mode 100644 index 000000000..8fdc6f25 --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "rufio.serviceAccountName" . }} + labels: + {{- include "rufio.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/harvester-seeder/charts/rufio/values.yaml b/charts/harvester-seeder/charts/rufio/values.yaml new file mode 100644 index 000000000..f86a144b --- /dev/null +++ b/charts/harvester-seeder/charts/rufio/values.yaml @@ -0,0 +1,42 @@ +# Default values for rufio. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: gmehta3/rufio + pullPolicy: Always + tag: dev + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/harvester-seeder/templates/_helpers.tpl b/charts/harvester-seeder/templates/_helpers.tpl new file mode 100644 index 000000000..2cba6012 --- /dev/null +++ b/charts/harvester-seeder/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "seeder.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "seeder.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "seeder.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "seeder.labels" -}} +helm.sh/chart: {{ include "seeder.chart" . }} +{{ include "seeder.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "seeder.selectorLabels" -}} +app.kubernetes.io/name: {{ include "seeder.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "seeder.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "seeder.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/harvester-seeder/templates/deployment.yaml b/charts/harvester-seeder/templates/deployment.yaml new file mode 100644 index 000000000..adc5d472 --- /dev/null +++ b/charts/harvester-seeder/templates/deployment.yaml @@ -0,0 +1,62 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "seeder.fullname" . }} + labels: + {{- include "seeder.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "seeder.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "seeder.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "seeder.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: LEADER_ELECTION_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 8080 + protocol: TCP + - name: probe + containerPort: 8081 + protocol: TCP + - name: leader + containerPort: 9443 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/charts/harvester-seeder/templates/rbac.yaml b/charts/harvester-seeder/templates/rbac.yaml new file mode 100644 index 000000000..73429e61 --- /dev/null +++ b/charts/harvester-seeder/templates/rbac.yaml @@ -0,0 +1,178 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: {{ include "seeder.fullname" . }}-manager-role +rules: +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - baseboardmanagements + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - baseboardmanagements/status + verbs: + - get +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmcjobs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - bmc.tinkerbell.org + resources: + - bmcjobs/status + verbs: + - get +- apiGroups: + - metal.harvesterhci.io + resources: + - addresspools + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - metal.harvesterhci.io + resources: + - addresspools/finalizers + verbs: + - update +- apiGroups: + - metal.harvesterhci.io + resources: + - addresspools/status + verbs: + - get + - patch + - update +- apiGroups: + - metal.harvesterhci.io + resources: + - clusters + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - metal.harvesterhci.io + resources: + - clusters/finalizers + verbs: + - update +- apiGroups: + - metal.harvesterhci.io + resources: + - clusters/status + verbs: + - get + - patch + - update +- apiGroups: + - metal.harvesterhci.io + resources: + - inventories + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - metal.harvesterhci.io + resources: + - inventories/finalizers + verbs: + - update +- apiGroups: + - metal.harvesterhci.io + resources: + - inventories/status + verbs: + - get + - patch + - update +- apiGroups: + - tinkerbell.org + resources: + - hardware + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "seeder.fullname" . }}-leader-election-role +rules: +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/charts/harvester-seeder/templates/role-binding.yaml b/charts/harvester-seeder/templates/role-binding.yaml new file mode 100644 index 000000000..78ff3659 --- /dev/null +++ b/charts/harvester-seeder/templates/role-binding.yaml @@ -0,0 +1,25 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "seeder.fullname" . }}-manager-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "seeder.fullname" . }}-manager-role +subjects: +- kind: ServiceAccount + name: {{ include "seeder.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "seeder.fullname" . }}-leader-election-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "seeder.fullname" . }}-leader-election-role +subjects: +- kind: ServiceAccount + name: {{ include "seeder.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} diff --git a/charts/harvester-seeder/templates/service.yaml b/charts/harvester-seeder/templates/service.yaml new file mode 100644 index 000000000..7f4fc205 --- /dev/null +++ b/charts/harvester-seeder/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "seeder.fullname" . }} + labels: + {{- include "seeder.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: 9443 + targetPort: http + protocol: TCP + name: http + selector: + {{- include "seeder.selectorLabels" . | nindent 4 }} diff --git a/charts/harvester-seeder/templates/serviceaccount.yaml b/charts/harvester-seeder/templates/serviceaccount.yaml new file mode 100644 index 000000000..f929df05 --- /dev/null +++ b/charts/harvester-seeder/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "seeder.serviceAccountName" . }} + labels: + {{- include "seeder.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/harvester-seeder/values.yaml b/charts/harvester-seeder/values.yaml new file mode 100644 index 000000000..4b32d45f --- /dev/null +++ b/charts/harvester-seeder/values.yaml @@ -0,0 +1,37 @@ +# Default values for seeder. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: rancher/harvester-seeder + tag: master-head + pullPolicy: Always + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 +