--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nginx-ingress-microk8s annotations: kubernetes.io/ingress.class: public ingressclass.kubernetes.io/is-default-class: "true" cert-manager.io/cluster-issuer: letsencrypt nginx.ingress.kubernetes.io/enable-modsecurity: "true" nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true" nginx.ingress.kubernetes.io/modsecurity-transaction-id: "$request_id" nginx.ingress.kubernetes.io/modsecurity-snippet: | SecRuleEngine On spec: rules: - host: "example.com" http: paths: - pathType: Prefix path: "/" backend: service: name: example-com port: number: 80 tls: - hosts: - example.com secretName: example-com-tls --- apiVersion: v1 kind: Service metadata: name: ingress spec: selector: name: nginx-ingress-microk8s ports: - name: http protocol: TCP port: 80 targetPort: 80 --- apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt spec: acme: # You must replace this email address with your own. # Let's Encrypt will use this to contact you about expiring # certificates, and issues related to your account. email: seagl2023@jpnc.info server: https://acme-v02.api.letsencrypt.org/directory privateKeySecretRef: # Secret resource that will be used to store the account's private key. name: letsencrypt-account-key # Add a single challenge solver, HTTP01 using nginx solvers: - http01: ingress: class: public