Helm charts for Collectd Operator 66/93266/3
authorDileep Ranganathan <dileep.ranganathan@intel.com>
Sun, 11 Aug 2019 00:30:33 +0000 (17:30 -0700)
committerDileep Ranganathan <dileep.ranganathan@intel.com>
Mon, 12 Aug 2019 17:51:22 +0000 (10:51 -0700)
Helm charts for Collectd Operator

Issue-ID: ONAPARC-461
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Change-Id: Icd1fc169f9e005030a0d2b48cf9dd76434bf6ba3
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
vnfs/DAaaS/deploy/operator/charts/collectd-operator/.helmignore [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/Chart.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/NOTES.txt [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/_helpers.tpl [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/onap_v1alpha1_collectdglobal_crd.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/onap_v1alpha1_collectdplugin_crd.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/operator.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/role.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/role_binding.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/service_account.yaml [new file with mode: 0644]
vnfs/DAaaS/deploy/operator/charts/collectd-operator/values.yaml [new file with mode: 0644]

diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/.helmignore b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/.helmignore
new file mode 100644 (file)
index 0000000..50af031
--- /dev/null
@@ -0,0 +1,22 @@
+# 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
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/Chart.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/Chart.yaml
new file mode 100644 (file)
index 0000000..12278df
--- /dev/null
@@ -0,0 +1,5 @@
+apiVersion: v1
+appVersion: "1.0"
+description: A Helm chart for Kubernetes
+name: collectd-operator
+version: 0.1.0
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/NOTES.txt b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/NOTES.txt
new file mode 100644 (file)
index 0000000..8b5acf3
--- /dev/null
@@ -0,0 +1,3 @@
+1. Get the application URL by running these commands:
+Collectd Operator deployment.
+
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/_helpers.tpl b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/_helpers.tpl
new file mode 100644 (file)
index 0000000..88991c8
--- /dev/null
@@ -0,0 +1,32 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "collectd-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 "collectd-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 "collectd-operator.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/onap_v1alpha1_collectdglobal_crd.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/onap_v1alpha1_collectdglobal_crd.yaml
new file mode 100644 (file)
index 0000000..89d38a7
--- /dev/null
@@ -0,0 +1,75 @@
+{{- if .Values.enabled }}
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: collectdglobals.onap.org
+  labels:
+    app: {{ template "collectd-operator.name" . }}
+    chart: {{ template "collectd-operator.chart" . }}
+    component: collectdglobals.onap.org-crd
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+  annotations:
+    "helm.sh/hook": crd-install
+    "helm.sh/hook-delete-policy": "before-hook-creation"
+spec:
+  group: onap.org
+  names:
+    kind: CollectdGlobal
+    listKind: CollectdGlobalList
+    plural: collectdglobals
+    singular: collectdglobal
+  scope: Namespaced
+  subresources:
+    status: {}
+  validation:
+    openAPIV3Schema:
+      properties:
+        apiVersion:
+          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/api-conventions.md#resources'
+          type: string
+        kind:
+          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/api-conventions.md#types-kinds'
+          type: string
+        metadata:
+          type: object
+        spec:
+          properties:
+            configMap:
+              type: string
+            globalOptions:
+              description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+                Important: Run "operator-sdk generate k8s" to regenerate code after
+                modifying this file Add custom validation using kubebuilder tags:
+                https://book.kubebuilder.io/beyond_basics/generating_crd.html'
+              type: string
+          required:
+          - globalOptions
+          type: object
+        status:
+          properties:
+            collectdAgents:
+              description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
+                of cluster Important: Run "operator-sdk generate k8s" to regenerate
+                code after modifying this file Add custom validation using kubebuilder
+                tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
+                CollectdAgents are the collectd pods in the Daemonset Status can be
+                one of "", Created, Deleting, Applied, Deprecated'
+              items:
+                type: string
+              type: array
+            status:
+              type: string
+          required:
+          - status
+          type: object
+  version: v1alpha1
+  versions:
+  - name: v1alpha1
+    served: true
+    storage: true
+{{- end }}
\ No newline at end of file
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/onap_v1alpha1_collectdplugin_crd.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/onap_v1alpha1_collectdplugin_crd.yaml
new file mode 100644 (file)
index 0000000..fccd7cd
--- /dev/null
@@ -0,0 +1,72 @@
+{{- if .Values.enabled }}
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: collectdplugins.onap.org
+  labels:
+    app: {{ template "collectd-operator.name" . }}
+    chart: {{ template "collectd-operator.chart" . }}
+    component: collectdplugins.onap.org-crd
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+  annotations:
+    "helm.sh/hook": crd-install
+    "helm.sh/hook-delete-policy": "before-hook-creation"
+spec:
+  group: onap.org
+  names:
+    kind: CollectdPlugin
+    listKind: CollectdPluginList
+    plural: collectdplugins
+    singular: collectdplugin
+  scope: Namespaced
+  subresources:
+    status: {}
+  validation:
+    openAPIV3Schema:
+      properties:
+        apiVersion:
+          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/api-conventions.md#resources'
+          type: string
+        kind:
+          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/api-conventions.md#types-kinds'
+          type: string
+        metadata:
+          type: object
+        spec:
+          properties:
+            pluginConf:
+              type: string
+            pluginName:
+              description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+                Important: Run "operator-sdk generate k8s" to regenerate code after
+                modifying this file Add custom validation using kubebuilder tags:
+                https://book.kubebuilder.io/beyond_basics/generating_crd.html'
+              type: string
+          required:
+          - pluginName
+          - pluginConf
+          type: object
+        status:
+          properties:
+            collectdAgents:
+              description: CollectdAgents are the collectd pods in the Daemonset Status
+                can be one of "", Created, Deleting, Applied, Deprecated
+              items:
+                type: string
+              type: array
+            status:
+              type: string
+          required:
+          - status
+          type: object
+  version: v1alpha1
+  versions:
+  - name: v1alpha1
+    served: true
+    storage: true
+{{- end }}
\ No newline at end of file
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/operator.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/operator.yaml
new file mode 100644 (file)
index 0000000..c62dde2
--- /dev/null
@@ -0,0 +1,41 @@
+{{- if .Values.enabled }}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: collectd-operator
+  labels:
+    app: {{ template "collectd-operator.name" . }}
+    chart: {{ template "collectd-operator.chart" . }}
+    component: deployment
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      name: collectd-operator
+  template:
+    metadata:
+      labels:
+        name: collectd-operator
+    spec:
+      serviceAccountName: collectd-operator
+      containers:
+        - name: collectd-operator
+          # Replace this with the built image name
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          command:
+          - collectd-operator
+          env:
+            - name: WATCH_NAMESPACE
+              value: {{ default "" .Values.watch.namespace | quote }}
+            - name: WATCH_LABELS
+              value: {{ default "app=collectd" .Values.watch.labels | quote }}
+            - name: POD_NAME
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.name
+            - name: OPERATOR_NAME
+              value: "collectd-operator"
+{{- end }}
\ No newline at end of file
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/role.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/role.yaml
new file mode 100644 (file)
index 0000000..73de6aa
--- /dev/null
@@ -0,0 +1,57 @@
+{{- if .Values.enabled }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  creationTimestamp: null
+  name: collectd-operator
+  labels:
+    app: {{ template "collectd-operator.name" . }}
+    chart: {{ template "collectd-operator.chart" . }}
+    component: clusterrole
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+rules:
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  - services
+  - endpoints
+  - persistentvolumeclaims
+  - events
+  - configmaps
+  - secrets
+  verbs:
+  - '*'
+- apiGroups:
+  - apps
+  resources:
+  - deployments
+  - daemonsets
+  - replicasets
+  - statefulsets
+  verbs:
+  - '*'
+- apiGroups:
+  - monitoring.coreos.com
+  resources:
+  - servicemonitors
+  verbs:
+  - get
+  - create
+- apiGroups:
+  - apps
+  resourceNames:
+  - collectd-operator
+  resources:
+  - deployments/finalizers
+  verbs:
+  - update
+- apiGroups:
+  - onap.org
+  resources:
+  - '*'
+  - collectdglobals
+  verbs:
+  - '*'
+{{- end }}
\ No newline at end of file
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/role_binding.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/role_binding.yaml
new file mode 100644 (file)
index 0000000..024ba2a
--- /dev/null
@@ -0,0 +1,20 @@
+{{- if .Values.enabled }}
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: collectd-operator
+  labels:
+    app: {{ template "collectd-operator.name" . }}
+    chart: {{ template "collectd-operator.chart" . }}
+    component: clusterrolebinding
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+subjects:
+- kind: ServiceAccount
+  name: collectd-operator
+  namespace: {{ .Release.Namespace }}
+roleRef:
+  kind: ClusterRole
+  name: collectd-operator
+  apiGroup: rbac.authorization.k8s.io
+{{- end }}
\ No newline at end of file
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/service_account.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/templates/service_account.yaml
new file mode 100644 (file)
index 0000000..d3c17cf
--- /dev/null
@@ -0,0 +1,12 @@
+{{- if .Values.enabled }}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: collectd-operator
+  labels:
+    app: {{ template "collectd-operator.name" . }}
+    chart: {{ template "collectd-operator.chart" . }}
+    component: service-account
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+{{- end }}
\ No newline at end of file
diff --git a/vnfs/DAaaS/deploy/operator/charts/collectd-operator/values.yaml b/vnfs/DAaaS/deploy/operator/charts/collectd-operator/values.yaml
new file mode 100644 (file)
index 0000000..4517bef
--- /dev/null
@@ -0,0 +1,27 @@
+# Default values for collectd-operator.
+enabled: true
+watch:
+  nameSpace: ""
+  labels: "app=collectd"
+image:
+  repository: dcr.cluster.local:32644/collectd-operator
+  tag: latest
+  pullPolicy: Always
+
+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
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}