Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ED-3303] SB-DJP apimanager helm chart #3939

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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/
*_test.rego
6 changes: 6 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
appVersion: 5.0.0
description: A Helm chart for Kubernetes
name: apimanager
type: application
version: 0.1.0
21 changes: 21 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-config
namespace: {{ .Release.Namespace }}
data:
KONG_ADMIN_LISTEN: "{{ .Values.kong_admin_listen }}"
KONG_DATABASE: "{{ .Values.kong_database }}"
KONG_LOG_LEVEL: "{{ .Values.kong_log_level }}"
KONG_LUA_SOCKET_POOL_SIZE: "{{ .Values.kong_lua_socket_pool_size }}"
KONG_MEM_CACHE_SIZE: "{{ .Values.kong_mem_cache_size }}"
KONG_NGINX_WORKER_PROCESSES: "{{ .Values.kong_nginx_worker_processes }}"
KONG_PG_DATABASE: "{{ .Values.kong_pg_database }}"
KONG_PG_HOST: "{{ .Values.kong_pg_host }}"
KONG_PG_PASSWORD: "{{ .Values.kong_pg_password }}"
KONG_PG_SSL: "{{ .Values.kong_pg_ssl }}"
KONG_PG_USER: "{{ .Values.kong_pg_user }}"
KONG_PROXY_ACCESS_LOG: "{{ .Values.kong_proxy_access_log }}"
KONG_RATELIMIT_CACHE_SIZE: "{{ .Values.kong_ratelimit_cache_size }}"
KONG_TRUSTED_IPS: "{{ .Values.kong_trusted_ips }}"
KONG_UPSTREAM_KEEPALIVE: "{{ .Values.kong_upstream_keepalive }}"
73 changes: 73 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
annotations:
reloader.stakater.com/auto: "true"
spec:
replicas: {{ .Values.replicaCount }}
strategy:
rollingUpdate:
maxSurge: {{ .Values.strategy.maxsurge }}
maxUnavailable: {{ .Values.strategy.maxunavailable }}
selector:
matchLabels:
app: {{ .Chart.Name }}
template:
metadata:
annotations:
fluentbit.io/parser: kong
labels:
app: {{ .Chart.Name }}
spec:
{{- if .Values.imagepullsecrets }}
imagePullSecrets:
- name: {{ .Values.imagepullsecrets }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}"
imagePullPolicy: Always
envFrom:
- configMapRef:
name: {{ .Chart.Name }}-config
resources:
{{ toYaml .Values.resources | indent 12 }}
ports:
- containerPort: {{ .Values.network.port }}
name: network
- containerPort: {{ .Values.service.port }}
name: service
{{- if .Values.healthcheck }}
livenessProbe:
{{ toYaml .Values.livenessProbe | indent 12 }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 12 }}
{{- end }}
lifecycle:
preStop:
exec:
command:
- kong
- quit
---
apiVersion: v1
kind: Service
metadata:
name: kong
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Chart.Name }}
spec:
ports:
- name: http-{{ .Chart.Name }}
protocol: TCP
port: {{ .Values.network.port }}
targetPort: {{ .Values.network.targetport }}
- name: http-admin-{{ .Chart.Name }}
protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetport }}
selector:
app: {{ .Chart.Name }} # metadataname of deployment
28 changes: 28 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Chart.Name }}
annotations:
meta.helm.sh/release-namespace: {{ .Release.namespace }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Chart.Name }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
36 changes: 36 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/templates/jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: kong-migrations
spec:
template:
spec:
containers:
- name: kong-migrations
image: kong:3.5.0
command:
- kong
- migrations
- bootstrap
env:
- name: KONG_DATABASE
value: {{ .Values.kong_database }}
- name: KONG_PG_DATABASE
value: {{ .Values.kong_pg_database }}
- name: KONG_PG_HOST
value: {{ .Values.kong_pg_host }}
- name: KONG_PG_PASSWORD
value: {{ .Values.kong_pg_password }}
- name: KONG_PG_USER
value: {{ .Values.kong_pg_user }}
- name: KONG_PROXY_ACCESS_LOG
value: "/dev/stdout"
- name: KONG_ADMIN_ACCESS_LOG
value: "/dev/stdout"
- name: KONG_PROXY_ERROR_LOG
value: "/dev/stderr"
- name: KONG_ADMIN_ERROR_LOG
value: "/dev/stderr"
restartPolicy: Never
backoffLimit: 5
75 changes: 75 additions & 0 deletions kubernetes/helm_charts/VABots/apimanager/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
kong_admin_listen: 0.0.0.0:8001
kong_database: postgres
kong_log_level: info
kong_lua_socket_pool_size: "30"
kong_mem_cache_size: 128m
#the below setting not reconganized in kong-3.5.0
#kong_nginx_http_log_format: "nginx_public_ingress_log_format '$remote_addr - $remote_user [$time_local] \"$request\" $status $request_length $body_bytes_sent $request_time $upstream_response_time $pipe \"$http_referer\" \"$http_user_agent\" \"$http_x_request_id\" \"$http_x_device_id\" \"$http_x_channel_id\" \"$http_x_app_id\" \"$http_x_app_ver\" \"$http_x_session_id\"'"
kong_nginx_worker_processes: auto
kong_pg_database: api_manager_vabots
kong_pg_host: 0.0.0.0
kong_pg_password: postgres
kong_pg_ssl: "True"
kong_pg_user: postgres
kong_proxy_access_log: "logs/access.log" # removed nginx_public_ingress_log_format - not reconganized in kong-3.5.0
kong_ratelimit_cache_size: 12m
kong_trusted_ips: 0.0.0.0/0,::/0
kong_upstream_keepalive: "200"

imagepullsecrets: ""
dockerhub: docker.io

replicaCount: 1
repository: kong
image_tag: 3.5.0

resources:
requests:
cpu: 100m
memory: 100M
limits:
cpu: 1
memory: 1G

network:
port: 8000
targetPort: 8000

service:
port: 8001
targetPort: 8001

strategy:
maxsurge: 25%
maxunavailable: 25%

livenessProbe:
failureThreshold: 2
httpGet:
path: /status
port: 8001
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5

readinessProbe:
failureThreshold: 2
httpGet:
path: /status
port: 8001
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5

autoscaling:
enabled: false
maxReplicas: 2
minReplicas: 1
targetCPUUtilizationPercentage: 60
targetMemoryUtilizationPercentage: ""

serviceMonitor:
enabled: "false"
labels: # labels with which the prometheus choose the serviceMonitor
app: prometheus-operator
release: prometheus-operator
2 changes: 1 addition & 1 deletion kubernetes/helm_charts/VABots/kathaasagar/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: kathaasaagra
name: kathaasagar
version: 0.1.0
4 changes: 2 additions & 2 deletions kubernetes/helm_charts/VABots/kathaasagar/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Default variable file for kathaasaagra-service ###
### Default variable file for kathaasagar-service ###

namespace: ""
imagepullsecrets: ""
Expand All @@ -22,7 +22,7 @@ strategy:
maxsurge: 25
maxunavailable: 25

#{{ kathaasaagra_liveness_readiness | to_nice_yaml }}
#{{ kathaasagar_liveness_readiness | to_nice_yaml }}

autoscaling:
enabled: false
Expand Down
Loading