diff --git a/helm/fdb-operator/Chart.yaml b/helm/fdb-operator/Chart.yaml new file mode 100644 index 000000000..4438f7a85 --- /dev/null +++ b/helm/fdb-operator/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: fdb-operator +description: A Helm chart for foundationDB operator + +# 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. +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. +appVersion: 1.16.0 diff --git a/helm/fdb-operator/templates/NOTES.txt b/helm/fdb-operator/templates/NOTES.txt new file mode 100644 index 000000000..b887fad51 --- /dev/null +++ b/helm/fdb-operator/templates/NOTES.txt @@ -0,0 +1,6 @@ +FoundationDB operator has been installed successfully. + +To see the logs of the operator you can use below command +kubectl logs deployment/{{ .Values.operator.name }} -n -f + +Thanks for trying out FoundationDB helm chart. \ No newline at end of file diff --git a/helm/fdb-operator/templates/_helpers.tpl b/helm/fdb-operator/templates/_helpers.tpl new file mode 100644 index 000000000..021478947 --- /dev/null +++ b/helm/fdb-operator/templates/_helpers.tpl @@ -0,0 +1,14 @@ +{{/* +Common labels +*/}} +{{- define "chart.labels" -}} +app: fdb-kubernetes-operator-controller-manager +control-plane: controller-manager +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "chart.selectorLabels" -}} +app: fdb-kubernetes-operator-controller-manager +{{- end -}} diff --git a/helm/fdb-operator/templates/crds/apps.foundationdb.org_foundationdbclusters.yaml b/helm/fdb-operator/templates/crds/apps.foundationdb.org_foundationdbclusters.yaml new file mode 120000 index 000000000..3fb73d384 --- /dev/null +++ b/helm/fdb-operator/templates/crds/apps.foundationdb.org_foundationdbclusters.yaml @@ -0,0 +1 @@ +../../../../config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml \ No newline at end of file diff --git a/helm/fdb-operator/templates/manager/deployment.yaml b/helm/fdb-operator/templates/manager/deployment.yaml new file mode 100644 index 000000000..8e92f951e --- /dev/null +++ b/helm/fdb-operator/templates/manager/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + {{- include "chart.labels" . | nindent 4 }} + name: {{ .Values.operator.name }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "chart.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "chart.labels" . | nindent 8 }} + spec: + containers: + - args: + - --enable-leader-election + command: + - /manager + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: {{ .Values.operator.image }}:{{ .Values.operator.tag }} + name: manager + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 500m + memory: 256Mi + terminationGracePeriodSeconds: 10 \ No newline at end of file diff --git a/helm/fdb-operator/templates/rbac/rbac_role.yaml b/helm/fdb-operator/templates/rbac/rbac_role.yaml new file mode 100644 index 000000000..7d4dd4a19 --- /dev/null +++ b/helm/fdb-operator/templates/rbac/rbac_role.yaml @@ -0,0 +1,78 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + creationTimestamp: null + name: {{ .Values.operator.role }} +rules: +- apiGroups: + - "" + resources: + - pods + - configmaps + - persistentvolumeclaims + - events + verbs: + - get + - watch + - list + - create + - update + - patch + - delete +- apiGroups: + - apps.foundationdb.org + resources: + - foundationdbclusters + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - apps.foundationdb.org + resources: + - foundationdbclusters/status + verbs: + - get + - update + - patch +- apiGroups: + - admissionregistration.k8s.io + resources: + - mutatingwebhookconfigurations + - validatingwebhookconfigurations + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch + - create + - update + - patch + - delete diff --git a/helm/fdb-operator/templates/rbac/rbac_role_binding.yaml b/helm/fdb-operator/templates/rbac/rbac_role_binding.yaml new file mode 100644 index 000000000..c0fadb826 --- /dev/null +++ b/helm/fdb-operator/templates/rbac/rbac_role_binding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + creationTimestamp: null + name: {{ .Values.operator.rolebinding }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ .Values.operator.role }} +subjects: +- kind: ServiceAccount + name: default \ No newline at end of file diff --git a/helm/fdb-operator/templates/tests/test-connection.yaml b/helm/fdb-operator/templates/tests/test-connection.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/helm/fdb-operator/values.yaml b/helm/fdb-operator/values.yaml new file mode 100644 index 000000000..c582b87d7 --- /dev/null +++ b/helm/fdb-operator/values.yaml @@ -0,0 +1,6 @@ +operator: + name: fdb-kubernetes-operator-controller-manager + image: foundationdb/fdb-kubernetes-operator + tag: 0.4.0 + role: fdb-kubernetes-operator-manager-role + rolebinding: fdb-kubernetes-operator-manager-rolebinding \ No newline at end of file