diff --git a/ci.sh b/ci.sh index b46eec4..a76cd41 100755 --- a/ci.sh +++ b/ci.sh @@ -95,4 +95,10 @@ echo "info setting up repo" cat manifests/argocd-project.yaml | sed 's/__ARGOCD_PAT__/'"$ARGOCD_PAT"'/g' | kubectl apply -f - echo "info deploying game" -kubectl apply -f manifests/game/application.yaml \ No newline at end of file +kubectl apply -f manifests/game/application.yaml + +echo "info deploying grafana ingress" +kubectl apply -f manifests/grafana-ingress/application.yaml + +echo "info deploying argocd ingress" +kubectl apply -f manifests/argocd-ingress/application.yaml \ No newline at end of file diff --git a/manifests/argocd-ingress/application.yaml b/manifests/argocd-ingress/application.yaml new file mode 100644 index 0000000..5501b9b --- /dev/null +++ b/manifests/argocd-ingress/application.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argo-cd-ingress + namespace: argo-cd +spec: + destination: + namespace: argo-cd + server: https://kubernetes.default.svc + project: default + source: + path: manifests/argocd-ingress + repoURL: https://github.com/ReinierNel/devops-demo.git + targetRevision: main + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + selfHeal: true + prune: true diff --git a/manifests/argocd-ingress/base/ingress.yaml b/manifests/argocd-ingress/base/ingress.yaml new file mode 100644 index 0000000..6b6f662 --- /dev/null +++ b/manifests/argocd-ingress/base/ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: argo-cd + namespace: argo-cd + annotations: + cert-manager.io/issuer: argo-cd-letsencrypt +spec: + ingressClassName: nginx + rules: + - host: "argocd.devops-demo.reinier.co.za" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: argo-cd-argocd-server + port: + number: 443 + tls: + - hosts: + - "grafana.devops-demo.reinier.co.za" + secretName: grafana-tls-secret \ No newline at end of file diff --git a/manifests/argocd-ingress/base/issuer.yaml b/manifests/argocd-ingress/base/issuer.yaml new file mode 100644 index 0000000..97f0426 --- /dev/null +++ b/manifests/argocd-ingress/base/issuer.yaml @@ -0,0 +1,19 @@ +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: argo-cd -letsencrypt + namespace: argo-cd +spec: + acme: + server: https://acme-v02.api.letsencrypt.org/directory + email: reiniernel89@gmail.com + privateKeySecretRef: + name: argo-cd-letsencrypt + solvers: + - http01: + ingress: + class: nginx + podTemplate: + spec: + nodeSelector: + "kubernetes.io/os": linux \ No newline at end of file diff --git a/manifests/grafana-ingress/application.yaml b/manifests/grafana-ingress/application.yaml new file mode 100644 index 0000000..1e002f9 --- /dev/null +++ b/manifests/grafana-ingress/application.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: grafana-ingress + namespace: argo-cd +spec: + destination: + namespace: loki + server: https://kubernetes.default.svc + project: default + source: + path: manifests/grafana/base + repoURL: https://github.com/ReinierNel/devops-demo.git + targetRevision: main + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + selfHeal: true + prune: true diff --git a/manifests/grafana-ingress/base/ingress.yaml b/manifests/grafana-ingress/base/ingress.yaml new file mode 100644 index 0000000..713ff7e --- /dev/null +++ b/manifests/grafana-ingress/base/ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: grafana + namespace: loki + annotations: + cert-manager.io/issuer: grafana-letsencrypt +spec: + ingressClassName: nginx + rules: + - host: "grafana.devops-demo.reinier.co.za" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: loki-grafana + port: + number: 80 + tls: + - hosts: + - "grafana.devops-demo.reinier.co.za" + secretName: grafana-tls-secret \ No newline at end of file diff --git a/manifests/grafana-ingress/base/issuer.yaml b/manifests/grafana-ingress/base/issuer.yaml new file mode 100644 index 0000000..2131055 --- /dev/null +++ b/manifests/grafana-ingress/base/issuer.yaml @@ -0,0 +1,19 @@ +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: grafana-letsencrypt + namespace: loki +spec: + acme: + server: https://acme-v02.api.letsencrypt.org/directory + email: reiniernel89@gmail.com + privateKeySecretRef: + name: grafana-letsencrypt + solvers: + - http01: + ingress: + class: nginx + podTemplate: + spec: + nodeSelector: + "kubernetes.io/os": linux \ No newline at end of file