Helm chart for exampleservice
Change-Id: I4f1418ff16067fd5f15d9a1a5a31ae139174b424
diff --git a/exampleservice/.helmignore b/exampleservice/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/exampleservice/.helmignore
@@ -0,0 +1,21 @@
+# 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
diff --git a/exampleservice/Chart.yaml b/exampleservice/Chart.yaml
new file mode 100644
index 0000000..baaadf4
--- /dev/null
+++ b/exampleservice/Chart.yaml
@@ -0,0 +1,21 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+appVersion: "1.0"
+description: A Helm chart for Kubernetes
+name: exampleservice
+version: 0.1.0
diff --git a/exampleservice/templates/_helpers.tpl b/exampleservice/templates/_helpers.tpl
new file mode 100644
index 0000000..99cc097
--- /dev/null
+++ b/exampleservice/templates/_helpers.tpl
@@ -0,0 +1,47 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Copyright 2018-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "exampleservice.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 "exampleservice.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 "exampleservice.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
diff --git a/exampleservice/templates/configmap.yaml b/exampleservice/templates/configmap.yaml
new file mode 100644
index 0000000..c0c1b9a
--- /dev/null
+++ b/exampleservice/templates/configmap.yaml
@@ -0,0 +1,37 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: exampleservice
+data:
+ service-config: |
+ name: exampleservice
+ accessor:
+ username: {{ .Values.xos.admin_user }}
+ password: {{ .Values.xos.admin_password }}
+ endpoint: xos-core:50051
+ required_models:
+ - ExampleService
+ - ExampleServiceInstance
+ - ServiceDependency
+ - ServiceMonitoringAgentInfo
+ dependency_graph: "/opt/xos/synchronizers/exampleservice/model-deps"
+ steps_dir: "/opt/xos/synchronizers/exampleservice/steps"
+ sys_dir: "/opt/xos/synchronizers/exampleservice/sys"
+ model_policies_dir: "/opt/xos/synchronizers/exampleservice/model_policies"
+ models_dir: "/opt/xos/synchronizers/exampleservice/models"
diff --git a/exampleservice/templates/deployment.yaml b/exampleservice/templates/deployment.yaml
new file mode 100644
index 0000000..8e5dbc9
--- /dev/null
+++ b/exampleservice/templates/deployment.yaml
@@ -0,0 +1,71 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1beta2
+kind: Deployment
+metadata:
+ name: {{ template "exampleservice.fullname" . }}
+ labels:
+ app: {{ template "exampleservice.name" . }}
+ chart: {{ template "exampleservice.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ template "exampleservice.name" . }}
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ labels:
+ app: {{ template "exampleservice.name" . }}
+ release: {{ .Release.Name }}
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}
+ image: "{{ .Values.pull_docker_registry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ resources:
+{{ toYaml .Values.resources | indent 12 }}
+ volumeMounts:
+ - name: exampleservice-config
+ mountPath: /opt/xos/synchronizers/exampleservice/exampleservice_config.yaml
+ subPath: exampleservice_config.yaml
+ - name: cert-chain-secret
+ mountPath: /usr/local/share/ca-certificates
+ volumes:
+ - name: exampleservice-config
+ configMap:
+ name: exampleservice
+ items:
+ - key: service-config
+ path: exampleservice_config.yaml
+ - name: cert-chain-secret
+ secret:
+ secretName: cert-chain-secret
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- with .Values.affinity }}
+ affinity:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+{{ toYaml . | indent 8 }}
+ {{- end }}
diff --git a/exampleservice/values.yaml b/exampleservice/values.yaml
new file mode 100644
index 0000000..f93c1cb
--- /dev/null
+++ b/exampleservice/values.yaml
@@ -0,0 +1,40 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Default values for exampleservice.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+
+pull_docker_registry:
+
+image:
+ repository: xosproject/exampleservice-synchronizer
+ tag: ef32e0abc7ef91ae04006ecb4583abf986c06dd9
+ pullPolicy: IfNotPresent
+
+resources: {}
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
+
+xos:
+ admin_user: admin@opencord.org
+ admin_password: letmein