Skip to content

Commit

Permalink
เพิ่ม version
Browse files Browse the repository at this point in the history
  • Loading branch information
meganeinth committed Jul 27, 2021
1 parent 139f6b4 commit 28adc8e
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 1 deletion.
23 changes: 23 additions & 0 deletions 0.6/.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 0.6/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: chart
description: Helm chart for kob-flash

# 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.6

# 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: "1.0.2"
Binary file added 0.6/README.md
Binary file not shown.
3 changes: 3 additions & 0 deletions 0.6/app-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version 0.6
support audit
แก้ไขเรื่องคิวค้าง
24 changes: 24 additions & 0 deletions 0.6/questions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

labels:
io.cattle.role: project # options are cluster/project
io.rancher.app_min_version: 9.0.2
questions:
- variable: bank.bank
description: "ธนาคาร"
label: ธนาคาร
type: enum
options:
- "scb"
- "kbank"
- "bbl"
group: "ตั้งค่าบัญชี"
subquestions:
- variable: bank.account
label: เลขบัญชี
type: string
- variable: bank.device_id
label: device_id
type: string
- variable: bank.pincode
label: pincode
type: string
62 changes: 62 additions & 0 deletions 0.6/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "hello-chart.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 "hello-chart.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 "hello-chart.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "hello-chart.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hello-chart.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
41 changes: 41 additions & 0 deletions 0.6/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: "apps/v1"
kind: "Deployment"
metadata:
name: acc-{{ .Values.bank.account }}
labels:
app: acc-{{ .Values.bank.account }}
spec:
replicas: 1
selector:
matchLabels:
app: acc-{{ .Values.bank.account }}
template:
metadata:
labels:
app: acc-{{ .Values.bank.account }}
spec:
containers:
- name: acc-{{ .Values.bank.account }}
image: gcr.io/kob-manager/kob-pandora:{{ .Values.image.tag }}
imagePullPolicy: Always
env:
- name: bank
valueFrom:
secretKeyRef:
key: bank
name: acc-{{ .Values.bank.account }}-config
- name: account_no
valueFrom:
secretKeyRef:
key: account_no
name: acc-{{ .Values.bank.account }}-config
- name: pincode
valueFrom:
secretKeyRef:
key: pincode
name: acc-{{ .Values.bank.account }}-config
- name: device_id
valueFrom:
secretKeyRef:
key: device_id
name: acc-{{ .Values.bank.account }}-config
10 changes: 10 additions & 0 deletions 0.6/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This secret is used to set the initial credentials of the node container.
apiVersion: v1
kind: Secret
metadata:
name: acc-{{ .Values.bank.account }}-config
data:
account_no: "{{ .Values.bank.account | b64enc }}"
bank: {{ .Values.bank.bank | b64enc }}
device_id: {{ .Values.bank.device_id | b64enc }}
pincode: {{ .Values.bank.pincode | b64enc }}
15 changes: 15 additions & 0 deletions 0.6/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: internal-acc-{{ .Values.bank.account }}
annotations:
networking.gke.io/load-balancer-type: "Internal"
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 4200
protocol: TCP
name: http
selector:
app: acc-{{ .Values.bank.account }}
15 changes: 15 additions & 0 deletions 0.6/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "hello-chart.fullname" . }}-test-connection"
labels:
{{- include "hello-chart.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "hello-chart.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
25 changes: 25 additions & 0 deletions 0.6/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Default values for hello-chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: gcr.io/kob-manager/kob-pandora
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "0.6"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

service:
type: LoadBalancer
port: 80

bank:
account: ""
bank: "scb"
device_id: ""
pincode: ""
2 changes: 1 addition & 1 deletion upgrade.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
read -p 'namespace : ' namespace
read -p 'version : ' version

helm list -n $namespace | grep acc | awk '{print $1 " ./$version"}' | xargs -L1 helm upgrade -n $namespace ./0.5
helm list -n $namespace | grep acc | awk '{print $1 " ./$version"}' | xargs -L1 helm upgrade -n $namespace

0 comments on commit 28adc8e

Please sign in to comment.