Skip to content

Instantly share code, notes, and snippets.

@ohanetz
Last active June 25, 2020 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohanetz/bf2c4ef9cc4fe47cb366de59cd37c53c to your computer and use it in GitHub Desktop.
Save ohanetz/bf2c4ef9cc4fe47cb366de59cd37c53c to your computer and use it in GitHub Desktop.
Secure access to Kubernetes deployment endpoints on Amazon EKS
{
"Version": "2012–10–17",
"Statement": [
{
"Effect": "Allow",
"Action": "route53:GetChange",
"Resource": "arn:aws:route53:::change/*"
},
{
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets",
"route53:ListResourceRecordSets"
],
"Resource": "arn:aws:route53:::hostedzone/YOUR_HOSTED_ZONE_ID"
}
]
}
apiVersion: v1
kind: Secret
metadata:
name: letsencrypt-issuer-secret
namespace: cert-manager
data:
YOUR_AWS_USER: YOUR_BASE64_ENCODED_SECRET_ACCESS_KEY
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-issuer
namespace: cert-manager
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: you@yourdomain.com
privateKeySecretRef:
name: letsencrypt-issuer
solvers:
- selector:
dnsZones:
- "yourdomain.com"
dns01:
route53:
region: YOUR_AWS_REGION
hostedZoneID: YOUR_HOSTED_ZONE_ID
accessKeyID: YOUR_AWS_ACCESS_KEY_ID
secretAccessKeySecretRef:
name: letsencrypt-issuer-secret
key: YOUR_AWS_USER
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-issuer"
spec:
tls:
- hosts:
- yourhost.yourdomain.com
secretName: my-ingress-tls
rules:
- host: yourhost.yourdomain.com
http:
paths:
- path: /
backend:
serviceName: YOUR_ENDPOINT_SERVICE_NAME
servicePort: YOUR_ENDPOINT_SERVICE_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment