Skip to content

Instantly share code, notes, and snippets.

@bbriggs
Created September 1, 2021 22:05
Show Gist options
  • Save bbriggs/3a109d8b139050ccc1fcd74b8f8ce1f6 to your computer and use it in GitHub Desktop.
Save bbriggs/3a109d8b139050ccc1fcd74b8f8ce1f6 to your computer and use it in GitHub Desktop.
Privatebin as a subdirectory with istio
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: fraq-tls
namespace: istio-system
spec:
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
secretName: fraq-tls
commonName: fraq.io
dnsNames:
- fraq.io
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: fraq-io
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- 'fraq.io'
- '*.fraq.io'
tls:
httpsRedirect: true # sends 301 redirect for http requests
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- 'fraq.io'
- '*.fraq.io'
tls:
mode: SIMPLE
credentialName: fraq-tls
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: privatebin
namespace: privatebin
spec:
test:
enable: false
values:
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-prod-fraq"
cert-manager.io/acme-challenge-type: http01
hosts:
- host: "bin.fraq.io"
paths:
- "/"
tls: # I think I could probably leave this off? not sure
- hosts:
- bin.fraq.io
secretName: privatebin-tls
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: privatebin
namespace: privatebin
spec:
releaseName: privatebin
chart:
spec:
chart: privatebin
sourceRef:
kind: HelmRepository
name: privatebin
namespace: flux-system
interval: 5m
install:
remediation:
retries: 3
values:
image:
repository: privatebin/nginx-fpm-alpine
tag: edge
ingress:
enabled: false
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: privatebin
namespace: privatebin
spec:
hosts:
- fraq.io
gateways:
- istio-system/fraq-io
http:
- name: "bin-redirect"
match:
- uri:
exact: /bin
redirect:
uri: /bin/
authority: fraq.io
- name: "bin-rewrite"
match:
- uri:
prefix: "/bin/"
rewrite:
uri: "/"
route:
- destination:
host: privatebin.privatebin.svc.cluster.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment