Skip to content

Commit

Permalink
[PDP-3573] 2024 week 49 update (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
syan-tibco authored Dec 5, 2024
1 parent 70095f9 commit e1e0bfb
Show file tree
Hide file tree
Showing 16 changed files with 200 additions and 74 deletions.
2 changes: 1 addition & 1 deletion charts/helm-install/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

apiVersion: v2
name: helm-install
version: "1.0.7"
version: "1.0.8"
appVersion: "1.0.0"
description: helm-install
type: application
Expand Down
52 changes: 35 additions & 17 deletions charts/helm-install/scripts/_funcs_helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,38 @@

######################################### _download_funcs.sh #########################################

# download_public_helm_chart download chart from a given repo, The url must contain https:// as protocol
# pull_helm_chart download chart from a given repo, The url must contain https:// as protocol
# this is used for the following recipe
#- name: ingress-nginx # chart name
# version: 4.0.5 # chart version
# repo:
# helm:
# url: https://kubernetes.github.io/ingress-nginx
# sample helm pull --repo https://kubernetes.github.io/ingress-nginx ingress-nginx --version 4.0.3
function download_public_helm_chart() {
local _url=${1}
# add optional username and password field
function pull_helm_chart() {
local _chart_repo_helm_section=${1}
local _name=${2}
local _version=${3}

local _url=""
_url=$(echo "${_chart_repo_helm_section}" | common::yq4-get '.url')
local _username=""
_username="$(echo "${_chart_repo_helm_section}" | common::yq4-get '.username')"
local _password=""
_password="$(echo "${_chart_repo_helm_section}" | common::yq4-get '.password')"
common::debug "downloading chart ${_name} form ${_url} with version ${_version}"

if ! "${HELM_COMMAND_LINE}" pull --repo "${_url}" "${_name}" --version "${_version}"; then
_cmd="${HELM_COMMAND_LINE} pull --repo ${_url} ${_name} --version ${_version}"
if [[ -n "${_username}" ]]; then
_cmd="${_cmd} --username ${_username}"
fi

if [[ -n "${_password}" ]]; then
_cmd="${_cmd} --password ${_password}"
fi

if ! eval "${_cmd}"; then
common::err "${HELM_COMMAND_LINE} pull error"
return 1
fi
Expand Down Expand Up @@ -134,38 +151,39 @@ function pull_github_chart() {
fi
}

# downloadChart this will download chart
# downloadChart this will download chart based on the recipe .helmCharts[].repo section
function downloadChart() {
local _repo_section=${1}
local _chart_name=${2}
local _chart_version=${3}

local _chart_repo_helm=""
_chart_repo_helm=$(echo "${_repo_section}" | common::yq4-get '.helm')
local _chart_repo_ecr=""
_chart_repo_ecr=$(echo "${_repo_section}" | common::yq4-get '.ecr')
local _chart_git_ecr=""
_chart_git_ecr=$(echo "${_repo_section}" | common::yq4-get '.git')
if [[ -n ${_chart_repo_helm} ]]; then
download_public_helm_chart "$(echo "${_chart_repo_helm}" | common::yq4-get '.url')" "${_chart_name}" "${_chart_version}"
local _chart_repo_helm_section=""
_chart_repo_helm_section=$(echo "${_repo_section}" | common::yq4-get '.helm')
local _chart_repo_ecr_section=""
_chart_repo_ecr_section=$(echo "${_repo_section}" | common::yq4-get '.ecr')
local _chart_repo_git_section=""
_chart_repo_git_section=$(echo "${_repo_section}" | common::yq4-get '.git')

if [[ -n ${_chart_repo_helm_section} ]]; then
pull_helm_chart "${_chart_repo_helm_section}" "${_chart_name}" "${_chart_version}"
_res=$?
if [ ${_res} -ne 0 ]; then
common::err "download public helm chart error"
return ${_res}
fi
fi

if [[ -n ${_chart_repo_ecr} ]]; then
pull_ecr_chart "$(echo "${_chart_repo_ecr}" | common::yq4-get '.region')" "$(echo "${_chart_repo_ecr}" | common::yq4-get '.host')" "$(echo "${_chart_repo_ecr}" | common::yq4-get '.name')" "${_chart_version}" "${_chart_name}" "."
if [[ -n ${_chart_repo_ecr_section} ]]; then
pull_ecr_chart "$(echo "${_chart_repo_ecr_section}" | common::yq4-get '.region')" "$(echo "${_chart_repo_ecr_section}" | common::yq4-get '.host')" "$(echo "${_chart_repo_ecr_section}" | common::yq4-get '.name')" "${_chart_version}" "${_chart_name}" "."
_res=$?
if [ ${_res} -ne 0 ]; then
common::err "pull ECR error"
return ${_res}
fi
fi

if [[ -n ${_chart_git_ecr} ]]; then
pull_github_chart "$(echo "${_chart_git_ecr}" | common::yq4-get '.github'.repo)" "${_chart_version}" "$(echo "${_chart_git_ecr}" | common::yq4-get '.github.path')" "$(echo "${_chart_git_ecr}" | common::yq4-get '.github.hash')"
if [[ -n ${_chart_repo_git_section} ]]; then
pull_github_chart "$(echo "${_chart_repo_git_section}" | common::yq4-get '.github'.repo)" "${_chart_version}" "$(echo "${_chart_repo_git_section}" | common::yq4-get '.github.path')" "$(echo "${_chart_repo_git_section}" | common::yq4-get '.github.hash')"
_res=$?
if [ ${_res} -ne 0 ]; then
common::err "pull from git error"
Expand Down
4 changes: 3 additions & 1 deletion charts/helm-install/scripts/check.cue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ package recipe
// helm upgrade ... --repo ${repo.helm.url} ...
// the version will be the chart version
helm?: {
url!: string
url!: string
username?: string
password?: string
}
// {repo.ecr.host}/${repo.ecr.name}:${version}
// The version will be the image tag
Expand Down
2 changes: 1 addition & 1 deletion charts/provisioner-config-local/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apiVersion: v2
name: provisioner-config-local
description: Platform Provisioner local config
type: application
version: "1.0.73"
version: "1.0.83"
appVersion: "2.0.0"
home: https://github.com/TIBCOSoftware/tp-helm-charts
maintainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ options:
guiType: input
reference: "meta.guiEnv.GUI_CP_CHART_REPO"
description: |
The helm chart repository to deploy CP. The default value is public repo. To use private repo set: https://${GITHUB_TOKEN}@raw.githubusercontent.com/tibco/tp-helm-charts/gh-pages
The helm chart repository to deploy CP. The default value is public repo.
To use private repo set: https://raw.githubusercontent.com/tibco/tp-helm-charts/gh-pages and set `GUI_CP_CHART_REPO_TOKEN` OR use https://${GITHUB_TOKEN}@raw.githubusercontent.com/tibco/tp-helm-charts/gh-pages
- name: "CP Chart repo user name"
groupIndex: 1
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ options:
reference: "meta.guiEnv.GUI_CP_CHART_REPO"
required: true
description: |
The helm chart repository to deploy CP. The default value is public repo. To use private repo set: https://${GITHUB_TOKEN}@raw.githubusercontent.com/tibco/tp-helm-charts/gh-pages
The helm chart repository to deploy CP. The default value is public repo.
To use private repo set: https://raw.githubusercontent.com/tibco/tp-helm-charts/gh-pages and set `GUI_CP_CHART_REPO_TOKEN` OR use https://${GITHUB_TOKEN}@raw.githubusercontent.com/tibco/tp-helm-charts/gh-pages
- name: "CP Chart repo user name"
type: string
guiType: input
reference: "meta.guiEnv.GUI_CP_CHART_REPO_USER_NAME"
description: "The CP chart repository user name. (optional)"
- name: "CP Chart repo token"
type: password
guiType: input
reference: "meta.guiEnv.GUI_CP_CHART_REPO_TOKEN"
description: ""
- name: "CP instance ID"
type: string
guiType: input
Expand Down Expand Up @@ -60,6 +71,8 @@ recipe: |
meta:
guiEnv:
note: "upgrade-cp"
GUI_CP_CHART_REPO_USER_NAME: "cp-test"
GUI_CP_CHART_REPO_TOKEN: ""
GUI_CP_INSTANCE_ID: "cp1"
GUI_CP_NAMESPACE: "cp1-ns"
GUI_CP_PLATFORM_BOOTSTRAP_VERSION: ^1.0.0
Expand Down Expand Up @@ -92,6 +105,8 @@ recipe: |
repo:
helm:
url: ${CP_CHART_REPO}
username: ${CP_CHART_REPO_USER_NAME}
password: ${CP_CHART_REPO_TOKEN}
values:
keepPrevious: true
content: |
Expand All @@ -110,6 +125,8 @@ recipe: |
repo:
helm:
url: ${CP_CHART_REPO}
username: ${CP_CHART_REPO_USER_NAME}
password: ${CP_CHART_REPO_TOKEN}
values:
keepPrevious: true
content: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ groups:
* MicroK8s: `microk8s-hostpath` (support ReadWriteMany)
* OpenShift: `crc-csi-hostpath-provisioner` (Don't support ReadWriteMany)
* NFS server provisioner: `nfs` (support ReadWriteMany)
- title: "Cluster tools"
- title: "Database"
index: 8
description: |
Cluster tools specific configurations.
* Postgres database is optional if you only want to create a DP Cluster.
* Install provisioner UI ingress for the on-prem setup. You can then access provisioner UI at [https://provisioner.localhost.dataplanes.pro](https://provisioner.localhost.dataplanes.pro)
DB specific configurations. The default value is for postgres pod.
- title: "Flow control"
index: 10
description: |
Change the installation flow control options.
* Postgres database is optional if you only want to create a DP Cluster.
* Install provisioner UI ingress for the on-prem setup. You can then access provisioner UI at [https://provisioner.localhost.dataplanes.pro](https://provisioner.localhost.dataplanes.pro)
options:
# groupIndex: 1 Cluster Ingress Configuration
- name: "TP ingress DNS domain"
Expand Down Expand Up @@ -120,58 +120,88 @@ options:
description: |
The size of the NFS server provisioner storage.
# groupIndex: 8 Cluster tools
- name: "Install cert-manager"
# groupIndex: 8 Database
- name: "DB user name"
groupIndex: 8
type: string
guiType: input
reference: "meta.guiEnv.GUI_TP_DB_USER_NAME"
required: true
description: |
The DB user name. If you provisioner postgres pod; you can use "postgres". If you create RDS; you need to use the RDS master user name.
- name: "DB password"
groupIndex: 8
type: password
guiType: input
reference: "meta.guiEnv.GUI_TP_DB_PASSWORD"
# required: true # cannot set required because of bug
description: |
The DB password. If you provisioner postgres pod; you can use "postgres". If you create RDS; you need to use the RDS master password.
- name: "DB name"
groupIndex: 8
type: string
guiType: input
reference: "meta.guiEnv.GUI_TP_DB_NAME"
description: |
The Database name
- name: "Enable Postgres TLS"
groupIndex: 8
type: boolean
guiType: checkbox
reference: "meta.guiEnv.GUI_TP_DB_TLS_ENABLED"
description: |
Enable TLS for Postgres
# groupIndex: 10 Flow control
- name: "Install cert-manager"
groupIndex: 10
type: boolean
guiType: checkbox
reference: "meta.guiEnv.GUI_TP_INSTALL_CERT_MANAGER"
description: |
Install cert-manager for TP Cluster
- name: "Install metrics-server"
groupIndex: 8
groupIndex: 10
type: boolean
guiType: checkbox
reference: "meta.guiEnv.GUI_TP_INSTALL_METRICS_SERVER"
description: |
Install metrics-server for TP Cluster
- name: "Install nfs-server-provisioner"
groupIndex: 8
groupIndex: 10
type: boolean
guiType: checkbox
reference: "meta.guiEnv.GUI_TP_INSTALL_NFS_SERVER_PROVISIONER"
description: |
Install NFS server provisioner for TP Cluster
- name: "Install Postgres"
groupIndex: 8
groupIndex: 10
type: boolean
guiType: checkbox
reference: "meta.guiEnv.GUI_TP_INSTALL_POSTGRES"
description: |
Install Postgres database for TP Cluster
- name: "Install Provisioner UI Ingress object"
groupIndex: 8
groupIndex: 10
type: boolean
guiType: checkbox
reference: "meta.guiEnv.GUI_TP_INSTALL_PROVISIONER_UI"
description: |
This will update Provisioner UI ingress
- name: "Provisioner UI Ingress class name"
groupIndex: 8
groupIndex: 10
type: string
guiType: input
reference: "meta.guiEnv.GUI_TP_PROVISIONER_UI_INGRESS_CLASSNAME"
description: |
Ingress class name for Provisioner UI. Default is `nginx`
- name: "Provisioner UI namespace"
groupIndex: 8
groupIndex: 10
type: string
guiType: input
reference: "meta.guiEnv.GUI_TP_PROVISIONER_UI_NAMESPACE"
description: |
Namespace for Provisioner UI. Default is `tekton-tasks`
# groupIndex: 10 Flow control
- name: "Enable pipline debug logs"
groupIndex: 10
type: boolean
Expand Down
Loading

0 comments on commit e1e0bfb

Please sign in to comment.