Skip to content

opszero/terraform-helm-kubespot

Repository files navigation

Kubespot (Helm)

  • cert-manager
  • datadog
  • keda
  • nginx
  • prometheus
  • grafana
  • grafana loki
  • kubecost

Configuration

cert-manager

To use cert-manager add the following annotation to your Ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    # add an annotation indicating the issuer to use.
    cert-manager.io/cluster-issuer: letsencrypt
  name: myIngress
  namespace: myIngress
spec:
  tls:
    - hosts:
        - https-example.foo.com
      secretName: testsecret-tls
  rules:
    - host: https-example.foo.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: service1
                port:
                  number: 80

Grafana

Grafana is installed on a ClusterIP use the following to open it locally.

kubectl port-forward -n grafana service/grafana 6891:80
open https://localhost:6891

Username: opszero
Password: opszero

Deployment

terraform init
terraform plan
terraform apply -auto-approve

Teardown

terraform destroy -auto-approve

Providers

Name Version
aws n/a
helm n/a
null n/a
random n/a

Inputs

Name Description Type Default Required
cert_manager_email Your email address to use for cert manager any null no
cert_manager_leader_election_namespace The namespace used for the leader election lease. Change to cert-manager for GKE Autopilot string "cert-manager" no
cert_manager_resources n/a
map(object({
cpu = string
memory = string
}))
null no
cert_manager_version n/a string "1.15.1" no
datadog_api_key The API key for datadog string "" no
datadog_values Values for datadog helm chart string "" no
datadog_values_extra List of extra values for datadog helm chart list [] no
grafana_admin_password The Password of Grafana for login Dashboard string "" no
grafana_admin_user The User name of Grafana for login Dashboard string "opszero" no
grafana_datasources n/a
list(object({
name = string
type = string
url = string
access = string
isDefault = bool
}))
[] no
grafana_efs_enable Enable EFS storage for Grafana bool false no
grafana_efs_storage_class_name If EFS is needed pass EFS storage class, but make sure efs and efs driver deployed string "" no
grafana_enabled Enable grafana bool false no
grafana_extra_yml Grafana Datasources as Yaml any null no
grafana_google_auth_client_id Add Google Auth client id string "" no
grafana_google_auth_client_secret Add Google Auth client secret string "" no
grafana_ingress_enabled Enable grafana ingress bool false no
grafana_ingress_hosts Add grafana ingress hosts list [] no
grafana_loki_bucket_name Name for the S3 bucket string "" no
grafana_loki_enabled Enable grafana loki bool false no
grafana_loki_yml_file n/a any null no
grafana_persistence_storage Enable persistence storage for Grafana bool false no
kubecost_enabled n/a bool false no
nginx_max_replicas Maximum number of Nginx Replicas number 11 no
nginx_min_replicas Minimum number of Nginx Replicas number 2 no
nginx_name Release name for the installed helm chart string "nginx" no
nginx_yml_file n/a any null no
otel_yml_file n/a any null no
prometheus_additional_scrape_configs Add additional scrape for configuration for prometheus if needed
list(object({
job_name = string
targets = list(string)
scrape_interval = string
metrics_path = string
}))
[] no
prometheus_enabled Enable prometheus bool true no
prometheus_persistence_storage Enable persistence storage for Prometheus bool false no
pushgateway_ingress_host List of hosts for prometheus push gateway ingress list [] no
storage_class Storage Class to use for Persistence string "gp2" no

Resources

Name Type
aws_s3_bucket.s3_loki resource
aws_s3_bucket_public_access_block.s3_loki resource
aws_s3_bucket_server_side_encryption_configuration.s3_loki resource
aws_s3_bucket_versioning.s3_loki resource
helm_release.cert-manager resource
helm_release.datadog resource
helm_release.grafana resource
helm_release.keda resource
helm_release.kubecost resource
helm_release.loki resource
helm_release.nginx resource
helm_release.opentelemetry_collector resource
helm_release.prometheus resource
null_resource.cert-manager-cluster-issuer resource
random_password.grafana_admin_password resource

Outputs

Name Description
grafana_admin_password n/a

🚀 Built by opsZero!

Since 2016 opsZero has been providing Kubernetes expertise to companies of all sizes on any Cloud. With a focus on AI and Compliance we can say we seen it all whether SOC2, HIPAA, PCI-DSS, ITAR, FedRAMP, CMMC we have you and your customers covered.

We provide support to organizations in the following ways:

We do this with a high-touch support model where you:

  • Get access to us on Slack, Microsoft Teams or Email
  • Get 24/7 coverage of your infrastructure
  • Get an accelerated migration to Kubernetes

Please schedule a call if you need support.