forked from FuelLabs/fuel-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy Fuel-Core Ingress with SSL Cert (FuelLabs#209)
* Adding nginx ingress and cert manager deployment * Add new lines * Updating ValidatingWebhookConfiguration API Version * Updating ValidatingWebhookConfiguration API Version * Update cert manager helm chart version * Remove ingress controller definition * Updating helm upgrade cert-manager * Changing ingress controller version * Adding ingress delete script * Adding nginx ingress annotation
- Loading branch information
Showing
9 changed files
with
100 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ${k8s_namespace}-ingress | ||
namespace: ${k8s_namespace} | ||
annotations: | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false" | ||
nginx.ingress.kubernetes.io/rewrite-target: / | ||
cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
kubernetes.io/ingress.class: "nginx" | ||
spec: | ||
rules: | ||
- host: ${ingress_dns} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: ${k8s_namespace}-service | ||
port: | ||
number: ${ingress_http_port} | ||
tls: | ||
- hosts: | ||
- ${ingress_dns} | ||
secretName: letsencrypt-prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt-prod | ||
namespace: cert-manager | ||
spec: | ||
acme: | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
email: ${letsencrypt_email} | ||
privateKeySecretRef: | ||
name: letsencrypt-prod | ||
solvers: | ||
- http01: | ||
ingress: | ||
class: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
# Kubernetes Provider Enviromment Variables | ||
k8s_provider="eks" | ||
|
||
# Helm Enviroment Variables | ||
# Helm Environment Values | ||
k8s_namespace="fuel-core" | ||
fuel_core_image_repository="ghcr.io/fuellabs/fuel-core" | ||
fuel_core_image_tag="latest" | ||
fuel_core_pod_replicas="1" | ||
pvc_storage_class="gp2" | ||
pvc_storage_requests="3Gi" | ||
|
||
# Ingress Environment variables | ||
letsencrypt_email="[email protected]" | ||
ingress_dns="example.com" | ||
ingress_http_port="80" | ||
|
||
# AWS Environment variables | ||
TF_VAR_environment="fuel-core" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -o allexport && source .env && set +o allexport | ||
|
||
if [ "${k8s_provider}" == "eks" ]; then | ||
echo " ...." | ||
aws eks update-kubeconfig --name ${TF_VAR_eks_cluster_name} | ||
cd ../ingress/${k8s_provider} | ||
kubectl delete -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/aws/1.21/deploy.yaml | ||
helm delete cert-manager --namespace cert-manager | ||
kubectl delete -f prod-issuer.yaml | ||
kubectl delete -f ingress.yaml | ||
else | ||
echo "You have inputted a non-supported kubernetes provider in your .env" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
set -o allexport && source .env && set +o allexport | ||
|
||
if [ "${k8s_provider}" == "eks" ]; then | ||
echo " ...." | ||
aws eks update-kubeconfig --name ${TF_VAR_eks_cluster_name} | ||
cd ../ingress/${k8s_provider} | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/aws/1.21/deploy.yaml | ||
helm repo add jetstack https://charts.jetstack.io | ||
helm repo update | ||
helm upgrade cert-manager jetstack/cert-manager --namespace cert-manager --version v1.7.1 --install --create-namespace | ||
mv prod-issuer.yaml prod-issuer.template | ||
envsubst < prod-issuer.template > prod-issuer.yaml | ||
rm prod-issuer.template | ||
kubectl apply -f prod-issuer.yaml | ||
mv ingress.yaml ingress.template | ||
envsubst < ingress.template > ingress.yaml | ||
rm ingress.template | ||
kubectl apply -f ingress.yaml | ||
else | ||
echo "You have inputted a non-supported kubernetes provider in your .env" | ||
fi |