Merge "Openstack clients helm chart"

This commit is contained in:
Zuul 2019-06-13 18:08:48 +00:00 committed by Gerrit Code Review
commit dba1d34b09
10 changed files with 282 additions and 1 deletions

View File

@ -1,3 +1,4 @@
SRC_DIR="stx-openstack-helm"
COPY_LIST_TO_TAR="$PKG_BASE/../../../helm-charts/garbd"
COPY_LIST_TO_TAR="$PKG_BASE/../../../helm-charts/garbd \
$PKG_BASE/../../../helm-charts/clients"
TIS_PATCH_VER=14

View File

@ -60,6 +60,7 @@ make nova-api-proxy
make garbd
make keystone-api-proxy
make fm-rest-api
make clients
# terminate helm server (the last backgrounded task)
kill %1

View File

@ -0,0 +1,10 @@
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
apiVersion: v1
description: openstack clients chart
name: clients
version: 0.1.0

View File

@ -0,0 +1,9 @@
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
dependencies:
- name: helm-toolkit
repository: http://localhost:8879/charts
version: 0.1.0

View File

@ -0,0 +1,35 @@
{{/*
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if .Values.global.configmap_etc }}
{{- $envAll := . }}
{{- if empty .Values.endpoints.identity.auth.auth_url -}}
{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.endpoints.identity.auth "auth_url" -}}
{{- end -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: 2019-04-18T19:14:38Z
name: config-{{- .Values.global.name }}
data:
clouds.yaml: |
clouds:
{{ .Values.global.cloud_name | toYaml | trim | indent 6 }}:
region_name: {{ .Values.endpoints.identity.auth.admin.region_name }}
identity_api_version: 3
endpoint_type: internalURL
auth:
username: {{ .Values.endpoints.identity.auth.admin.username | quote }}
password: {{ .Values.endpoints.identity.auth.admin.password | quote }}
project_name: {{ .Values.endpoints.identity.auth.admin.project_name | quote }}
project_domain_name: {{ .Values.endpoints.identity.auth.admin.project_domain_name | quote }}
user_domain_name: {{ .Values.endpoints.identity.auth.admin.user_domain_name | quote }}
auth_url: {{ .Values.endpoints.identity.auth.auth_url | quote }}
{{- end }}

View File

@ -0,0 +1,59 @@
{{/*
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if eq .Values.global.deployAs "Deployment" }}
{{- $mount := "/etc/openstack" }}
{{- $envAll := . }}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Values.global.name }}
spec:
replicas: {{ .Values.global.replicas }}
strategy:
type: Recreate
template:
metadata:
labels:
app: {{ .Values.global.name }}
spec:
{{- if .Values.global.rbac }}
serviceAccountName: {{ .Values.rbac.serviceAccount }}
{{- end }}
affinity:
{{ tuple $envAll "openstack" "clients" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
volumes:
- name: config-volume-{{- .Values.global.name }}
configMap:
name: config-{{- .Values.global.name }}
{{- if .Values.volume.enabled }}
- name: staging-{{ .Values.global.name }}
persistentVolumeClaim:
claimName: pvc-{{ .Values.global.name }}
{{- end }}
containers:
- name: {{ .Values.global.name }}
image: {{ .Values.images.tags.openstackclients | quote }}
env:
- name: OS_CLOUD
value: {{ .Values.global.cloud_name }}
{{- if .Values.global.keep_running }}
command: ["/bin/bash"]
args: ["-c", "trap : TERM INT; sleep infinity & wait"]
{{- end }}
volumeMounts:
- name: config-volume-{{- .Values.global.name }}
mountPath: {{ $mount }}
{{- if .Values.volume.enabled }}
- name: staging-{{ .Values.global.name }}
mountPath: {{ .Values.volume.mount_path }}
{{- end }}
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
{{- end }}

View File

@ -0,0 +1,21 @@
{{/*
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if and .Values.volume.enabled (eq .Values.global.deployAs "Deployment") }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-{{- .Values.global.name }}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ .Values.volume.size }}
storageClassName: {{ .Values.volume.class_name }}
{{- end }}

View File

@ -0,0 +1,16 @@
{{/*
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if .Values.global.rbac }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.rbac.serviceAccount }}
imagePullSecrets:
- name: default-registry-key
{{- end }}

View File

@ -0,0 +1,68 @@
{{/*
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if eq .Values.global.deployAs "StatefulSet" }}
{{- $mount := "/etc/openstack" }}
{{- $envAll := . }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Values.global.name }}
spec:
replicas: {{ .Values.global.replicas }}
serviceName: {{ .Values.global.name }}
podManagementPolicy: "Parallel"
selector:
matchLabels:
app: {{ .Values.global.name }}
template:
metadata:
labels:
app: {{ .Values.global.name }}
spec:
{{- if .Values.global.rbac }}
serviceAccountName: {{ .Values.rbac.serviceAccount }}
{{- end }}
affinity:
{{ tuple $envAll "openstack" "clients" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
volumes:
- name: config-volume-{{- .Values.global.name }}
configMap:
name: config-{{- .Values.global.name }}
containers:
- name: {{ .Values.global.name }}
image: {{ .Values.images.tags.openstackclients | quote }}
env:
- name: OS_CLOUD
value: {{ .Values.global.cloud_name }}
{{- if .Values.global.keep_running }}
command: ["/bin/bash"]
args: ["-c", "trap : TERM INT; sleep infinity & wait"]
{{- end }}
volumeMounts:
- name: config-volume-{{- .Values.global.name }}
mountPath: {{ $mount }}
{{- if .Values.volume.enabled }}
- name: staging-{{ .Values.global.name }}
mountPath: {{ .Values.volume.mount_path }}
{{- end }}
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
{{- if .Values.volume.enabled }}
volumeClaimTemplates:
- metadata:
name: staging-{{ .Values.global.name }}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ .Values.volume.size }}
storageClassName: {{ .Values.volume.class_name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,61 @@
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
endpoints:
cluster_domain_suffix: cluster.local
identity:
name: keystone
namespace: openstack
auth:
auth_url: null
admin:
region_name: RegionOne
username: admin
password: password
project_name: admin
user_domain_name: default
project_domain_name: default
hosts:
default: keystone-api
public: keystone
host_fqdn_override:
default: null
path:
default: /v3
scheme:
default: http
port:
api:
default: 80
internal: 5000
pod:
affinity:
anti:
type:
default: preferredDuringSchedulingIgnoredDuringExecution
topologyKey:
default: kubernetes.io/hostname
labels:
node_selector_key: openstack-control-plane
node_selector_value: enabled
global:
deployAs: Deployment
configmap_etc: true
replicas: 1
name: "openstack-clients"
cloud_name: cloud
keep_running: false
rbac: true
volume:
enabled: true
class_name: general
size: 5Gi
mount_path: "/scratch"
rbac:
serviceAccount: clients
images:
tags:
openstackclients: docker.io/starlingx/stx-openstackclients:master-centos-stable-latest