diff --git a/kubernetes/helm_charts/VABots/apimanager/.helmignore b/kubernetes/helm_charts/VABots/apimanager/.helmignore new file mode 100644 index 0000000000..086d3bedf3 --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/.helmignore @@ -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 \ No newline at end of file diff --git a/kubernetes/helm_charts/VABots/apimanager/Chart.yaml b/kubernetes/helm_charts/VABots/apimanager/Chart.yaml new file mode 100755 index 0000000000..a06f9e1a50 --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +appVersion: 5.0.0 +description: A Helm chart for Kubernetes +name: apimanager +type: application +version: 0.1.0 diff --git a/kubernetes/helm_charts/VABots/apimanager/templates/configmap.yaml b/kubernetes/helm_charts/VABots/apimanager/templates/configmap.yaml new file mode 100644 index 0000000000..7d3594f968 --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/templates/configmap.yaml @@ -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 }}" diff --git a/kubernetes/helm_charts/VABots/apimanager/templates/deployment.yaml b/kubernetes/helm_charts/VABots/apimanager/templates/deployment.yaml new file mode 100644 index 0000000000..504469073a --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/templates/deployment.yaml @@ -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 diff --git a/kubernetes/helm_charts/VABots/apimanager/templates/hpa.yaml b/kubernetes/helm_charts/VABots/apimanager/templates/hpa.yaml new file mode 100644 index 0000000000..04ffcbfa1d --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/templates/hpa.yaml @@ -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 }} \ No newline at end of file diff --git a/kubernetes/helm_charts/VABots/apimanager/templates/jobs.yaml b/kubernetes/helm_charts/VABots/apimanager/templates/jobs.yaml new file mode 100644 index 0000000000..5f1f621ed4 --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/templates/jobs.yaml @@ -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 diff --git a/kubernetes/helm_charts/VABots/apimanager/values.yaml b/kubernetes/helm_charts/VABots/apimanager/values.yaml new file mode 100644 index 0000000000..1d40dffa45 --- /dev/null +++ b/kubernetes/helm_charts/VABots/apimanager/values.yaml @@ -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 diff --git a/kubernetes/helm_charts/VABots/kathaasagar/Chart.yaml b/kubernetes/helm_charts/VABots/kathaasagar/Chart.yaml index 9a0796d952..b7aa2ccf06 100644 --- a/kubernetes/helm_charts/VABots/kathaasagar/Chart.yaml +++ b/kubernetes/helm_charts/VABots/kathaasagar/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes -name: kathaasaagra +name: kathaasagar version: 0.1.0 diff --git a/kubernetes/helm_charts/VABots/kathaasagar/values.yaml b/kubernetes/helm_charts/VABots/kathaasagar/values.yaml index 95b4ea9b46..71ed702c50 100644 --- a/kubernetes/helm_charts/VABots/kathaasagar/values.yaml +++ b/kubernetes/helm_charts/VABots/kathaasagar/values.yaml @@ -1,4 +1,4 @@ -### Default variable file for kathaasaagra-service ### +### Default variable file for kathaasagar-service ### namespace: "" imagepullsecrets: "" @@ -22,7 +22,7 @@ strategy: maxsurge: 25 maxunavailable: 25 -#{{ kathaasaagra_liveness_readiness | to_nice_yaml }} +#{{ kathaasagar_liveness_readiness | to_nice_yaml }} autoscaling: enabled: false