Skip to content

Commit

Permalink
Added pregenerated secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
wtripp180901 committed Jul 6, 2023
1 parent 8d7d035 commit 69b971d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ The Helm chart will create the following named volumes:
## Configuring the Cluster

All config files in `slurm-cluster-chart/files` will be mounted into the container to configure their respective services on startup. The `authorized_keys` file contains authorised public keys for the user `rocky`, add your public key to access the cluster. Note that changes to these files will not all be propagated to existing deployments (see "Reconfiguring the Cluster").
Additional parameters can be found in the `values.yaml` file, which will be applied on a Helm chart deployment. Note that some of these values, such as `encodedMungeKey` will also not propagate until the cluster is restarted (see Reconfiguring the Cluster).
Additional parameters can be found in the `values.yaml` file, which will be applied on a Helm chart deployment. Note that some of these values, such as `encodedMungeKey` will also not propagate until the cluster is restarted (see "Reconfiguring the Cluster").

## Deploying the Cluster

On initial deployment ONLY, run
```console
./generate-secrets.sh
```
This generates a set of secrets. If these need to be regenerated, see "Reconfiguring the Cluster"

After configuring `kubectl` with the appropriate `kubeconfig` file, deploy the cluster using the Helm chart:
```console
helm install <deployment-name> slurm-cluster-chart
Expand Down Expand Up @@ -74,8 +80,27 @@ normal* up 5-00:00:00 2 idle c[1-2]

## Reconfiguring the Cluster

### Changes to config files

To guarantee changes to config files are propagated to the cluster, use
```console
kubectl rollout restart deployment <deployment-names>
```
Generally restarts to `slurmd`, `slurmctld`, `login` and `slurmdbd` will be required
Generally restarts to `slurmd`, `slurmctld`, `login` and `slurmdbd` will be required

### Changes to secrets

Regenerate secrets by rerunning
```console
./generate-secrets.sh
```
Some secrets are persisted in volumes, so cycling them requires a full teardown and reboot of the volumes and pods which these volumes are mounted on. Run
```console
kubectl delete deployment mysql
kubectl delete pvc var-lib-mysql
helm upgrade <deployment-name> slurm-cluster-chart
```
and then restart the other dependent deployments to propagate changes:
```console
kubectl rollout restart deployment slurmd slurmctld login slurmdbd
```
13 changes: 13 additions & 0 deletions generate-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

kubectl create secret generic database-auth-secret \
--dry-run=client \
--from-literal=password=$(tr -dc 'A-Za-z0-9' </dev/urandom | head -c 32) \
-o yaml | \
kubectl apply -f -

kubectl create secret generic munge-key-secret \
--dry-run=client \
--from-literal=munge.key=$(dd if=/dev/urandom bs=1 count=1024 2>/dev/null | base64 -w 0) \
-o yaml | \
kubectl apply -f -
7 changes: 0 additions & 7 deletions slurm-cluster-chart/templates/database-auth-secret.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions slurm-cluster-chart/templates/munge-key-secret.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions slurm-cluster-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ nfs:

sqlImage: mariadb:10.10

databaseAuthentication:
password: password

databaseStorage: 100Mi

encodedMungeKey: QpMuwnFPV/n8vIomm6rfxEKOx/ORVIJrnKCkK/niD636mtQTJwWXrWiv3V6E7KNlsDXMs5eRcfBW3mlZuOrPfKCoAHfRx6RcdbqkmjifA4N2pfZnyBsMh6La5HIZP1Bi7a7Tnjw2QxheNLgCuFQqjNzpFpFwxDtjcutDw7QfG4vNwqEHgK9RnCwNi6kXcavgSpue4iT/zXjoq7CnIto/QgFOyjSvCl7xN9UMWAEJdyocXW9CnzImnvGjqeg8Aie2W0/d6MvxBA8dU7DqEYJriSaynj9ZjtTrz4HbK+pYSQr7CdWsFJKLAJhvptbu1TLhA2dhHP3Uf1hEYlFyCchoZt3IzM/kdcSqaG//57fsU5bYukXp8hyBNeV5o4FJajcvuOR09ix0Gnrq+alOoRXKL6EASaUK6HLd/PkUVuns9e22PpmJ4Z1zro5Ggtzufh8Blu9CxE3BExKkbqwgTFfLZ39d/dAR4fKrHV94K1FeT54tQkXb7MMFWK+Piz0p7qezDWHzd77BcgGjP0tow9FXq942zdRxJK+089abQUdXtGw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