Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install-generic)
run: ct install --config tests/ct.yaml --excluded-charts harvester-csi-driver-lvm
run: ct install --config tests/ct-install.yaml

- name: Run chart-testing (install-lvm)
run: ct install --config tests/ct.yaml --charts charts/harvester-csi-driver-lvm
Expand Down
23 changes: 23 additions & 0 deletions charts/forklift-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
24 changes: 24 additions & 0 deletions charts/forklift-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: forklift-operator
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: 1.8.0-dev.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: "main-head"

maintainers:
- name: harvester
52 changes: 52 additions & 0 deletions charts/forklift-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "forklift-operator.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 "forklift-operator.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 "forklift-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "forklift-operator.labels" -}}
helm.sh/chart: {{ include "forklift-operator.chart" . }}
{{ include "forklift-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "forklift-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "forklift-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

96 changes: 96 additions & 0 deletions charts/forklift-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{{- $repo := .Values.forkliftOperatorAnsible.forkliftOperator.repo -}}
{{- $tag := .Values.forkliftOperatorAnsible.forkliftOperator.tag -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "forklift-operator.fullname" . }}-forklift-operator-ansible
labels:
control-plane: controller-manager
{{- include "forklift-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.forkliftOperatorAnsible.replicas }}
selector:
matchLabels:
app: forklift
name: controller-manager
{{- include "forklift-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: forklift
name: controller-manager
{{- include "forklift-operator.selectorLabels" . | nindent 8 }}
spec:
containers:
- args: {{- toYaml .Values.forkliftOperatorAnsible.forkliftOperator.args | nindent 8 }}
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: ANSIBLE_GATHERING
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.ansibleGathering }}
- name: CONTROLLER_IMAGE
value: "{{$repo}}/harvester-forklift-controller:{{$tag}}"
- name: API_IMAGE
value: "{{$repo}}/harvester-forklift-api:{{$tag}}"
- name: MUST_GATHER_IMAGE
value: "{{$repo}}/harvester-forklift-must-gather:{{$tag}}"
- name: UI_PLUGIN_IMAGE
value: ""
- name: VALIDATION_IMAGE
value: "{{$repo}}/harvester-validation:{{$tag}}"
- name: VIRT_V2V_IMAGE
value: "{{$repo}}/harvester-virt-v2v:{{$tag}}"
- name: VIRT_V2V_DONT_REQUEST_KVM
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.virtV2VDontRequestKvm }}
- name: SNAPSHOT_REMOVAL_TIMEOUT
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.snapshotRemovalTimeout }}
- name: SNAPSHOT_STATUS_CHECK_RATE
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.snapshotStatusCheckRate }}
- name: CLEANUP_RETRIES
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.cleanupRetries }}
- name: CDI_EXPORT_TOKEN_TTL
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.cdiExportTokenTtl }}
- name: FILESYSTEM_OVERHEAD
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.filesystemOverhead }}
- name: BLOCK_OVERHEAD
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.blockOverhead }}
- name: POPULATOR_CONTROLLER_IMAGE
value: "{{$repo}}/harvester-populator-controller:{{$tag}}"
- name: OVIRT_POPULATOR_IMAGE
value: "{{$repo}}/harvester-forklift-ovirt-populator:{{$tag}}"
- name: OPENSTACK_POPULATOR_IMAGE
value: "{{$repo}}/harvester-forklift-openstack-populator:{{$tag}}"
- name: OVA_PROVIDER_SERVER_IMAGE
value: "{{$repo}}/harvester-forklift-ova-provider-server:{{$tag}}"
- name: OVIRT_OS_MAP
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.ovirtOsMap }}
- name: VSPHERE_OS_MAP
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.vsphereOsMap }}
- name: VIRT_CUSTOMIZE_MAP
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.virtCustomizeMap }}
- name: VSPHERE_XCOPY_VOLUME_POPULATOR_IMAGE
value: {{ quote .Values.forkliftOperatorAnsible.forkliftOperator.env.vsphereXcopyVolumePopulatorImage }}
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
image: "{{ .Values.forkliftOperatorAnsible.forkliftOperator.repo }}/{{ .Values.forkliftOperatorAnsible.forkliftOperator.operatorImage }}:{{ .Values.forkliftOperatorAnsible.forkliftOperator.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.forkliftOperatorAnsible.forkliftOperator.imagePullPolicy }}
livenessProbe:
httpGet:
path: /healthz
port: 6789
initialDelaySeconds: 15
periodSeconds: 20
name: forklift-operator
readinessProbe:
httpGet:
path: /readyz
port: 6789
initialDelaySeconds: 5
periodSeconds: 10
resources: {{- toYaml .Values.forkliftOperatorAnsible.forkliftOperator.resources | nindent 10 }}
nodeSelector: {{- toYaml .Values.forkliftOperatorAnsible.nodeSelector | nindent 8 }}
serviceAccountName: forklift-operator
tolerations: {{- toYaml .Values.forkliftOperatorAnsible.tolerations | nindent 8 }}
topologySpreadConstraints: {{- toYaml .Values.forkliftOperatorAnsible.topologySpreadConstraints | nindent 8 }}
58 changes: 58 additions & 0 deletions charts/forklift-operator/templates/forklift-api-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "forklift-operator.fullname" . }}-forklift-api-role
labels:
{{- include "forklift-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- forklift.konveyor.io
resources:
- plans
- providers
- storagemaps
- hosts
verbs:
- get
- list
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- apiGroups:
- k8s.cni.cncf.io
resources:
- network-attachment-definitions
verbs:
- get
- list
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "forklift-operator.fullname" . }}-forklift-api-rolebinding
labels:
{{- include "forklift-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "forklift-operator.fullname" . }}-forklift-api-role'
subjects:
- kind: ServiceAccount
name: forklift-api
namespace: '{{ .Release.Namespace }}'
Loading
Loading