
Extends the build tools to add support to Kubernetes. For kubernetes, it supports single node cluster and host path for the volumes. New environment variables: - PROJECT: build project name - STX_PLATFORM: minikube or kubernetes - STX_BUILD_CPUS: replaces MINIKUBECPUS - STX_K8S_NAMESPACE: kubernetes namespace name * Default values are set to minikube, more details added in import-stx.README. To deploy stx on k8s you need to follow the below steps: - create k8s namespace - export PROJECT, included to support multiproject environments it is used by the new default build home and also for docker tagging. - export STX_BUILD_HOME, e.g: /localdisk/user/$PROJECT - export STX_K8S_NAMESPACE="namespace_name" - export STX_PLATFORM="kubernetes" - export KUBECONFIG to your kubernetes config file - STX_BUILD_CPUS replaces MINIKUBECPUS, this variable is used by build-pkgs parallel jobs ($MAX_CPUS) - Create your build home $STX_BUILD_HOME - Init repo & repo sync - source import-stx, check the env variables - stx-init-env - stx control status/start/stop/enter Test Plan: Pass: Create env on minikube Pass: Create env on Kubernetes Pass: Apply patch on current minikube env and continue to work on the environment without issues Pass: build package on Debian Pass: build Debian image Story: 2009812 Task: 44391 Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com> Change-Id: I7b760fbf1454f6aa90dd93dd9ff3a61d5fbd1b5c
76 lines
2.5 KiB
YAML
76 lines
2.5 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "stx-repomgr.fullname" . }}
|
|
labels:
|
|
{{- include "stx-repomgr.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "stx-repomgr.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "stx-repomgr.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.global.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
tty: true
|
|
volumeMounts:
|
|
- name: {{ .Values.volumeMounts.name }}
|
|
mountPath: {{ .Values.volumeMounts.mountPath}}
|
|
- name: {{ .Values.volumeMounts.storagename }}
|
|
mountPath: {{ .Values.volumeMounts.storagemountPath}}
|
|
- name: {{ .Values.volumeMounts.pgsqlname }}
|
|
mountPath: {{ .Values.volumeMounts.pgsqlmountPath}}
|
|
- name: {{ .Values.volumeMounts.containersname }}
|
|
mountPath: {{ .Values.volumeMounts.containersmountPath}}
|
|
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
|
|
volumes:
|
|
- name: {{ .Values.volumes.name }}
|
|
configMap:
|
|
name: {{ .Values.volumes.configmapname }}
|
|
- name: {{ .Values.volumes.storagename }}
|
|
hostPath:
|
|
path: {{ .Values.global.hostDir }}{{ .Values.volumes.storagehostPath.path }}
|
|
- name: {{ .Values.volumes.pgsqlname }}
|
|
hostPath:
|
|
path: {{ .Values.global.hostDir }}{{ .Values.volumes.pgsqlhostPath.path }}
|
|
- name: {{ .Values.volumes.containersname }}
|
|
hostPath:
|
|
path: {{ .Values.global.hostDir }}{{ .Values.volumes.containershostPath.path }}
|
|
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|