For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
| #!/bin/bash | |
| for l in $(az aks list | jq -r '.[] | "\(.id),\(.nodeResourceGroup)"'); do | |
| id=$(echo $l | cut -d, -f1) | |
| rg=$(echo $l | cut -d, -f2) | |
| if [[ $rg == "null" ]]; then continue; fi | |
| if [[ "$(az group exists -g $rg)" == "false" ]]; then continue; fi | 
| openssl req \ | |
| -newkey rsa:2048 \ | |
| -x509 \ | |
| -nodes \ | |
| -keyout server.key \ | |
| -new \ | |
| -out server.crt \ | |
| -subj /CN=example.com \ | |
| -reqexts SAN \ | |
| -extensions SAN \ | 
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: nginx | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: nginx | |
| replicas: 2 # tells deployment to run 2 pods matching the template | |
| template: | 
| for i in {1..100}; do | |
| curl -w "time_total:%{time_total}\ntime_namelookup:%{time_namelookup}\ntime_connect:%{time_connect}\ntime_appconnect:%{time_appconnect}\ntime_pretransfer:%{time_pretransfer}\ntime_starttransfer:%{time_starttransfer}\n" -s $URL --insecure -o /dev/null | |
| echo | |
| sleep 5 | |
| done |