Openstack clients helm chart
Add a helm chart for configuring and starting openstack clients pods. The pod is configured with admin credentials and launched on a controller node. Change-Id: I4dea49301fd778db9a9ddf900a752831bd455fda Signed-off-by: Stefan Dinescu <stefan.dinescu@windriver.com> Story: 2005312 Task: 30557
This commit is contained in:
parent
37b51a252f
commit
9dd64e3b90
@ -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
|
||||
|
@ -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
|
||||
|
10
kubernetes/helm-charts/clients/Chart.yaml
Normal file
10
kubernetes/helm-charts/clients/Chart.yaml
Normal 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
|
9
kubernetes/helm-charts/clients/requirements.yaml
Normal file
9
kubernetes/helm-charts/clients/requirements.yaml
Normal 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
|
35
kubernetes/helm-charts/clients/templates/configmap-etc.yaml
Normal file
35
kubernetes/helm-charts/clients/templates/configmap-etc.yaml
Normal 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 }}
|
59
kubernetes/helm-charts/clients/templates/deployment.yaml
Normal file
59
kubernetes/helm-charts/clients/templates/deployment.yaml
Normal 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 }}
|
21
kubernetes/helm-charts/clients/templates/pvc.yaml
Normal file
21
kubernetes/helm-charts/clients/templates/pvc.yaml
Normal 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 }}
|
16
kubernetes/helm-charts/clients/templates/serviceaccount.yaml
Normal file
16
kubernetes/helm-charts/clients/templates/serviceaccount.yaml
Normal 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 }}
|
68
kubernetes/helm-charts/clients/templates/statefulset.yaml
Normal file
68
kubernetes/helm-charts/clients/templates/statefulset.yaml
Normal 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 }}
|
61
kubernetes/helm-charts/clients/values.yaml
Normal file
61
kubernetes/helm-charts/clients/values.yaml
Normal 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
|
Loading…
Reference in New Issue
Block a user