Skip to content

Commit f4bb4fc

Browse files
copy deploy dir and edit some values
1 parent 4151711 commit f4bb4fc

11 files changed

+247
-0
lines changed

deploy/slack_bot/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

deploy/slack_bot/Chart.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: data-slack-bot
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "0.1.0"

deploy/slack_bot/templates/NOTES.txt

Whitespace-only changes.
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "slack_bot.name" -}}
5+
{{- default .Chart.Name | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "slack_bot.fullname" -}}
14+
{{- $name := .Chart.Name }}
15+
{{- if contains $name .Release.Name }}
16+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
17+
{{- else }}
18+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
19+
{{- end }}
20+
{{- end }}
21+
22+
{{/*
23+
Create chart name and version as used by the chart label.
24+
*/}}
25+
{{- define "slack_bot.chart" -}}
26+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
27+
{{- end }}
28+
29+
{{/*
30+
Common labels
31+
*/}}
32+
{{- define "slack_bot.labels" -}}
33+
helm.sh/chart: {{ include "slack_bot.chart" . }}
34+
{{ include "slack_bot.selectorLabels" . }}
35+
{{- if .Chart.AppVersion }}
36+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
37+
{{- end }}
38+
app.kubernetes.io/managed-by: {{ .Release.Service }}
39+
{{- end }}
40+
41+
{{/*
42+
Selector labels
43+
*/}}
44+
{{- define "slack_bot.selectorLabels" -}}
45+
app.kubernetes.io/name: {{ include "slack_bot.name" . }}
46+
app.kubernetes.io/instance: {{ .Release.Name }}
47+
{{- end }}
48+
49+
{{/*
50+
Create the name of the service account to use
51+
*/}}
52+
{{- define "slack_bot.serviceAccountName" -}}
53+
{{- if .Values.serviceAccount.create }}
54+
{{- default (include "slack_bot.fullname" .) .Values.serviceAccount.name }}
55+
{{- else }}
56+
{{- default "default" .Values.serviceAccount.name }}
57+
{{- end }}
58+
{{- end }}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "slack_bot.fullname" . }}
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
8+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
9+
app.kubernetes.io/version: {{ .Chart.AppVersion }}
10+
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11+
annotations:
12+
"helm.sh/hook": pre-install,pre-upgrade
13+
"helm.sh/hook-weight": "0"
14+
data:
15+
REPO: "{{ .Values.app.repo }}"
16+
TRUNK: "{{ .Values.app.trunk }}"
17+
BUILD: "{{ .Values.image.tag }}"
18+
ENVIRONMENT: "{{ .Values.environment }}"
19+
CAN_DEPLOY_USERS_IDS: "{{ .Values.app.can_deploy_users_ids }}"
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "slack_bot.fullname" . }}
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
{{- include "slack_bot.labels" . | nindent 4 }}
8+
spec:
9+
replicas: 1
10+
strategy:
11+
type: Recreate
12+
selector:
13+
matchLabels:
14+
{{- include "slack_bot.selectorLabels" . | nindent 6 }}
15+
template:
16+
metadata:
17+
labels:
18+
{{- include "slack_bot.selectorLabels" . | nindent 8 }}
19+
spec:
20+
imagePullSecrets:
21+
- name: {{ include "slack_bot.fullname" . }}-docker-secret
22+
serviceAccountName: {{ include "slack_bot.serviceAccountName" . }}
23+
securityContext:
24+
fsGroup: 1000
25+
containers:
26+
- name: {{ .Chart.Name }}
27+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
28+
imagePullPolicy: IfNotPresent
29+
resources:
30+
requests:
31+
cpu: 100m
32+
memory: 256Mi
33+
limits:
34+
cpu: 1
35+
memory: 1024Mi
36+
envFrom:
37+
- secretRef:
38+
name: {{ include "slack_bot.fullname" . }}
39+
- configMapRef:
40+
name: {{ include "slack_bot.fullname" . }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "slack_bot.fullname" . }}-docker-secret
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
8+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
9+
app.kubernetes.io/version: {{ .Chart.AppVersion }}
10+
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11+
annotations:
12+
"helm.sh/hook": pre-install,pre-upgrade
13+
"helm.sh/hook-weight": "0"
14+
type: kubernetes.io/dockerconfigjson
15+
data:
16+
.dockerconfigjson: {{ .Values.image.dockerConfigJson }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: {{ .Values.namespace }}
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "slack_bot.fullname" . }}
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
8+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
9+
app.kubernetes.io/version: {{ .Chart.AppVersion }}
10+
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11+
annotations:
12+
"helm.sh/hook": pre-install,pre-upgrade
13+
"helm.sh/hook-weight": "0"
14+
type: Opaque
15+
data:
16+
GITHUB_TOKEN: {{ .Values.github.token | b64enc }}
17+
SLACK_BOT_TOKEN: {{ .Values.slack.botToken | b64enc }}
18+
SLACK_APP_TOKEN: {{ .Values.slack.appToken | b64enc }}
19+
SENTRY_DSN: {{ .Values.sentry.dsn | b64enc }}
20+
YOUTRACK_API_TOKEN: {{ .Values.youtrack.token | b64enc }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "slack_bot.serviceAccountName" . }}
6+
namespace: {{ .Values.namespace }}
7+
labels:
8+
{{- include "slack_bot.labels" . | nindent 4 }}
9+
{{- with .Values.serviceAccount.annotations }}
10+
annotations:
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- end }}

deploy/slack_bot/values.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Default values for slack_bot.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
namespace: data-slack-bot
6+
environment: production
7+
8+
image:
9+
repository: hyperskill.azurecr.io/hyperskill/dataslackbot
10+
tag: undefined
11+
dockerConfigJson: secret
12+
13+
serviceAccount:
14+
create: true
15+
name: build-data-slack-bot
16+
annotations: []
17+
18+
github:
19+
token: secret
20+
21+
slack:
22+
appToken: secret
23+
botToken: secret
24+
25+
sentry:
26+
dsn: secret
27+
28+
youtrack:
29+
token: secret

0 commit comments

Comments
 (0)