Skip to content

bartam1/kubopwebdep

Repository files navigation

Kubernetes controller for webservers

Installation:

  1. Install helm
sudo curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
  1. Add ingress-nginx repository into helm
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
  1. Update helm charts
helm repo update
  1. Install ingress-nginx
helm install quickstart ingress-nginx/ingress-nginx --set controller.service.type=NodePort --set controller.service.httpPort=32526 --set controller.service httpsPort=30523
  1. Install cert-manager
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v0.16.1/cert-manager.yaml
  1. Setup let's encrypt as a cert issuer for cert-manager (put your email address for ACME registration)
kubectl apply -f -

paste this:

apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
  namespace: cert-manager
spec:
  acme:
    # The ACME server URL
    server: https://acme-v02.api.letsencrypt.org/directory
    # Email address used for ACME registration
    email: your_email_address_here
    # Name of a secret used to store the ACME account private key
    privateKeySecretRef:
      name: letsencrypt-prod
    # Enable the HTTP-01 challenge provider
    solvers:
    - http01:
        ingress:
          class: nginx
  1. Install kubopwebdep into kubernetes
kubectl apply -f https://github.com/bartam1/kubopwebdep/releases/download/refs%2Fheads%2Fmaster/kubopwebdep.yml
  1. Add kubopwebdep resource object with your preferences
kubectl apply -f -

paste this:

apiVersion: crd.bartam/v1
kind: WebInstall
metadata:
  name: webinstall-example
spec:
  replicas: 5
  host: "your-external-hostname.example"
  image: "nginx:latest"