Skip to content

Commit

Permalink
helm chart to install workloads for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
chintan8saaras committed Jul 27, 2022
1 parent 14cafea commit 1eee5f2
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 0 deletions.
24 changes: 24 additions & 0 deletions helm-chart/demo-services/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: demo-services
description: Chart for Workloads used in EnRoute demo - httpbin, echo, grpcbin

# 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: "0.1.0"
23 changes: 23 additions & 0 deletions helm-chart/demo-services/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# demo-services

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)

Chart for Workloads used in EnRoute demo - httpbin, echo, grpcbin

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| service.echo | object | `{"enable":true,"namespace":"echo","port":9001}` | echo service (websocket): https://github.com/jmalloc/echo-server https://hub.docker.com/r/jmalloc/echo-server |
| service.echo.enable | bool | `true` | enable/disable service installation |
| service.echo.namespace | string | `"echo"` | namespace to install service in |
| service.echo.port | int | `9001` | port on which the (kubernetes clusterip) service is accessible |
| service.grpc | object | `{"enable":true,"namespace":"grpc","port":9002}` | grpc service: https://github.com/moul/grpcbin |
| service.grpc.enable | bool | `true` | enable/disable service installation |
| service.grpc.namespace | string | `"grpc"` | namespace to install service in |
| service.grpc.port | int | `9002` | port on which the (kubernetes clusterip) service is accessible |
| service.httpbin | object | `{"enable":true,"namespace":"httpbin","port":9000}` | httpbin service: httpbin.org |
| service.httpbin.enable | bool | `true` | enable/disable service installation |
| service.httpbin.namespace | string | `"httpbin"` | namespace to install service in |
| service.httpbin.port | int | `9000` | port on which the (kubernetes clusterip) service is accessible |

43 changes: 43 additions & 0 deletions helm-chart/demo-services/templates/echo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.service.echo.enable }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: echo
namespace: {{ .Values.service.echo.namespace }}
---
apiVersion: v1
kind: Service
metadata:
name: echo
namespace: {{ .Values.service.echo.namespace }}
spec:
ports:
- name: echoport
port: {{ .Values.service.echo.port }}
targetPort: echoport
protocol: TCP
selector:
app: echo-server
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echo-deployment
namespace: {{ .Values.service.echo.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: echo-server
template:
metadata:
labels:
app: echo-server
spec:
containers:
- name: echo-server
image: jmalloc/echo-server
ports:
- name: echoport
containerPort: 8080
{{- end }}
43 changes: 43 additions & 0 deletions helm-chart/demo-services/templates/grpc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.service.grpc.enable }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: grpcbin
namespace: {{ .Values.service.grpc.namespace }}
---
apiVersion: v1
kind: Service
metadata:
name: grpcbin
namespace: {{ .Values.service.grpc.namespace }}
spec:
ports:
- name: grpc-port
port: {{ .Values.service.grpc.port }}
targetPort: grpc-port
protocol: TCP
selector:
app: grpcbin-server
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grpcbin-deployment
namespace: {{ .Values.service.grpc.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: grpcbin-server
template:
metadata:
labels:
app: grpcbin-server
spec:
containers:
- name: grpcbin-server
image: moul/grpcbin
ports:
- name: grpc-port
containerPort: 9000
{{- end }}
64 changes: 64 additions & 0 deletions helm-chart/demo-services/templates/httpbin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright Istio Authors
#
# 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.

##################################################################################################
# httpbin service
##################################################################################################
{{- if .Values.service.httpbin.enable }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: httpbin
namespace: {{ .Values.service.httpbin.namespace }}
---
apiVersion: v1
kind: Service
metadata:
name: httpbin
namespace: {{ .Values.service.httpbin.namespace }}
labels:
app: httpbin
service: httpbin
spec:
ports:
- name: http
port: {{ .Values.service.httpbin.port }}
targetPort: 80
selector:
app: httpbin
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpbin
namespace: {{ .Values.service.httpbin.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: httpbin
version: v1
template:
metadata:
labels:
app: httpbin
version: v1
spec:
serviceAccountName: httpbin
containers:
- image: docker.io/kennethreitz/httpbin
name: httpbin
ports:
- containerPort: 80
{{- end }}
41 changes: 41 additions & 0 deletions helm-chart/demo-services/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Chart to install services used to demo EnRoute
#
# httpbin service:
# httpbin.org
#
# echo service (websocket):
# https://github.com/jmalloc/echo-server
# https://hub.docker.com/r/jmalloc/echo-server
#
# grpc service:
# https://github.com/moul/grpcbin

service:
# -- httpbin service:
# httpbin.org
httpbin:
# -- enable/disable service installation
enable: true
# -- namespace to install service in
namespace: httpbin
# -- port on which the (kubernetes clusterip) service is accessible
port: 9000
# -- echo service (websocket):
# https://github.com/jmalloc/echo-server
# https://hub.docker.com/r/jmalloc/echo-server
echo:
# -- enable/disable service installation
enable: true
# -- namespace to install service in
namespace: echo
# -- port on which the (kubernetes clusterip) service is accessible
port: 9001
# -- grpc service:
# https://github.com/moul/grpcbin
grpc:
# -- enable/disable service installation
enable: true
# -- namespace to install service in
namespace: grpc
# -- port on which the (kubernetes clusterip) service is accessible
port: 9002

0 comments on commit 1eee5f2

Please sign in to comment.