Skip to content

Instantly share code, notes, and snippets.

@riskiwah
Last active December 10, 2020 10:56
Show Gist options
  • Save riskiwah/ee16cc76d4c977b882d12d931586558f to your computer and use it in GitHub Desktop.
Save riskiwah/ee16cc76d4c977b882d12d931586558f to your computer and use it in GitHub Desktop.
Daily-k8s-dev

Ingress and Cert Manager:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager.yaml

Issuer:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: test-selfsigned
spec:
  selfSigned: {}

Example:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: gatau-ingress-stag
  namespace: staging
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: "test-selfsigned"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: gatau-svc-stag
          servicePort: http
    host: gatau.blah.local
  tls:
  - secretName: https-cert
    hosts:
    - gatau.blah.local
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
- role: worker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment