summaryrefslogtreecommitdiffstats
path: root/kubernetes
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes')
-rw-r--r--kubernetes/aaf/components/aaf-cert-service/resources/certServiceClient-keystore.jksbin4087 -> 4067 bytes
-rw-r--r--kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.jksbin4126 -> 4110 bytes
-rw-r--r--kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.p12bin4691 -> 4683 bytes
-rw-r--r--kubernetes/aaf/components/aaf-cert-service/resources/root.crt61
-rw-r--r--kubernetes/aaf/components/aaf-cert-service/resources/truststore.jksbin1722 -> 1730 bytes
-rw-r--r--kubernetes/common/mariadb-galera/resources/post-upgrade-script.sh120
-rw-r--r--kubernetes/common/mariadb-galera/templates/job.yaml2
-rw-r--r--kubernetes/common/network-name-gen/templates/deployment.yaml5
8 files changed, 155 insertions, 33 deletions
diff --git a/kubernetes/aaf/components/aaf-cert-service/resources/certServiceClient-keystore.jks b/kubernetes/aaf/components/aaf-cert-service/resources/certServiceClient-keystore.jks
index f24908c55d..d32eb887e5 100644
--- a/kubernetes/aaf/components/aaf-cert-service/resources/certServiceClient-keystore.jks
+++ b/kubernetes/aaf/components/aaf-cert-service/resources/certServiceClient-keystore.jks
Binary files differ
diff --git a/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.jks b/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.jks
index 89605b6b7a..c8f4e9cfaf 100644
--- a/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.jks
+++ b/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.jks
Binary files differ
diff --git a/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.p12 b/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.p12
index 2106c817ef..f6cf008c24 100644
--- a/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.p12
+++ b/kubernetes/aaf/components/aaf-cert-service/resources/certServiceServer-keystore.p12
Binary files differ
diff --git a/kubernetes/aaf/components/aaf-cert-service/resources/root.crt b/kubernetes/aaf/components/aaf-cert-service/resources/root.crt
index faeee81357..41c34cd18c 100644
--- a/kubernetes/aaf/components/aaf-cert-service/resources/root.crt
+++ b/kubernetes/aaf/components/aaf-cert-service/resources/root.crt
@@ -1,32 +1,33 @@
-----BEGIN CERTIFICATE-----
-MIIFlDCCA3ygAwIBAgIETsAy8jANBgkqhkiG9w0BAQwFADByMQswCQYDVQQGEwJQ
-TDEUMBIGA1UECBMLRG9sbnkgU2xhc2sxEDAOBgNVBAcTB1dyb2NsYXcxFTATBgNV
-BAoTDFJvb3QgQ29tcGFueTERMA8GA1UECxMIUm9vdCBPcmcxETAPBgNVBAMTCHJv
-b3QuY29tMB4XDTIwMDQwMzA5MTYxNloXDTMwMDQwMTA5MTYxNlowcjELMAkGA1UE
-BhMCUEwxFDASBgNVBAgTC0RvbG55IFNsYXNrMRAwDgYDVQQHEwdXcm9jbGF3MRUw
-EwYDVQQKEwxSb290IENvbXBhbnkxETAPBgNVBAsTCFJvb3QgT3JnMREwDwYDVQQD
-Ewhyb290LmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAImm68wu
-rtdkVrC5JI2y53+DoVE4al7NxC2yHeVW0PRD3CgW1xba6dlSQoDQQKkDkxtuNhlU
-IQxU1bbKR6syqJgpJXwSDx4sl4J5lQGWN+iuNA72C1IyXATOgowGq6PbOVVTkApy
-3+ZZGBCmweTjhvddAO7k5p8v+ePt17VvBTxSt6rSvrkGMbpCxBGAPfGpL9xykm9Z
-okVSlA42gGhbra499QTT0Yc/WPPFotKkDKFGaDrLW3NYX1Lio11myYNvLOMwfSEV
-Xy9vkwxcdqFJpHjx+EVLLQXwkudZP+D53N4bk8nP3SacbZSQ/A85mZpWNtw+r9QL
-fZGecY1YIR0udLj66CIG3ybl3gSXX7TSRERTIMR6Um1lt+039FSa18mRBpQTCDXV
-tSL58Qs5BH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amQWKDoFqeMfnLo0g53xbdS14jNj3aNC1zAoMIxvx9eoEwEqvQ
+Cb2LhAyOqbbwYXvwolDw5C2lgiMF2n9GhtOxVB+oXO/+6FC4sQIDAQABozIwMDAd
+BgNVHQ4EFgQUZnohC3x+LwsiB8Qwx2wssx7qNxgwDwYDVR0TAQH/BAUwAwEB/zAN
+BgkqhkiG9w0BAQwFAAOCAgEAUDcyvn1EcR6gULjX10sjYbnBej/dcyQy9sMgs9bz
+7ypJ6RTUOujBHBx7OIuIpLLVSow4pCJiM9Qxn/DSlWA/G1YK1g3/BdtNDhiOy+Bw
+SkofSJ+HY8ljDWXlONHvSH0gXEqm4MBoV1nOSHNXyYA4ITtX98UsN0xx4T531o06
+X8IPagCz2DHPMYVxyjJdWhl9VEWo9BmOmxkXXjAEn93ege/WJ/23GAyEyrAlWgiC
+glrvGWQy90PNMS+Z7JfMcHEn76d0Am9goIkhg+jGQwUlPCUxFzaWdH5903S6qQqI
+B1X1YGCKWcM5h9DetUdNqS4sv/msVzG3h5Z3UzXDNIKibH04B0ibeybrq+OHIxbS
+GAXYIScGEqrldG2FTC/C0ybg9juOxrrThrjas2rmvXpLRbbhoYl0LZS7+ZSXT3+a
+pFC1FXJyy45Uf0ulBB4vEeO8CQbSrPKus+H65+dJsrvi3yX7SuCLr6Ob7aLvJmQk
+h1fiXGeHnD5oMtGksC9cXdym62ec7VRvX+KiD6BBNOfuo/3bi7Dz3xzsjQc8O4bz
+hb7oLHHUwRkzT9DmQT9l3+vohnzlxf+G+/8FXwjZh+/2PzbDfRrmAIp8sZYWv1Q1
+OMh02nlLk2xq9fAgER0xKWnIsPdjQo3tP3fREmOYtHNvlZzyBswZ6PfOLC/fW3BH
+WO8=
-----END CERTIFICATE-----
diff --git a/kubernetes/aaf/components/aaf-cert-service/resources/truststore.jks b/kubernetes/aaf/components/aaf-cert-service/resources/truststore.jks
index c32d37fd9d..4dd41f287a 100644
--- a/kubernetes/aaf/components/aaf-cert-service/resources/truststore.jks
+++ b/kubernetes/aaf/components/aaf-cert-service/resources/truststore.jks
Binary files differ
diff --git a/kubernetes/common/mariadb-galera/resources/post-upgrade-script.sh b/kubernetes/common/mariadb-galera/resources/post-upgrade-script.sh
index 132ac27ea2..ec09df3a86 100644
--- a/kubernetes/common/mariadb-galera/resources/post-upgrade-script.sh
+++ b/kubernetes/common/mariadb-galera/resources/post-upgrade-script.sh
@@ -20,7 +20,123 @@ kubectl patch secret $FLAG_EX_ROOT_SEC -p \
kubectl patch secret $FLAG_EX_SEC -p \
'{"data":{"password":"'"$tmp_MYSQL_PASSWORD"'"}}'
-kubectl delete pod -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 --now
+MYSQL_USER=$(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- printenv MYSQL_USER)
+
+MYSQL_PASSWORD=$(echo -n $(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- printenv MYSQL_PASSWORD))
+
+MYSQL_ROOT_PASSWORD=$(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- printenv MYSQL_ROOT_PASSWORD)
+
+CURRENT_STS_REPLICA=$(kubectl get statefulsets -n $NAMESPACE_ENV \
+ {{ include "common.fullname" . }} -o jsonpath='{.status.replicas}')
+
+DEPLOYMENT_REPLICA=$(kubectl get deployment -n $NAMESPACE_ENV \
+ {{ include "common.fullname" . }}-upgrade-deployment -o \
+ jsonpath='{.status.replicas}')
+
+if [[ $CURRENT_STS_REPLICA == "0" ]]
+then
+ echo "Seems there was no upgrade of cluster and we will scale up cluster replicas back to $REPLICA_COUNT now"
+ kubectl scale statefulsets {{ include "common.fullname" . }} --replicas=$REPLICA_COUNT
+fi
+
+MY_REPLICA_NUMBER=$(kubectl get statefulsets -n $NAMESPACE_ENV \
+ {{ include "common.fullname" . }} -o jsonpath='{.status.replicas}')
+
+while [[ ! $MY_REPLICA_NUMBER == $REPLICA_COUNT ]]
+do
+ echo "The cluster is not scaled up to $REPLICA_COUNT yet. Please wait ..."
+ MY_REPLICA_NUMBER=$(kubectl get statefulsets -n $NAMESPACE_ENV \
+ {{ include "common.fullname" . }} -o jsonpath='{.status.replicas}')
+ echo "The current status of the cluster is $MY_REPLICA_NUMBER"
+ sleep 2
+ if [[ $MY_REPLICA_NUMBER == $REPLICA_COUNT ]]
+ then
+ break
+ fi
+done
+
+CLUSTER_NO=$(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- \
+ mysql --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';" | \
+ awk '{print $2}')
+
+CLUSTER_STATE=$(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- \
+ mysql --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';" \
+ | awk '{print $2}')
+
+while [[ ! $CLUSTER_NO == $((REPLICA_COUNT+DEPLOYMENT_REPLICA)) ]] \
+ || [[ ! $CLUSTER_STATE == "Synced" ]]
+do
+ echo "$CLUSTER_NO and $CLUSTER_STATE"
+ CLUSTER_NO=$(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- mysql \
+ --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';" \
+ | awk '{print $2}')
+ CLUSTER_STATE=$(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- mysql \
+ --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';" \
+ | awk '{print $2}')
+ sleep 2
+ if [[ $CLUSTER_NO == $((REPLICA_COUNT+DEPLOYMENT_REPLICA)) ]] \
+ && [[ $CLUSTER_STATE == "Synced" ]]
+ then
+ echo "The cluster has $CLUSTER_NO members and $CLUSTER_STATE state."
+ break
+ fi
+done
+
+MYSQL_STATUS=$(kubectl exec -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 -- mysqladmin \
+ -uroot -p$MYSQL_ROOT_PASSWORD ping)
+
+while [[ ! $MYSQL_STATUS == "mysqld is alive" ]]
+do
+ echo "Mariadb deployment is not ready yet."
+ sleep 2
+ MYSQL_STATUS=$(kubectl exec -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 -- mysqladmin \
+ -uroot -p$MYSQL_ROOT_PASSWORD ping)
+ if [[ $MYSQL_STATUS == "mysqld is alive" ]]
+ then
+ echo "Mariadb deployment is ready and cluster size is $CLUSTER_NO"
+ break
+ fi
+done
+
+echo "Deleting upgrade deployment now"
+
kubectl delete deployment -n $NAMESPACE_ENV {{ include "common.fullname" . }}-upgrade-deployment
kubectl delete secret -n $NAMESPACE_ENV {{ include "common.fullname" . }}-temp-upgrade-root
-kubectl delete secret -n $NAMESPACE_ENV {{ include "common.fullname" . }}-temp-upgrade-usercred \ No newline at end of file
+kubectl delete secret -n $NAMESPACE_ENV {{ include "common.fullname" . }}-temp-upgrade-usercred
+
+CLUSTER_NO=$(kubectl exec -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 -- \
+ mysql --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';" | \
+ awk '{print $2}')
+
+CLUSTER_STATE=$(kubectl exec -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 -- \
+ mysql --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';" \
+ | awk '{print $2}')
+
+while [[ ! $CLUSTER_NO == $REPLICA_COUNT ]] \
+ || [[ ! $CLUSTER_STATE == "Synced" ]]
+do
+ echo "$CLUSTER_NO and $CLUSTER_STATE"
+ CLUSTER_NO=$(kubectl exec -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 -- mysql \
+ --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';" \
+ | awk '{print $2}')
+ CLUSTER_STATE=$(kubectl exec -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 -- mysql \
+ --skip-column-names -h{{ $.Values.service.name }} -u$MYSQL_USER \
+ -p$MYSQL_PASSWORD -e "SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';" \
+ | awk '{print $2}')
+ sleep 2
+ if [[ $CLUSTER_NO == $REPLICA_COUNT ]] \
+ && [[ $CLUSTER_STATE == "Synced" ]]
+ then
+ echo "The cluster has $CLUSTER_NO members and $CLUSTER_STATE state."
+ break
+ fi
+done
+
+echo "The cluster upgrade is finished now"
diff --git a/kubernetes/common/mariadb-galera/templates/job.yaml b/kubernetes/common/mariadb-galera/templates/job.yaml
index cc71bb855c..db56f3e046 100644
--- a/kubernetes/common/mariadb-galera/templates/job.yaml
+++ b/kubernetes/common/mariadb-galera/templates/job.yaml
@@ -72,6 +72,8 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
+ - name: REPLICA_COUNT
+ value: "{{ .Values.replicaCount }}"
command: ["/bin/bash", "-c", "--"]
args: ["/upgrade/post-upgrade-script.sh"]
volumeMounts:
diff --git a/kubernetes/common/network-name-gen/templates/deployment.yaml b/kubernetes/common/network-name-gen/templates/deployment.yaml
index b9550c7666..87dd622c35 100644
--- a/kubernetes/common/network-name-gen/templates/deployment.yaml
+++ b/kubernetes/common/network-name-gen/templates/deployment.yaml
@@ -14,7 +14,7 @@
# limitations under the License.
*/}}
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.fullname" . }}
@@ -26,6 +26,9 @@ metadata:
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ include "common.name" . }}
template:
metadata:
labels: