diff --git a/devspc/devspace-apiregistry-core-service/templates/configmap.yaml b/devspc/devspace-apiregistry-core-service/templates/configmap.yaml index c686bb9..2f43e96 100644 --- a/devspc/devspace-apiregistry-core-service/templates/configmap.yaml +++ b/devspc/devspace-apiregistry-core-service/templates/configmap.yaml @@ -5,6 +5,8 @@ metadata: data: application.yaml: | spring: + application: + name: {{$.Release.Name}} datasource: url: jdbc:postgresql://192.168.76.141:5432/database username: postgres @@ -12,7 +14,11 @@ data: cloud: vault: enabled: false - + server: + port: {{ $.Values.port }} + management: + server: + port: {{ $.Values.managementPort }} springdoc: api-docs: enabled: true diff --git a/devspc/devspace-apiregistry-generator-service/Chart.yaml b/devspc/devspace-apiregistry-generator-service/Chart.yaml new file mode 100644 index 0000000..7b8b92a --- /dev/null +++ b/devspc/devspace-apiregistry-generator-service/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: devspace-apiregistry-generator-service +description: KuberService +home: https://tlsys.ru/ +icon: https://lk.tlsys.org/favicon.png +keywords: + - test +type: application +version: "9.9.9" +appVersion: "9.9.9" diff --git a/devspc/devspace-apiregistry-generator-service/templates/configmap.yaml b/devspc/devspace-apiregistry-generator-service/templates/configmap.yaml new file mode 100644 index 0000000..721395a --- /dev/null +++ b/devspc/devspace-apiregistry-generator-service/templates/configmap.yaml @@ -0,0 +1,61 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{$.Release.Name}}-{{$.Chart.Name}}-main-config +data: + application.yaml: | + spring: + application: + name: {{$.Release.Name}} + main: + banner-mode: off + + cloud: + openfeign: + client: + config: + default: + logger-level: FULL + coreClient: + url: http://devspace-apiregistry-core-agent:8080 + + vault: + enabled: false + + management: + server: + port: {{ $.Values.managementPort }} + endpoints: + enabled-by-default: true + web: + exposure: + include: env, health, heapdump, httpexchanges, info, loggers, liquibase, metrics, scheduledtasks, startup, shutdown, prometheus + metrics: + distribution: + percentiles-histogram: + http.server.requests: true + http.client.requests: true + percentiles: + http.server.requests: 0.5, 0.95, 0.99 + http.client.requests: 0.5, 0.95, 0.99 + + server: + forward-headers-strategy: framework + port: {{ $.Values.port }} + + logging: + level: + root: INFO + org.springframework: INFO + ru: debug + application: + publication: + masterBranches: + - main + - master + production: + maven-remote: [] + maven-local: [] + non-production: + maven-remote: [] + maven-local: [] diff --git a/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml b/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml new file mode 100644 index 0000000..d5943f8 --- /dev/null +++ b/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml @@ -0,0 +1,103 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{$.Release.Name}}-{{$.Values.name}}" + labels: + {{- if $.Values.labels}} + {{- toYaml $.Values.labels | nindent 4 }} + {{- end}} + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} + app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} +spec: + {{- if not $.Values.autoscaling.enabled }} + {{ if $.Values.replicaCount }} + replicas: {{ $.Values.replicaCount }} + {{ else }} + replicas: 1 + {{end}} + {{- end }} + selector: + matchLabels: + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} + template: + metadata: + annotations: + metric.binom.pw/enabled: '{{$.Values.metrics}}' + {{ if ($.Values.metrics) }} + metric.binom.pw/url: ":9090/prometheus" + {{ end }} + {{- with $.Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} +{{/* app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}*/}} + spec: + {{- with $.Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{ if $.Values.serviceAccount }} + serviceAccountName: {{ $.Values.serviceAccount.name }} + {{ end }} + volumes: + - name: application-properties-volume + configMap: + name: {{$.Release.Name}}-{{$.Chart.Name}}-main-config + items: + - key: application.yaml + path: application.yaml + securityContext: + {{- toYaml $.Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ $.Chart.Name }} + securityContext: + {{- toYaml $.Values.securityContext | nindent 12 }} + image: "{{ $.Values.image.name }}:{{ $.Values.image.version }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + env: + - name: SPRING_CONFIG_ADDITIONAL_LOCATION + value: "file:/opt/app/config/application.yaml" + volumeMounts: + - mountPath: '/opt/app/config' + name: application-properties-volume + ports: + - name: http + containerPort: {{ $.Values.port }} + protocol: TCP + - name: management + containerPort: {{ $.Values.managementPort }} + protocol: TCP + livenessProbe: + httpGet: + path: '/actuator/health/liveness' + port: management + initialDelaySeconds: 20 + periodSeconds: 10 + readinessProbe: + httpGet: + path: '/actuator/health/readiness' + port: management + initialDelaySeconds: 25 + periodSeconds: 10 + {{- if $.Values.resources}} + resources: + {{- toYaml $.Values.resources | nindent 12}} + {{- else}} + resources: { } + {{end}} + {{- with $.Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $.Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $.Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/devspc/devspace-apiregistry-generator-service/templates/service.yaml b/devspc/devspace-apiregistry-generator-service/templates/service.yaml new file mode 100644 index 0000000..5c1aa34 --- /dev/null +++ b/devspc/devspace-apiregistry-generator-service/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{$.Release.Name}}-{{$.Values.name}}" +spec: + type: NodePort + selector: + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} + ports: + - protocol: TCP + port: {{$.Values.port}} # порт, по которуму сервис будет доступен внутри кластера + targetPort: {{$.Values.port}} # порт, на котором слушает ваше приложение внутри контейнера + nodePort: 31000 \ No newline at end of file diff --git a/devspc/devspace-apiregistry-generator-service/values.yaml b/devspc/devspace-apiregistry-generator-service/values.yaml new file mode 100644 index 0000000..b2a3f6a --- /dev/null +++ b/devspc/devspace-apiregistry-generator-service/values.yaml @@ -0,0 +1,15 @@ +replicaCount: 1 +autoscaling: + enabled: false +labels: [] +metrics: false +managementPort: 9090 +port: 8080 +imagePullSecrets: null +image: + name: null + pullPolicy: Always + version: '' +name: agent +securityContext: + privileged: true \ No newline at end of file