diff --git a/amp/Chart.yaml b/amp/Chart.yaml index b8c5438f0244b3b34b6053530b0d530fd4351ee7..902f9f2e90ae537a6739ba1fbe7f185234141e81 100644 --- a/amp/Chart.yaml +++ b/amp/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: amp description: Helm Chart for amp type: application -version: 0.1.0 +version: 0.2.2 appVersion: "latest" diff --git a/amp/templates/config.yaml b/amp/templates/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bd44f467d31c04b7fb8f3246b6d1443a4bb1b531 --- /dev/null +++ b/amp/templates/config.yaml @@ -0,0 +1,70 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "amp-helm.fullname" . }} + labels: + {{- include "amp-helm.labels" . | nindent 4 }} +data: + auto-activate: "{{ .Values.config.autoActivate }}" + auto-update: "{{ .Values.config.autoUpdate }}" + main.sh: |- + #!/bin/bash -e + #set -o xtrace + set -e + + echo "----------------------" + echo "Starting AMP-Dockerized..." + echo "----------------------" + echo "Note: This is an UNOFFICIAL IMAGE for CubeCoders AMP. This was created by the community, NOT CubeCoders." + echo "Please, DO NOT contact CubeCoders (Discord or otherwise) for technical support when using this image." + echo "They do not support nor endorse this image and will not help you." + echo "Instead, please direct support requests to https://github.com/MitchTalmadge/AMP-dockerized/issues." + echo "Thank you!!" + echo "----------------------" + echo "" + + source /opt/entrypoint/utils.sh + source /opt/entrypoint/routines.sh + trap 'handle_error' ERR + trap_with_arg 'shutdown' INT TERM HUP QUIT KILL + + # Migrate legacy vars + export AMP_LICENCE=${LICENCE:-${AMP_LICENCE:-"notset"}} + export AMP_MODULE=${MODULE:-${AMP_MODULE:-"ADS"}} + if [ ! -z "${NIGHTLY}" ]; then + export AMP_RELEASE_STREAM="Development" + fi + + run_startup_script + + create_amp_user + + check_licence + + configure_timezone + + check_file_permissions + + configure_main_instance + + configure_release_stream + + if [ ${AMP_AUTO_ACTIVATE} = "true" ]; then + echo "${AMP_LICENCE}" | run_amp_command "reactivateall" + else + echo "Skipping automatic reactivation." + fi + + if [ ${AMP_AUTO_UPDATE} = "true" ]; then + upgrade_instances + else + echo "Skipping automatic updates." + fi + + start_amp + + # Sleep + echo "AMP is now running. Logs can be viewed through AMP web UI or at ampdata/instances/Main/AMP_Logs" + monitor_amp & + tail -f /dev/null & + wait $! diff --git a/amp/templates/deployment.yaml b/amp/templates/deployment.yaml index 8cbe3429995b04c57599ff4f128e72c71b4559c5..9cc9354c570d89b5d77cd2400bea70d5047eb920 100644 --- a/amp/templates/deployment.yaml +++ b/amp/templates/deployment.yaml @@ -6,6 +6,10 @@ metadata: {{- include "amp-helm.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} + strategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: "100%" selector: matchLabels: {{- include "amp-helm.selectorLabels" . | nindent 6 }} @@ -29,6 +33,10 @@ spec: {{- .Values.volume | nindent 10 }} - name: tmp emptyDir: {} + - name: config + configMap: + defaultMode: 511 + name: {{ include "amp-helm.fullname" . }} containers: - name: {{ .Chart.Name }} securityContext: @@ -51,6 +59,16 @@ spec: secretKeyRef: key: "admin-pass" name: {{ include "amp-helm.fullname" . }} + - name: "AMP_AUTO_ACTIVATE" + valueFrom: + configMapKeyRef: + name: {{ include "amp-helm.fullname" . }} + key: auto-activate + - name: "AMP_AUTO_UPDATE" + valueFrom: + configMapKeyRef: + name: {{ include "amp-helm.fullname" . }} + key: auto-update ports: - name: sftp containerPort: 2224 @@ -93,6 +111,9 @@ spec: name: data - mountPath: "/tmp" name: tmp + - mountPath: "/opt/entrypoint/main.sh" + name: config + subPath: "main.sh" {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/amp/values.yaml b/amp/values.yaml index d8cc32be295ae814d3ce4b86940ab876bd7d270a..02e233a7555f5a9f6abab53a4c20eb2bf0eff3b5 100644 --- a/amp/values.yaml +++ b/amp/values.yaml @@ -14,6 +14,8 @@ config: user: "" pass: "" license: "" + autoUpdate: false + autoActivate: false service: type: ClusterIP