Skip to content
Snippets Groups Projects
Commit 4a7a9f01 authored by ludo8147's avatar ludo8147
Browse files

apply cert Manager and configure https

parent e8f1f19e
No related branches found
No related tags found
No related merge requests found
Pipeline #68866 passed
...@@ -8,6 +8,7 @@ variables: ...@@ -8,6 +8,7 @@ variables:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION} AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
CERT_MANAGER_VERSION: v1.13.0
stages: stages:
- 'build' - 'build'
...@@ -164,11 +165,15 @@ deploy_to_staging: ...@@ -164,11 +165,15 @@ deploy_to_staging:
kubectl apply -f bundle.yaml --server-side kubectl apply -f bundle.yaml --server-side
kubectl wait --for=condition=Established --all crd --timeout=300s kubectl wait --for=condition=Established --all crd --timeout=300s
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/${CERT_MANAGER_VERSION}/cert-manager.yaml
kubectl wait --for=condition=Available --timeout=300s deployment/cert-manager-webhook -n cert-manager
echo "Validating and applying Kubernetes manifests..." echo "Validating and applying Kubernetes manifests..."
for file in deployment.yaml service.yaml ingress.yaml redis.yaml prometheus.yaml network-policy.yaml redis-pv-pvc.yaml; do for file in deployment.yaml service.yaml ingress.yaml redis.yaml prometheus.yaml network-policy.yaml redis-pv-pvc.yaml cluster-issuer.yaml; do
echo "Applying $file" echo "Applying $file"
envsubst < $file | kubectl apply -f - envsubst < $file | kubectl apply -f -
done done
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.1/deploy/static/provider/cloud/deploy.yaml
echo "All manifests applied successfully." echo "All manifests applied successfully."
rules: rules:
......
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: ludo8147@bht-berlin.de
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx
\ No newline at end of file
...@@ -5,9 +5,15 @@ metadata: ...@@ -5,9 +5,15 @@ metadata:
namespace: ${KUBE_NAMESPACE} namespace: ${KUBE_NAMESPACE}
annotations: annotations:
kubernetes.io/ingress.class: nginx kubernetes.io/ingress.class: nginx
nginx-ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec: spec:
tls:
- hosts:
- "webdevops.ddns.net"
secretName: webdevops-tls
rules: rules:
- host: my-domain.com - host: "webdevops.ddns.net"
http: http:
paths: paths:
- path: / - path: /
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment