diff --git a/INSTALL/README.md b/INSTALL/README.md index 2f37d01..9063699 100644 --- a/INSTALL/README.md +++ b/INSTALL/README.md @@ -32,19 +32,23 @@ docker-compose-exota-milter-1 | 2022-06-06 21:54:04,511: INFO 140529821924168 S ``` ## kubernetes +By default this example installs the Exota-milter workload into the `exota-milter` namespace, which must be created in advance: ``` -~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl apply -f 01_config-map.yaml +kubectl create ns exota-milter + +namespace/exota-milter created +``` +Deploy stateless workload (type `Deployment`) with `kustomize`: +``` +~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl apply -k . + configmap/exota-milter-policy-cmap created - -~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl apply -f 02_deployment.yaml -deployment.apps/exota-milter created - -~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl apply -f 03_service.yaml service/exota-milter created +deployment.apps/exota-milter created ``` -Check status of pods, replica-sets and service +Check status of pods, replica-sets and cluster internal service: ``` -~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl -n devel get all +~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl -n exota-milter get all NAME READY STATUS RESTARTS AGE pod/exota-milter-547dbccd8b-j69mn 1/1 Running 0 64s pod/exota-milter-547dbccd8b-7hl6c 1/1 Running 0 64s @@ -59,9 +63,9 @@ deployment.apps/exota-milter 3/3 3 3 64s NAME DESIRED CURRENT READY AGE replicaset.apps/exota-milter-547dbccd8b 3 3 3 65s ``` -Get logs of one of the pods: +Get logs of the pods: ``` -~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl -n devel logs exota-milter-547dbccd8b-7hl6c +~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl -n exota-milter logs -l app=exota-milter 2022-06-06 21:57:03,515: INFO Logger initialized 2022-06-06 21:57:03,515: INFO ENV[MILTER_NAME]: exota-milter 2022-06-06 21:57:03,515: INFO ENV[MILTER_SOCKET]: inet:4321@127.0.0.1 @@ -80,6 +84,18 @@ Get logs of one of the pods: 2022-06-06 21:57:03,516: INFO JSON policy backend initialized 2022-06-06 21:57:03,516: INFO Startup exota-milter@socket: inet:4321@127.0.0.1 ``` +Remove workload from cluster: +``` +~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl delete -k . + +configmap "exota-milter-policy-cmap" deleted +service "exota-milter" deleted +deployment.apps "exota-milter" deleted + +~/src/ExOTA-Milter/INSTALL/kubernetes$ kubectl delete ns exota-milter + +namespace "exota-milter" deleted +``` ## systemd If you do not want to run the ExOTA-Milter in a containerized environment but directly as a systemd-unit/-service, first you´ll need to install all necessary python and build dependencies. Start with build deps (examples refere to ubuntu/debian): diff --git a/INSTALL/kubernetes/01_config-map.yaml b/INSTALL/kubernetes/01_config-map.yaml index c75507d..0bea43e 100644 --- a/INSTALL/kubernetes/01_config-map.yaml +++ b/INSTALL/kubernetes/01_config-map.yaml @@ -3,7 +3,6 @@ kind: ConfigMap apiVersion: v1 metadata: name: exota-milter-policy-cmap - namespace: devel data: exota-milter-policy: | { diff --git a/INSTALL/kubernetes/02_deployment.yaml b/INSTALL/kubernetes/02_deployment.yaml index 9212595..4e6e791 100644 --- a/INSTALL/kubernetes/02_deployment.yaml +++ b/INSTALL/kubernetes/02_deployment.yaml @@ -2,7 +2,6 @@ kind: Deployment apiVersion: apps/v1 metadata: - namespace: devel name: exota-milter labels: app: exota-milter diff --git a/INSTALL/kubernetes/03_service.yaml b/INSTALL/kubernetes/03_service.yaml index 4c79055..5f9a13f 100644 --- a/INSTALL/kubernetes/03_service.yaml +++ b/INSTALL/kubernetes/03_service.yaml @@ -2,7 +2,6 @@ apiVersion: v1 kind: Service metadata: - namespace: devel name: exota-milter spec: selector: diff --git a/INSTALL/kubernetes/kustomization.yaml b/INSTALL/kubernetes/kustomization.yaml new file mode 100644 index 0000000..702af4a --- /dev/null +++ b/INSTALL/kubernetes/kustomization.yaml @@ -0,0 +1,7 @@ +namespace: exota-milter +commonLabels: + app: exota-milter +resources: +- 01_config-map.yaml +- 02_deployment.yaml +- 03_service.yaml \ No newline at end of file