From bf4104c49619d975bfdb858a3b93c21a996263eb Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Thu, 25 Jul 2024 16:23:18 +0530 Subject: [PATCH] [change] Removed instructions for deploying on K8s --- README.md | 17 -- deploy/examples/kubernetes/BareMetal.yml | 50 ---- deploy/examples/kubernetes/CertManager.yml | 51 ---- deploy/examples/kubernetes/ConfigMap.yml | 49 ---- deploy/examples/kubernetes/Deployment.yml | 299 --------------------- deploy/examples/kubernetes/GoogleCloud.yml | 65 ----- deploy/examples/kubernetes/Service.yml | 136 ---------- deploy/examples/kubernetes/Storage.yml | 164 ----------- docs/ENV.md | 1 - docs/FILES.md | 58 ---- docs/kubernetes/BARE_METAL.md | 21 -- docs/kubernetes/GOOGLE_CLOUD.md | 48 ---- docs/kubernetes/KUBERNETES.md | 35 --- 13 files changed, 994 deletions(-) delete mode 100644 deploy/examples/kubernetes/BareMetal.yml delete mode 100644 deploy/examples/kubernetes/CertManager.yml delete mode 100644 deploy/examples/kubernetes/ConfigMap.yml delete mode 100644 deploy/examples/kubernetes/Deployment.yml delete mode 100644 deploy/examples/kubernetes/GoogleCloud.yml delete mode 100644 deploy/examples/kubernetes/Service.yml delete mode 100644 deploy/examples/kubernetes/Storage.yml delete mode 100644 docs/kubernetes/BARE_METAL.md delete mode 100644 docs/kubernetes/GOOGLE_CLOUD.md delete mode 100644 docs/kubernetes/KUBERNETES.md diff --git a/README.md b/README.md index 3680f42f..38019bc5 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,6 @@ This repository contains official docker images of OpenWISP. Designed with horizontal scaling, easily replicable deployments and user customization in mind. -![kubernetes](https://i.ibb.co/rGpLq4y/ss1.png) -The sample files for deployment on kubernetes are available in the `deploy/examples/kubernetes/` directory. - ## Table of contents - [Docker-OpenWISP](#docker-openwisp) @@ -21,7 +18,6 @@ The sample files for deployment on kubernetes are available in the `deploy/examp - [Deployment](#deployment) - [Quick Setup](#quick-setup) - [Compose](#compose) - - [Kubernetes](#kubernetes) - [Customization](#customization) - [Custom Django Settings](#custom-django-settings) - [Custom Styles and JavaScript](#custom-styles-and-javascript) @@ -135,19 +131,6 @@ tail -n 50 -f /opt/openwisp/autoinstall.log [Setup on docker compose](docs/QUICK_SETUP.md) is suitable for single-server setup requirements. It is quicker and requires less prior knowledge about openwisp & networking. -### Kubernetes - -Setup on kubernetes is complex and requires prior knowledge about linux systems, kubernetes, docker & openwisp. However, it provides scalability for very large networks. - -- [Bare Metal](docs/kubernetes/BARE_METAL.md) -- [Google Cloud](docs/kubernetes/GOOGLE_CLOUD.md) - -Useful commands for startup and readiness probes which are provided -by the images: - -- startup probe example: `test $(ps aux | grep -c uwsgi) -ge 2` -- readiness probe example: `python services.py uwsgi_status "127.0.0.1:8001"` - ## Customization The following commands will create the directory structure required for diff --git a/deploy/examples/kubernetes/BareMetal.yml b/deploy/examples/kubernetes/BareMetal.yml deleted file mode 100644 index 8423961a..00000000 --- a/deploy/examples/kubernetes/BareMetal.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: nfs-server -spec: - replicas: 1 - selector: - matchLabels: - role: nfs-server - template: - metadata: - labels: - role: nfs-server - spec: - nodeSelector: - volume: nfs-server - containers: - - name: nfs-server - image: openwisp/openwisp-nfs:latest - envFrom: - - configMapRef: - name: common-config - - configMapRef: - name: nfs-config - securityContext: - privileged: true - volumeMounts: - - mountPath: /exports/ - name: persistent-disk - volumes: - - name: persistent-disk - hostPath: - path: /exports/ ---- -apiVersion: v1 -kind: Service -metadata: - name: openwisp-nginx - labels: - app: openwisp-nginx -spec: - type: LoadBalancer - ports: - - name: http - port: 80 - - name: https - port: 443 - selector: - app: openwisp-nginx diff --git a/deploy/examples/kubernetes/CertManager.yml b/deploy/examples/kubernetes/CertManager.yml deleted file mode 100644 index ca205abd..00000000 --- a/deploy/examples/kubernetes/CertManager.yml +++ /dev/null @@ -1,51 +0,0 @@ -# ClusterIssuer for letsencrypt certificates by Cert-Manager -# See - https://github.com/jetstack/cert-manager ---- -apiVersion: cert-manager.io/v1alpha2 -kind: ClusterIssuer -metadata: - namespace: default - name: letsencrypt-staging -spec: - acme: - server: https://acme-staging-v02.api.letsencrypt.org/directory - email: example@example.com - privateKeySecretRef: - name: letsencrypt-staging - solvers: - - http01: - ingress: - name: openwisp-http-ingress - selector: {} ---- -apiVersion: cert-manager.io/v1alpha2 -kind: ClusterIssuer -metadata: - namespace: default - name: letsencrypt-prod -spec: - acme: - server: https://acme-v02.api.letsencrypt.org/directory - email: example@example.com - privateKeySecretRef: - name: letsencrypt-prod - solvers: - - http01: - ingress: - name: openwisp-http-ingress - selector: {} ---- -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - namespace: default - name: openwisp-tls-crt -spec: - secretName: openwisp-tls-secret - renewBefore: 12h - dnsNames: - - dashboard.openwisp.org - - api.openwisp.org - issuerRef: - name: letsencrypt-prod - kind: ClusterIssuer diff --git a/deploy/examples/kubernetes/ConfigMap.yml b/deploy/examples/kubernetes/ConfigMap.yml deleted file mode 100644 index 48646c9f..00000000 --- a/deploy/examples/kubernetes/ConfigMap.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# Pass environment variables only to the postgresql container. -apiVersion: v1 -kind: ConfigMap -metadata: - name: postgres-config - labels: - app: openwisp-postgres -data: - # If you change any value here, remember to change the values - # of common-config `DB_NAME`, `DB_USER` & `DB_PASS` as well. - POSTGRES_DB: openwisp_db - POSTGRES_USER: admin - POSTGRES_PASSWORD: admin ---- -# Pass the environment variables to all the openwisp containers. -apiVersion: v1 -kind: ConfigMap -metadata: - name: common-config -data: - DJANGO_SECRET_KEY: MY_COMPANY_SECRET_KEY - DASHBOARD_DOMAIN: dashboard.openwisp.org - API_DOMAIN: api.openwisp.org - VPN_DOMAIN: openvpn.openwisp.org - DASHBOARD_INTERNAL: dashboard-internal - API_INTERNAL: api-internal - NGINX_SERVER_NAME_HASH_BUCKET: "64" - SSL_CERT_MODE: "External" - DEBUG_MODE: "False" - TZ: "Asia/Kolkata" - POSTFIX_RELAYHOST: "[smtp.gmail.com]:587" - POSTFIX_ALLOWED_SENDER_DOMAINS: "openwisp.org gmail.com" - POSTFIX_MYNETWORKS: "10.0.0.0/8" - OPENWISP_RADIUS_FREERADIUS_ALLOWED_HOSTS: "10.0.0.0/8" - POSTFIX_RELAYHOST_USERNAME: "example@gmail.com" - POSTFIX_RELAYHOST_PASSWORD: "example" - DB_NAME: openwisp_db - DB_USER: admin - DB_PASS: admin ---- -# Pass the environment variables to nfs-server -apiVersion: v1 -kind: ConfigMap -metadata: - name: nfs-config -data: - EXPORT_DIR: "/exports" - EXPORT_OPTS: "*(rw,fsid=0,insecure,no_root_squash,no_subtree_check,sync)" diff --git a/deploy/examples/kubernetes/Deployment.yml b/deploy/examples/kubernetes/Deployment.yml deleted file mode 100644 index b3af4566..00000000 --- a/deploy/examples/kubernetes/Deployment.yml +++ /dev/null @@ -1,299 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-dashboard -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-dashboard - spec: - restartPolicy: Always - containers: - - name: openwisp-dashboard - image: openwisp/openwisp-dashboard:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - volumeMounts: - - name: openwisp-static-data - mountPath: /opt/openwisp/static - - name: openwisp-media-data - mountPath: /opt/openwisp/media - - name: openwisp-private-storage-data - mountPath: /opt/openwisp/private - readinessProbe: - exec: - command: - - cat - - /opt/openwisp/uwsgi.pid - initialDelaySeconds: 60 - periodSeconds: 30 - volumes: - - name: openwisp-media-data - persistentVolumeClaim: - claimName: media-pv-claim - - name: openwisp-private-storage-data - persistentVolumeClaim: - claimName: private-storage-pv-claim - - name: openwisp-static-data - persistentVolumeClaim: - claimName: static-pv-claim ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-api -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-api - spec: - restartPolicy: Always - containers: - - name: openwisp-api - image: openwisp/openwisp-api:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - readinessProbe: - exec: - command: - - cat - - /opt/openwisp/uwsgi.pid - initialDelaySeconds: 60 - periodSeconds: 30 ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-websocket -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-websocket - spec: - restartPolicy: Always - containers: - - name: openwisp-websocket - image: openwisp/openwisp-websocket:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-nginx -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-nginx - spec: - restartPolicy: Always - containers: - - name: openwisp-nginx - image: openwisp/openwisp-nginx:latest - ports: - - containerPort: 443 - - containerPort: 80 - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - volumeMounts: - - name: openwisp-static-data - mountPath: /opt/openwisp/public/static - readOnly: true - - name: openwisp-media-data - mountPath: /opt/openwisp/public/media - readOnly: true - - name: openwisp-private-storage-data - mountPath: /opt/openwisp/private - readOnly: true - readinessProbe: - httpGet: - path: /status - port: 80 - initialDelaySeconds: 15 - periodSeconds: 5 - failureThreshold: 2 - successThreshold: 2 - volumes: - - name: openwisp-static-data - persistentVolumeClaim: - claimName: static-pv-claim - - name: openwisp-media-data - persistentVolumeClaim: - claimName: media-pv-claim ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-postgres -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-postgres - spec: - restartPolicy: Always - containers: - - name: openwisp-postgres - image: mdillon/postgis:10-alpine - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - - configMapRef: - name: postgres-config - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: openwisp-postgres-data - volumes: - - name: openwisp-postgres-data - persistentVolumeClaim: - claimName: postgres-pv-claim ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-postfix -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-postfix - spec: - restartPolicy: Always - containers: - - name: openwisp-postfix - image: openwisp/openwisp-postfix:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - volumeMounts: - - mountPath: /etc/ssl/mail - name: openwisp-certs-data - volumes: - - name: openwisp-certs-data - persistentVolumeClaim: - claimName: certs-pv-claim ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-freeradius -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-freeradius - spec: - restartPolicy: Always - containers: - - name: openwisp-freeradius - image: openwisp/openwisp-freeradius:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-openvpn -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-openvpn - spec: - restartPolicy: Always - containers: - - name: openwisp-openvpn - image: openwisp/openwisp-openvpn:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - securityContext: - capabilities: - add: ["NET_ADMIN"] ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-celery -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-celery - spec: - containers: - - name: openwisp-celery - image: openwisp/openwisp-dashboard:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - env: - - name: MODULE_NAME - value: celery ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: openwisp-celerybeat -spec: - replicas: 1 - template: - metadata: - labels: - app: openwisp-celerybeat - spec: - containers: - - name: openwisp-celerybeat - image: openwisp/openwisp-dashboard:latest - imagePullPolicy: Always - envFrom: - - configMapRef: - name: common-config - env: - - name: MODULE_NAME - value: celerybeat ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: redis -spec: - replicas: 1 - template: - metadata: - labels: - app: redis - spec: - restartPolicy: Always - containers: - - name: redis - image: redis:alpine - imagePullPolicy: Always diff --git a/deploy/examples/kubernetes/GoogleCloud.yml b/deploy/examples/kubernetes/GoogleCloud.yml deleted file mode 100644 index d8e9b04e..00000000 --- a/deploy/examples/kubernetes/GoogleCloud.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: nfs-server -spec: - replicas: 1 - selector: - matchLabels: - role: nfs-server - template: - metadata: - labels: - role: nfs-server - spec: - containers: - - name: nfs-server - image: openwisp/openwisp-nfs:latest - envFrom: - - configMapRef: - name: common-config - - configMapRef: - name: nfs-config - securityContext: - privileged: true - volumeMounts: - - mountPath: /exports/ - name: persistent-disk - volumes: - - name: persistent-disk - gcePersistentDisk: - pdName: openwisp-disk - fsType: ext4 ---- -apiVersion: v1 -kind: Service -metadata: - name: openwisp-nginx - labels: - app: openwisp-nginx -spec: - type: NodePort - ports: - - name: http - port: 80 - - name: https - port: 443 - selector: - app: openwisp-nginx ---- -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: openwisp-http-ingress - annotations: - kubernetes.io/ingress.global-static-ip-name: openwisp-http-loadbalancer-ip - labels: - app: openwisp-nginx -spec: - rules: - - http: - paths: - - backend: - serviceName: openwisp-nginx - servicePort: 80 diff --git a/deploy/examples/kubernetes/Service.yml b/deploy/examples/kubernetes/Service.yml deleted file mode 100644 index beee2ff0..00000000 --- a/deploy/examples/kubernetes/Service.yml +++ /dev/null @@ -1,136 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: dashboard - labels: - app: openwisp-dashboard -spec: - type: ClusterIP - ports: - - port: 8000 - selector: - app: openwisp-dashboard ---- -apiVersion: v1 -kind: Service -metadata: - name: api - labels: - app: openwisp-api -spec: - type: ClusterIP - ports: - - port: 8001 - selector: - app: openwisp-api ---- -apiVersion: v1 -kind: Service -metadata: - name: websocket - labels: - app: openwisp-websocket -spec: - type: ClusterIP - ports: - - port: 8002 - selector: - app: openwisp-websocket ---- -apiVersion: v1 -kind: Service -metadata: - name: postgres - labels: - app: openwisp-postgres -spec: - type: ClusterIP - ports: - - port: 5432 - selector: - app: openwisp-postgres ---- -apiVersion: v1 -kind: Service -metadata: - name: redis - labels: - app: redis -spec: - type: ClusterIP - ports: - - port: 6379 - selector: - app: redis ---- -apiVersion: v1 -kind: Service -metadata: - name: postfix - labels: - app: openwisp-postfix -spec: - type: ClusterIP - ports: - - port: 25 - selector: - app: openwisp-postfix ---- -apiVersion: v1 -kind: Service -metadata: - name: openvpn -spec: - type: LoadBalancer - selector: - app: openwisp-openvpn - ports: - - name: vpn - protocol: UDP - port: 1194 - targetPort: 1194 ---- -apiVersion: v1 -kind: Service -metadata: - name: freeradius -spec: - type: LoadBalancer - selector: - app: openwisp-freeradius - ports: - - name: auth - protocol: UDP - port: 1812 - targetPort: 1812 - - name: acct - protocol: UDP - port: 1813 - targetPort: 1813 ---- -apiVersion: v1 -kind: Service -metadata: - name: dashboard-internal - labels: - app: openwisp-nginx -spec: - type: ClusterIP - ports: - - port: 80 - selector: - app: openwisp-nginx ---- -apiVersion: v1 -kind: Service -metadata: - name: api-internal - labels: - app: openwisp-nginx -spec: - type: ClusterIP - ports: - - port: 80 - selector: - app: openwisp-nginx diff --git a/deploy/examples/kubernetes/Storage.yml b/deploy/examples/kubernetes/Storage.yml deleted file mode 100644 index 993ab0ea..00000000 --- a/deploy/examples/kubernetes/Storage.yml +++ /dev/null @@ -1,164 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: nfs-server -spec: - clusterIP: 10.0.10.240 - ports: - - name: udp-nfs - port: 2049 - protocol: UDP - - name: udp-rpcbind - port: 111 - protocol: UDP - - name: udp-statdp - port: 32765 - protocol: UDP - - name: udp-statdo - port: 32766 - protocol: UDP - - name: udp-mountd - port: 32767 - protocol: UDP - - name: udp-nlockmgr - port: 32768 - protocol: UDP - - name: tcp-nfs - port: 2049 - protocol: TCP - - name: tcp-rpcbind - port: 111 - protocol: TCP - - name: tcp-statdp - port: 32765 - protocol: TCP - - name: tcp-statdo - port: 32766 - protocol: TCP - - name: tcp-mountd - port: 32767 - protocol: TCP - - name: tcp-nlockmgr - port: 32768 - protocol: TCP - selector: - role: nfs-server ---- -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: openwisp-storage-class -provisioner: example.com/nfs -reclaimPolicy: Retain -allowVolumeExpansion: true ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: postgres-volume -spec: - storageClassName: openwisp-storage-class - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - nfs: - server: 10.0.10.240 - path: "/exports/postgres/" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: media-volume -spec: - storageClassName: openwisp-storage-class - capacity: - storage: 5Gi - accessModes: - - ReadWriteMany - nfs: - server: 10.0.10.240 - path: "/exports/media/" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: static-volume -spec: - storageClassName: openwisp-storage-class - capacity: - storage: 100Mi - accessModes: - - ReadWriteMany - nfs: - server: 10.0.10.240 - path: "/exports/static/" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: certs-volume -spec: - storageClassName: openwisp-storage-class - capacity: - storage: 50Mi - accessModes: - - ReadWriteMany - nfs: - server: 10.0.10.240 - path: "/exports/postfix/" ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: postgres-pv-claim - labels: - app: openwisp-postgres -spec: - volumeName: postgres-volume - storageClassName: openwisp-storage-class - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: media-pv-claim -spec: - volumeName: media-volume - storageClassName: openwisp-storage-class - accessModes: - - ReadWriteMany - resources: - requests: - storage: 5Gi ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: static-pv-claim -spec: - volumeName: static-volume - storageClassName: openwisp-storage-class - accessModes: - - ReadWriteMany - resources: - requests: - storage: 100Mi ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: certs-pv-claim -spec: - volumeName: certs-volume - storageClassName: openwisp-storage-class - accessModes: - - ReadWriteMany - resources: - requests: - storage: 50Mi diff --git a/docs/ENV.md b/docs/ENV.md index 10250aeb..a15324e6 100644 --- a/docs/ENV.md +++ b/docs/ENV.md @@ -8,7 +8,6 @@ The OpenWISP docker images are created with customization in mind. You can simply change the environment variables to change the containers and trailer them to your needs. - `docker compose`: You can simply change the values in `.env` file. -- `kubernetes`: You need to create `ConfigMap` to change the environment variables. An example is present in `deploy/examples/kubernetes/` directory. Following are the options that can be changed. The list is divided in following sections: diff --git a/docs/FILES.md b/docs/FILES.md index 56f56f7b..03333b93 100644 --- a/docs/FILES.md +++ b/docs/FILES.md @@ -26,35 +26,6 @@ For some of the images, if you want additional customization options, you can mo PATH/TO/YOUR/FILE:/etc/nginx/nginx.conf ... ``` - -### Kubernetes - -1. Create nginx your configuration file. Files in `build/openwisp-nginx/` may by helpful. -2. Set `NGINX_CUSTOM_FILE` to `True`. -3. Create configmap from file: `kubectl create configmap nginx-file-config --from-file PATH/TO/YOUR/FILE` -4. Add your config to `openwisp-nginx` object: - -```yaml - ... - metadata: - name: openwisp-nginx - spec: - ... - spec: - containers: - ... - volumeMounts: - ... - - name: "nginx-file-config" - mountPath: "/etc/nginx/nginx.conf" - subPath: "nginx.conf" - volumes: - ... - - name: "nginx-file-config" - configMap: - name: "nginx-file-config" -``` - ## Freeradius Note: `/etc/raddb/clients.conf`, `/etc/raddb/radiusd.conf`, `/etc/raddb/sites-enabled/default`, `/etc/raddb/mods-enabled/`, `/etc/raddb/mods-available/` are the default files you may want to overwrite and you can find all of default files in `build/openwisp_freeradius/raddb`. The following are examples for including custom `radiusd.conf` and `sites-enabled/default` files. @@ -73,32 +44,3 @@ Note: `/etc/raddb/clients.conf`, `/etc/raddb/radiusd.conf`, `/etc/raddb/sites-en PATH/TO/YOUR/DEFAULT:/etc/raddb/sites-enabled/default ... ``` - -### Kubernetes - -1. Create configmap from file: `kubectl create configmap freeradius-dir-files --from-file PATH/TO/YOUR/RADIUSD --from-file PATH/TO/YOUR/DEFAULT` -2. Add your config to `openwisp-freeradius` object: - -```yaml - ... - metadata: - name: openwisp-freeradius - spec: - ... - spec: - containers: - ... - volumeMounts: - ... - - name: "freeradius-dir-files" - mountPath: "/etc/raddb/radiusd.conf" - subPath: "radiusd.conf" - - name: "freeradius-dir-files" - mountPath: "/etc/raddb/sites-enabled/default" - subPath: "default" - volumes: - ... - - name: "freeradius-dir-files" - configMap: - name: "freeradius-dir-files" -``` diff --git a/docs/kubernetes/BARE_METAL.md b/docs/kubernetes/BARE_METAL.md deleted file mode 100644 index 38791ddf..00000000 --- a/docs/kubernetes/BARE_METAL.md +++ /dev/null @@ -1,21 +0,0 @@ -# Bare Metal Kubernetes - -[![Gitter](https://img.shields.io/gitter/room/openwisp/general.svg)](https://gitter.im/openwisp/dockerize-openwisp) -[![Support](https://img.shields.io/badge/support-orange.svg)](http://openwisp.org/support.html) - -The following are steps of a sample deployment on a kubernetes cluster. All the files are present in `deploy/examples/kubernetes/` directory of this repository. -The following assumes the reader knows basics of kubernetes & docker. -The steps where performed on master version-1.14. - -1. [Setup a Kubernetes Cluster](https://blog.alexellis.io/kubernetes-in-10-minutes/). - -2. Make sure to install `nfs-common` on all your nodes. - -3. Add label to the node where you want to save the data: `kubectl label nodes volume=nfs-server` - -4. Setup [Metallb](https://metallb.universe.tf/) on your cluster. (Tested with `v0.8.3`) - -5. Create BareMetal OpenWISP kubernetes requirements: `kubectl create -f BareMetal.yml` - -6. Your system is ready, now you can move to the installation of OpenWISP on - kubernetes [here](KUBERNETES.md). diff --git a/docs/kubernetes/GOOGLE_CLOUD.md b/docs/kubernetes/GOOGLE_CLOUD.md deleted file mode 100644 index ebfe8b53..00000000 --- a/docs/kubernetes/GOOGLE_CLOUD.md +++ /dev/null @@ -1,48 +0,0 @@ -# Google Kubernetes Engine - -[![Gitter](https://img.shields.io/gitter/room/openwisp/general.svg)](https://gitter.im/openwisp/dockerize-openwisp) -[![Support](https://img.shields.io/badge/support-orange.svg)](http://openwisp.org/support.html) - -The following are steps of a sample deployment on a kubernetes cluster on Google Kubernetes Engine. All the files are present in `deploy/examples/kubernetes/` directory of this repository. -The following assumes the reader knows basics of kubernetes, docker & Google Cloud Platform. -The steps are tested on master version-1.14.9 - -1. Setup External IP: Create a global static IP adress named `openwisp-http-loadbalancer-ip`. - -2. Create a compute disk named `openwisp-disk`. This will be your storage disk which will store all the persistent files like user uploaded files and user database. - -3. Create your cluster (Minimum 4 instances of g1-small are required for the deployment) - -4. You will need "Compute Engine API - Backend services" to be atleast 7 for this deployment, please request more quota if required. (By default backend quota is 5) - -5. Create GoogleCloud OpenWISP kubernetes requirements: `kubectl create -f GoogleCloud.yml` - -6. Your system is ready, now you can move to the installation of OpenWISP on kubernetes [here](KUBERNETES.md). - -7. [Setup Certificate manager](https://cert-manager.io/docs/installation/kubernetes/#installing-with-regular-manifests) for SSL certificates: - -```bash -kubectl create namespace cert-manager -kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.12.0/cert-manager.yaml -``` - -8. In `CertManager.yml`: Change the email address & the domain name and create `kubectl create -f CertManager.yml`. - -9. When the certificate is ready(check: `kubectl get certificate`), patch the Ingress with tls information: - -```bash -kubectl patch ingress/openwisp-http-ingress \ - --patch '{ - "spec": { - "tls": [ - { - "hosts": [ - "dasboard.openwisp.org", - "api.openwisp.org", - ], - "secretName": "openwisp-tls-secret" - } - ] - } - }' -``` diff --git a/docs/kubernetes/KUBERNETES.md b/docs/kubernetes/KUBERNETES.md deleted file mode 100644 index 1b2aa9d5..00000000 --- a/docs/kubernetes/KUBERNETES.md +++ /dev/null @@ -1,35 +0,0 @@ -# Common Kubernetes Setup - -[![Gitter](https://img.shields.io/gitter/room/openwisp/general.svg)](https://gitter.im/openwisp/dockerize-openwisp) -[![Support](https://img.shields.io/badge/support-orange.svg)](http://openwisp.org/support.html) - -1. Configure your domain with following A records, point your static IP to: - -``` - dashboard. --Public-IP-- - api. --Public-IP-- -``` - -2. (Optional) Postfix mail relay server (Example: Mailjet, Pepipost, Sendgrid, Mandrill) - -3. Customization: - - - In `ConfigMap.yml`: You need to change the values according to your cluster. You can set any of the variables from the [list here](docs/ENV.md) to trailor setup to your requirements. - -4. Apply to Kubernetes Cluster: - -```bash -kubectl apply -f ConfigMap.yml -kubectl apply -f Storage.yml -kubectl apply -f Service.yml -kubectl apply -f Deployment.yml -``` - -5. Each Loadbalancer creates/assigns an IP address, add it to your DNS: - -``` -freeradius. -LoadBalancer-IP- -openvpn. -LoadBalancer-IP- -``` - -**NOTE: Containers will take a little while to start working. You can see the status on the Web UI or on CLI by `kubectl get all` command.**