stx tool: control: Add the support of control module

Implement the stx control module so that the developer could
manage the four containers with the 'stx control xxx' command.
Containers: (stx-builder|stx-pkgbuilder|stx-lat-tool|stx-repomgr)

Now we assume that we have a minikube env to be ready for this
module, we can use it directly. For the minikube env installation
we can build it with the stx-init-env script later.

Now support the action: [status|start|stop|enter|upgrade]

stx control status:  Check status of the containers
stx control start:   Boot the containers up
stx control stop:    Shutdown the containers
stx control enter:   Login the container(default builder)
stx control upgrade: Upgrade the containers

This module will be used after the developer have a minikube env,

Please refer to the more help information with the command
'stx control --help'

Story: 2008862
Task: 42514

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
Change-Id: I0c25e0f784671e90c56d5d367b12a27c3f3fa7cf
This commit is contained in:
Zhixiong Chi
2021-09-08 16:46:40 +08:00
parent 3fbb169937
commit 8bcee26f1a
44 changed files with 1903 additions and 24 deletions

View File

@@ -0,0 +1,23 @@
# 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/

View File

@@ -0,0 +1,35 @@
---
apiVersion: v2
name: stx-builder
description: A Helm chart for Starlingx Building Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0
dependencies:
- name: stx-pkgbuilder
version: "0.1.0"
repository: "file://dependency_chart/stx-pkgbuilder"
- name: stx-lat-tool
version: "0.1.0"
repository: "file://dependency_chart/stx-lat-tool"
- name: stx-repomgr
version: "0.1.0"
repository: "file://dependency_chart/stx-aptly/stx-repomgr"

View File

@@ -0,0 +1,47 @@
# Release Variable
export MY_RELEASE=@MY_RELEASE@
# avoid calling your project 'build' it will break some SDEBs
export PROJECT=@PROJECT@
# uid
export MYUID=@MYUID@
# These are used in the Dockerfile, not sure where else
export MYUNAME=@MYUNAME@
export DIST=@DIST@
export STX_DIST=@STX_DIST@
export REPOMGR_TYPE=@REPOMGR_TYPE@
export GITUSER="@GITUSER@"
export GITEMAIL=@GITEMAIL@
export DEBFULLNAME="@DEBFULLNAME@"
export DEBEMAIL=@DEBEMAIL@
export PROXY=@PROXY@
export PROXYSERVER=@PROXYSERVER@
export PROXYPORT=@PROXYPORT@
export HOSTUSERNAME=@HOSTUSERNAME@
export CENGNURL=@CENGNURL@
if [[ x"@fetch@" == x"true" ]];then
export SOURCESLIST=/usr/local/bin/stx/@SOURCESLIST@
export DEBLIST=/usr/local/bin/stx/@DEBLIST@
export DSCLIST=/usr/local/bin/stx/@DSCLIST@
fi
export REPOMGR_URL=http://@PROJECT@-stx-repomgr:8080
export REPOMGR_DEPLOY_URL=http://@PROJECT@-stx-repomgr:80/
export BUILDER_URL=http://@PROJECT@-stx-pkgbuilder:8080/pkgbuilder/

View File

@@ -0,0 +1,14 @@
#!/bin/bash
if [ -f "$MY_REPO_ROOT_DIR/cgcs-root/build-tools/stx/repo_manage.py" ]; then
repo_manage.py clean
fi
rm -rf $MY_REPO_ROOT_DIR/stx-tools
rm -rf $MY_REPO_ROOT_DIR/cgcs-root
rm -rf $MY_REPO_ROOT_DIR/.repo
rm -f /home/$MYUNAME/prepare-build.done
echo "**************************************************************************"
echo "Cleanup Finished!"
echo "**************************************************************************"

View File

@@ -0,0 +1,32 @@
zomg 0.8.1-2
#zonemaster-cli 1.0.5-1.1
zoneminder 1.34.23-1
#zoneminder-doc #1.34.23-1
zookeeper 3.4.13-6
#zookeeper-bin 3.4.13-6
zookeeperd 3.4.13-6
#zoom-player 1.1.5~dfsg-6
zopfli# 1.0.3-1
#zoph 0.9.16-1
wpasupplicant 2:2.9.0-21
#wpd2epub 0.9.6-2
wpd2odt #0.9.6-2
wpewebkit-driver# 2.32.1-1
wpg2odg 0.9.6-2
wpolish #20210105-1
tryton-modules-all 47
#tryton-modules-analytic-account 5.0.3-1
tryton-modules-analytic-invoice# 1:5.0.3-1
#tryton-modules-analytic-purchase 5.0.2-1
tryton-modules-analytic-sale 5.0.2-1
#science-physics 1.14.1
science-physics-dev# 1.14.1
#science-presentation 1.14.1
science-psychophysics# 1.14.1
#science-robotics 1.14.1
science-robotics-dev# 1.14.1
#science-simulations 1.14.1
science-statistics# 1.14.1
#science-tasks 1.14.1
science-typesetting# 1.14.1
libdns-export1110

View File

@@ -0,0 +1,21 @@
yorick 2.2.04+dfsg1-12
yorick-full #2.2.04+dfsg1+full
xzgv 0.9.2-2
xzip# 1:1.8.2-4
#xvkbd #4.1-1
#xwallpaper 0.6.5-1
#ipolish #20210105-1
#ispell.pt 20210112-1
#tesseract-lang 1:4.00~git30-7274cfa-1.1
#swish-e #2.4.7-6
#swisswatch 0.6-18
#switchconf 0.0.17-1
#ruby-mechanize 2.7.7-1
#ruby-memoist 0.16.2-2
#zookeeper 3.4.13-6
#zookeeper 3.4.13-2
#0ad 0.0.23.1-2
#2vcard 0.6-1
#3270font #2.0.0-1
#389-ds-base 1.4.0.21-1
#openssl

View File

@@ -0,0 +1,54 @@
#!/bin/bash
git config --global user.name "$GITUSER"
git config --global user.email "$GITEMAIL"
git config --global color.ui false
cd $MY_REPO_ROOT_DIR
if [[ x"$PROXY" == x"true" ]]; then
ps aux|grep ssh|grep qTfnN 2>&1>/dev/null
ret=$?
if [[ x"$ret" != x"0" ]];then
echo "*************************************************************************************"
echo "Note: Next we will create the proxy and connect the proxyserver $PROXYSERVER!!!"
echo ""
echo ""
echo "*************************************************************************************"
ssh -D 8080 -qTfnN $HOSTUSERNAME@$PROXYSERVER
fi
proxychains repo init -u git://lxgit.wrs.com/stx-debian/manifest.git
proxychains repo sync
else
repo init -u git://lxgit.wrs.com/stx-debian/manifest.git
repo sync
fi
sudo apt-get update
if [[ x"$CENGNURL" != x"" ]]; then
repo_manage.py mirror --url $CENGNURL
fi
if [[ x"$SOURCESLIST" != x"" ]]; then
if [[ x"$DEBLIST" == x"" ]]; then
if [[ x"$DSCLIST" == x"" ]]; then
echo "Either deblist or dsclist must not NULL!!!!"
return 1
else
repo_manage.py download --sources_list=$SOURCESLIST --dsc_list=$DSCLIST
fi
else
if [[ x"$DSCLIST" == x"" ]]; then
repo_manage.py download --sources_list=$SOURCESLIST --deb_list=$DEBLIST
else
repo_manage.py download --sources_list=$SOURCESLIST --deb_list=$DEBLIST --dsc_list=$DSCLIST
fi
fi
fi
touch /home/$MYUNAME/prepare-build.done
echo "************************************************************************************************"
echo "Prepare Done!"
echo "************************************************************************************************"

View File

@@ -0,0 +1,4 @@
deb [trusted=yes] http://mirror.starlingx.cengn.ca/mirror/debian/debian/ftp.ca.debian.org/debian/ bullseye main
deb-src [trusted=yes] http://mirror.starlingx.cengn.ca/mirror/debian/debian/ftp.ca.debian.org/debian/ bullseye main
deb [trusted=yes] http://mirror.starlingx.cengn.ca/mirror/debian/debian/ftp.ca.debian.org/debian/ buster main
deb-src [trusted=yes] http://mirror.starlingx.cengn.ca/mirror/debian/debian/ftp.ca.debian.org/debian/ buster main

View File

@@ -0,0 +1,25 @@
---
apiVersion: v2
name: stx-repomgr
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "stx-repomgr.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stx-repomgr.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stx-repomgr.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "stx-repomgr.labels" -}}
helm.sh/chart: {{ include "stx-repomgr.chart" . }}
{{ include "stx-repomgr.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "stx-repomgr.selectorLabels" -}}
app.kubernetes.io/name: {{ include "stx-repomgr.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "stx-repomgr.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "stx-repomgr.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,60 @@
---
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.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
tty: true
volumeMounts:
- name: {{ .Values.volumeMounts.name }}
mountPath: {{ .Values.volumeMounts.mountPath}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: {{ .Values.volumes.name }}
hostPath:
path: {{ .Values.volumes.hostPath.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 }}

View File

@@ -0,0 +1,20 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "stx-repomgr.fullname" . }}
labels:
{{- include "stx-repomgr.labels" . | nindent 4 }}
spec:
type: {{ .Values.sendservice.type }}
ports:
- port: {{ .Values.sendservice.port }}
targetPort: 80
protocol: TCP
name: http-send
- port: {{ .Values.recvservice.port }}
targetPort: 8080
protocol: TCP
name: http-recv
selector:
{{- include "stx-repomgr.selectorLabels" . | nindent 4 }}

View File

@@ -0,0 +1,71 @@
# Default values for stx-repomgr.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
replicaCount: 1
image:
repository: stx-aptly
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.1.0"
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
volumeMounts:
name: shared-workspace
mountPath: /var/aptly
volumes:
name: shared-workspace
hostPath:
path: /workspace/aptly
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
sendservice:
type: ClusterIP
port: 80
recvservice:
type: ClusterIP
port: 8080
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}

View File

@@ -0,0 +1,23 @@
# 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/

View File

@@ -0,0 +1,24 @@
---
apiVersion: v2
name: stx-lat-tool
description: A Helm chart for LAT Tool of the StarlingX Building Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0

View File

@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "stx-lat-tool.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stx-lat-tool.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stx-lat-tool.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "stx-lat-tool.labels" -}}
helm.sh/chart: {{ include "stx-lat-tool.chart" . }}
{{ include "stx-lat-tool.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "stx-lat-tool.selectorLabels" -}}
app.kubernetes.io/name: {{ include "stx-lat-tool.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "stx-lat-tool.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "stx-lat-tool.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,60 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "stx-lat-tool.fullname" . }}
labels:
{{- include "stx-lat-tool.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "stx-lat-tool.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "stx-lat-tool.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.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
tty: true
volumeMounts:
- name: {{ .Values.volumes.name }}
mountPath: {{ .Values.volumeMounts.mountPath}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: {{ .Values.volumes.name }}
hostPath:
path: {{ .Values.volumes.hostPath.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 }}

View File

@@ -0,0 +1,64 @@
# Default values for stx-lat-tool.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
replicaCount: 1
image:
repository: stx-lat-tool
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.1.0"
volumeMounts:
name: latd-shared-workspace
mountPath: /localdisk
volumes:
name: latd-shared-workspace
hostPath:
path: /workspace/localdisk
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext:
privileged: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}

View File

@@ -0,0 +1,24 @@
---
apiVersion: v2
name: stx-pkgbuilder
description: A Helm chart for Starlingx Building Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0

View File

@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "stx-pkgbuilder.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stx-pkgbuilder.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stx-pkgbuilder.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "stx-pkgbuilder.labels" -}}
helm.sh/chart: {{ include "stx-pkgbuilder.chart" . }}
{{ include "stx-pkgbuilder.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "stx-pkgbuilder.selectorLabels" -}}
app.kubernetes.io/name: {{ include "stx-pkgbuilder.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "stx-pkgbuilder.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "stx-pkgbuilder.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.volumes.configmapname }}
data:
{{ (.Files.Glob "configmap/stx*").AsConfig | indent 2 }}

View File

@@ -0,0 +1,65 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "stx-pkgbuilder.fullname" . }}
labels:
{{- include "stx-pkgbuilder.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "stx-pkgbuilder.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "stx-pkgbuilder.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.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
tty: true
volumeMounts:
- name: {{ .Values.volumeMounts.name }}
mountPath: {{ .Values.volumeMounts.mountPath}}
- name: {{ .Values.volumeMounts.envsetupname }}
mountPath: {{ .Values.volumeMounts.envsetupmountPath}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: {{ .Values.volumes.name }}
hostPath:
path: {{ .Values.volumes.hostPath.path }}
- name: {{ .Values.volumes.envsetupname }}
configMap:
name: {{ .Values.volumes.configmapname }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,16 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "stx-pkgbuilder.fullname" . }}
labels:
{{- include "stx-pkgbuilder.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 80
protocol: TCP
name: http
selector:
{{- include "stx-pkgbuilder.selectorLabels" . | nindent 4 }}

View File

@@ -0,0 +1,73 @@
# Default values for stx-pkgbuilder.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
replicaCount: 1
image:
repository: stx-pkgbuilder
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.1.0"
volumeMounts:
name: shared-workspace
mountPath: /localdisk
envsetupname: env-setting
envsetupmountPath: /usr/local/bin/stx
volumes:
name: shared-workspace
hostPath:
path: /workspace/localdisk
envsetupname: env-setting
configmapname: pkgbuilder
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext:
privileged: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 8080
resources: {}
# We usually recommend not to specify default resources and to leave this as
# a conscious choice for the user. This also increases chances charts run on
# environments with little resources, such as Minikube. If you do want to
# specify resources, uncomment the following lines, adjust them as necessary,
# and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}

View File

@@ -0,0 +1,24 @@
---
apiVersion: v2
name: stx-repomgr
description: A Helm chart for Starlingx Building Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0

View File

@@ -0,0 +1,3 @@
#!/bin/bash
pulpcore-manager reset-admin-password -p admin

View File

@@ -0,0 +1,4 @@
CONTENT_ORIGIN = 'http://${PROJECT}-stx-pulp:8080'
ANSIBLE_API_HOSTNAME = 'http://${PROJECT}-stx-pulp:8080'
ANSIBLE_CONTENT_HOSTNAME = 'http://${PROJECT}-stx-pulp:8080/pulp/content'
TOKEN_AUTH_DISABLED = True

View File

@@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "stx-repomgr.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stx-repomgr.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stx-repomgr.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "stx-repomgr.labels" -}}
helm.sh/chart: {{ include "stx-repomgr.chart" . }}
{{ include "stx-repomgr.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "stx-repomgr.selectorLabels" -}}
app.kubernetes.io/name: {{ include "stx-repomgr.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "stx-repomgr.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "stx-repomgr.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.volumes.configmapname }}
data:
{{ (.Files.Glob "configmap/*").AsConfig | indent 2 }}

View File

@@ -0,0 +1,75 @@
---
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.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.volumes.storagehostPath.path }}
- name: {{ .Values.volumes.pgsqlname }}
hostPath:
path: {{ .Values.volumes.pgsqlhostPath.path }}
- name: {{ .Values.volumes.containersname }}
hostPath:
path: {{ .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 }}

View File

@@ -0,0 +1,16 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "stx-repomgr.fullname" . }}
labels:
{{- include "stx-repomgr.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 80
protocol: TCP
name: http
selector:
{{- include "stx-repomgr.selectorLabels" . | nindent 4 }}

View File

@@ -0,0 +1,81 @@
# Default values for stx-repomgr.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
replicaCount: 1
image:
repository: stx-pulp
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.1.0"
volumeMounts:
name: pulp-setting
mountPath: /etc/pulp
storagename: pulp-storage
storagemountPath: /var/lib/pulp
pgsqlname: pulp-pgsql
pgsqlmountPath: /var/lib/pgsql
containersname: pulp-containers
containersmountPath: /var/lib/containers
volumes:
name: pulp-setting
configmapname: pulp
storagename: pulp-storage
storagehostPath:
path: /workspace/pulp/pulp-storage
pgsqlname: pulp-pgsql
pgsqlhostPath:
path: /workspace/pulp/pulp-pgsql
containersname: pulp-containers
containershostPath:
path: /workspace/pulp/pulp-containers
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 8080
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}

View File

@@ -0,0 +1,52 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "stx-builder.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stx-builder.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stx-builder.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "stx-builder.labels" -}}
helm.sh/chart: {{ include "stx-builder.chart" . }}
{{ include "stx-builder.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "stx-builder.selectorLabels" -}}
app.kubernetes.io/name: {{ include "stx-builder.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.volumes.configmapname }}
data:
{{ (.Files.Glob "configmap/stx*").AsConfig | indent 2 }}

View File

@@ -0,0 +1,65 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "stx-builder.fullname" . }}
labels:
{{- include "stx-builder.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "stx-builder.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "stx-builder.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.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
tty: true
volumeMounts:
- name: {{ .Values.volumeMounts.name }}
mountPath: {{ .Values.volumeMounts.mountPath}}
- name: {{ .Values.volumeMounts.usersetupname }}
mountPath: {{ .Values.volumeMounts.usersetupmountPath}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: {{ .Values.volumes.name }}
hostPath:
path: {{ .Values.volumes.hostPath.path }}
- name: {{ .Values.volumes.usersetupname }}
configMap:
name: {{ .Values.volumes.configmapname }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,67 @@
# Default values for stx-builder.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
replicaCount: 1
image:
repository: stx-builder
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.1.0"
volumeMounts:
name: shared-workspace
mountPath: /localdisk
usersetupname: user-setting
usersetupmountPath: /usr/local/bin/stx
volumes:
name: shared-workspace
hostPath:
path: /workspace/localdisk
usersetupname: user-setting
configmapname: builder
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}