forked from gitops-bridge-dev/gitops-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
33 lines (31 loc) · 1.64 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
output "configure_kubectl" {
description = "Configure kubectl: make sure you're logged in with the correct AWS profile and run the following command to update your kubeconfig"
value = <<-EOT
export KUBECONFIG="/tmp/${module.eks.cluster_name}"
aws eks --region ${local.region} update-kubeconfig --name ${module.eks.cluster_name}
EOT
}
output "configure_argocd" {
description = "Terminal Setup"
value = <<-EOT
export KUBECONFIG="/tmp/${module.eks.cluster_name}"
aws eks --region ${local.region} update-kubeconfig --name ${module.eks.cluster_name}
export ARGOCD_OPTS="--port-forward --port-forward-namespace argocd --grpc-web"
kubectl config set-context --current --namespace argocd
argocd login --port-forward --username admin --password $(argocd admin initial-password | head -1)
echo "ArgoCD Username: admin"
echo "ArgoCD Password: $(kubectl get secrets argocd-initial-admin-secret -n argocd --template="{{index .data.password | base64decode}}")"
echo Port Forward: http://localhost:8080
kubectl port-forward -n argocd svc/argo-cd-argocd-server 8080:80
EOT
}
output "access_argocd" {
description = "ArgoCD Access"
value = <<-EOT
export KUBECONFIG="/tmp/${module.eks.cluster_name}"
aws eks --region ${local.region} update-kubeconfig --name ${module.eks.cluster_name}
echo "ArgoCD Username: admin"
echo "ArgoCD Password: $(kubectl get secrets argocd-initial-admin-secret -n argocd --template="{{index .data.password | base64decode}}")"
echo "ArgoCD URL: https://$(kubectl get svc -n argocd argo-cd-argocd-server -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"
EOT
}