Skip to content

Commit

Permalink
Merge pull request #14 from Jaesang/add-lma-namespace
Browse files Browse the repository at this point in the history
Add LMA namespace before deploy lma apps
  • Loading branch information
seungkyua authored Oct 1, 2021
2 parents 1871cfd + 0ae119b commit bdb3e75
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions deploy_apps/tks-lma-federation-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ spec:
templates:
- name: deployLMA
steps:
- - name: createNamespace
template: create-namespace
arguments:
parameters:
- name: target_namespace
value: lma
- name: kubeconfig_secret_name
value: "{{workflow.parameters.site_name}}-kubeconfig"

- - name: installApps
templateRef:
name: lma-federation
Expand Down Expand Up @@ -106,6 +115,49 @@ spec:
value: "{{steps.collectThanosScEndpoints.outputs.parameters.inwards_endpoint_map}}"
## {"querier.stores": ['endpointA', 'endpointB']}

- name: create-namespace
arguments: {}
inputs:
parameters:
- name: target_namespace
- name: kubeconfig_secret_name
outputs: {}
metadata: {}
container:
name: create-namespace
image: 'k8s.gcr.io/hyperkube:v1.18.6'
command:
- /bin/bash
- '-c'
- |
function log() {
level=$1
msg=$2
date=$(date '+%F %H:%M:%S')
echo "[$date] $level $msg"
}
cat <<< "$KUBE_CONFIG" > /etc/kubeconfig
kubectl --kubeconfig=/etc/kubeconfig get ns ${TARGET_NAMESPACE}
if [[ $? =~ 1 ]]; then
kubectl --kubeconfig=/etc/kubeconfig create ns ${TARGET_NAMESPACE}
kubectl --kubeconfig=/etc/kubeconfig label ns ${TARGET_NAMESPACE} name=${TARGET_NAMESPACE}
kubectl --kubeconfig=/etc/kubeconfig label ns ${TARGET_NAMESPACE} taco-tls=enabled
log "INFO" "${TARGET_NAMESPACE} successfully created."
fi
env:
- name: TARGET_NAMESPACE
value: '{{inputs.parameters.target_namespace}}'
- name: KUBE_CONFIG
valueFrom:
secretKeyRef:
name: "{{ inputs.parameters.kubeconfig_secret_name }}"
key: value
resource: {}
activeDeadlineSeconds: 900
retryStrategy:
limit: 2

- name: collectThanosScEndpoints
inputs:
parameters:
Expand Down

0 comments on commit bdb3e75

Please sign in to comment.