diff --git a/.gitea/workflows/build-backend.yml b/.gitea/workflows/build-backend.yml index 8cab6a9..5d12c11 100644 --- a/.gitea/workflows/build-backend.yml +++ b/.gitea/workflows/build-backend.yml @@ -10,6 +10,7 @@ on: - devspc/devspace-apiregistry-core-service - devspc/devspace-apiregistry-generator-service - devspc/devspace-gateway + - devspc/devspace-api default: devspc/devspace-apiregistry-core-service branch: description: 'Ветка' diff --git a/.gitea/workflows/build-frontend.yml b/.gitea/workflows/build-frontend.yml index 7a85d05..c03046a 100644 --- a/.gitea/workflows/build-frontend.yml +++ b/.gitea/workflows/build-frontend.yml @@ -36,17 +36,8 @@ jobs: cache: 'npm' - name: Building run: | + npm install npm run build -# - name: Building -# run: | -# ./gradlew bootJar --no-daemon -x cyclonedxBom -# echo 'Jar in libs folder' -# ls ./build/libs -# - name: Publishing docker -# uses: https://git.binom.pw/otp/devops/docker@main -# with: -# image-name: "otp/${{ github.event.inputs.repo_path }}" -# tags: ${{ github.event.inputs.version }} - name: 'Cleanup' if: always() shell: bash diff --git a/devspc/devspace-api/Chart.yaml b/devspc/devspace-api/Chart.yaml new file mode 100644 index 0000000..7bc1d94 --- /dev/null +++ b/devspc/devspace-api/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: devspace-api +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-api/templates/configmap.yaml b/devspc/devspace-api/templates/configmap.yaml new file mode 100644 index 0000000..0a55f8c --- /dev/null +++ b/devspc/devspace-api/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{$.Release.Name}}-{{$.Chart.Name}}-main-config +data: + application.yaml: | + server: + port: {{ $.Values.port }} + management: + server: + port: {{ $.Values.managementPort }} diff --git a/devspc/devspace-api/templates/deployment.yaml b/devspc/devspace-api/templates/deployment.yaml new file mode 100644 index 0000000..022c39e --- /dev/null +++ b/devspc/devspace-api/templates/deployment.yaml @@ -0,0 +1,104 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{$.Release.Name}}-{{$.Values.name}}" + annotations: + devspace.isb/name: {{ $.Values.repository.name | quote }} + devspace.isb/branch: {{ $.Values.repository.branch | quote }} + rollme: {{ .Release.Revision | quote }} + 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: + rollme: {{ .Release.Revision | quote }} + {{- 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-api/templates/ingress.yaml b/devspc/devspace-api/templates/ingress.yaml new file mode 100644 index 0000000..207be05 --- /dev/null +++ b/devspc/devspace-api/templates/ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{$.Release.Name}}-{{$.Values.name}} + namespace: {{$.Release.Namespace}} + annotations: + traefik.ingress.kubernetes.io/router.middlewares: {{$.Release.Namespace}}-{{$.Release.Name}}-cors@kubernetescrd +spec: + rules: + - host: {{tpl $.Values.ingress.host .}} + http: + paths: + - path: /devspace-api/ + pathType: Prefix + backend: + service: + name: "{{ $.Release.Name }}-{{ $.Values.name }}" + port: + number: {{ $.Values.port }} \ No newline at end of file diff --git a/devspc/devspace-api/templates/service.yaml b/devspc/devspace-api/templates/service.yaml new file mode 100644 index 0000000..bc2cb7d --- /dev/null +++ b/devspc/devspace-api/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{$.Release.Name}}-{{$.Values.name}}" +spec: + selector: + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} + ports: + - protocol: TCP + port: {{$.Values.port}} # порт, по которуму сервис будет доступен внутри кластера + targetPort: {{$.Values.port}} # порт, на котором слушает ваше приложение внутри контейнера \ No newline at end of file diff --git a/devspc/devspace-api/values.yaml b/devspc/devspace-api/values.yaml new file mode 100644 index 0000000..49d490d --- /dev/null +++ b/devspc/devspace-api/values.yaml @@ -0,0 +1,7 @@ +port: 8080 +managementPort: 9090 +imagePullSecrets: null +image: + name: null + pullPolicy: Always + version: '' \ No newline at end of file