feat: add vcluster connection to argo upon creation
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{{- $fullname := include "vCluster.fullname" . -}}
|
||||
{{- $name := include "vCluster.releaseName" . -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
labels:
|
||||
argocd.argoproj.io/secret-type: cluster
|
||||
name: cluster-{{ $fullname }}
|
||||
namespace: argocd
|
||||
type: Opaque
|
||||
stringData:
|
||||
config: '{"bearerToken": {{ .Files.Get "_token" }}, "tlsClientConfig": { "insecure" : true }}'
|
||||
name: {{ $fullname }}
|
||||
server: https://{{ $fullname }}.{{ .Release.Namespace }}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,37 +17,15 @@ name=$1
|
||||
ns=$name-vcluster
|
||||
shift
|
||||
|
||||
kubectl oidc-login get-token \
|
||||
--oidc-issuer-url=https://login.microsoftonline.com/3f737008-e9a0-4485-9d27-40329d288089/v2.0 \
|
||||
--oidc-client-id=9b6daef0-02fa-4574-8949-f7c1b5fccd15 \
|
||||
--oidc-client-secret=o~N8Q~0IvCN05RTohzpYI4yEJ815eKfnzkd9LbUt | jq .status.token > chart/_token
|
||||
|
||||
$k get ns $ns >/dev/null 2>&1 || $k create ns $ns
|
||||
helm template -n $ns $@ $name ./chart | $k apply -f -
|
||||
|
||||
# configure_cluster_files () {
|
||||
# mkdir -p _$name/host _$name/vcluster
|
||||
$k wait -n $ns --for=condition=ready pod -l app=vcluster
|
||||
kubectl --context $name-vcluster -n dapr-system wait pod --for=condition=ready -l app=dapr-operator
|
||||
kubectl kustomize ../resources/atlantis/manifests/staging | kubectl --context $name-vcluster apply -f-
|
||||
|
||||
# cd templates
|
||||
# for i in values.yaml host/*.yaml vcluster/*.yaml; do
|
||||
# sed "s/<x>/$name/g" $i > ../_$name/$i
|
||||
# done
|
||||
# cd ..
|
||||
# }
|
||||
|
||||
# configure_cluster_files
|
||||
|
||||
# kubectl apply -n $ns -f _$name/host/cnpg.yaml
|
||||
# echo "Waiting for databases to become ready..."
|
||||
# kubectl wait -n $ns --for=condition=ready=true cluster $ns-db --timeout=60s
|
||||
|
||||
# kubectl apply -n $ns -f _$name/host/generate-cnp-rules.yaml
|
||||
# kubectl apply -n $ns -f _$name/host/rbac.yaml
|
||||
# kubectl apply -n $ns -f _$name/host/jaeger.yaml
|
||||
|
||||
# vcluster create $name -n $ns --distro k3s --connect=false -f _$name/values.yaml
|
||||
# # helm template $name -n $ns -f _$name/values.yaml > k11n/_manifest.sh
|
||||
# # kubectl kustomize k11n > _$name/manifest.yaml
|
||||
# # kubectl apply -f _$name/manifest.yaml
|
||||
|
||||
# vcluster connect $name -- kubectl apply -f _$name/vcluster/rbac.yaml
|
||||
|
||||
# vcluster connect $name -- dapr init -k
|
||||
# vcluster connect $name -- kubectl apply -f _$name/vcluster/tracing.yaml
|
||||
|
||||
# ./update-kubeconfig.sh $name
|
||||
|
||||
Reference in New Issue
Block a user