-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade gitea helm chart version (#488)
Signed-off-by: Pankaj Walke <[email protected]>
- Loading branch information
1 parent
2a9f196
commit 64d93ac
Showing
4 changed files
with
66 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,19 @@ apiVersion: v1 | |
kind: Secret | ||
metadata: | ||
name: my-gitea-inline-config | ||
namespace: gitea | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
type: Opaque | ||
stringData: | ||
_generals_: "" | ||
actions: ENABLED=false | ||
cache: |- | ||
ADAPTER=memory | ||
HOST= | ||
|
@@ -50,13 +52,14 @@ apiVersion: v1 | |
kind: Secret | ||
metadata: | ||
name: my-gitea | ||
namespace: gitea | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
type: Opaque | ||
stringData: | ||
|
@@ -222,13 +225,14 @@ apiVersion: v1 | |
kind: Secret | ||
metadata: | ||
name: my-gitea-init | ||
namespace: gitea | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
type: Opaque | ||
stringData: | ||
|
@@ -241,15 +245,13 @@ stringData: | |
#!/usr/bin/env bash | ||
set -euo pipefail | ||
set -x | ||
mkdir -p /data/git/.ssh | ||
chmod -R 700 /data/git/.ssh | ||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf | ||
mkdir -pv /data/git/.ssh | ||
chmod -Rv 700 /data/git/.ssh | ||
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf | ||
# prepare temp directory structure | ||
mkdir -p "${GITEA_TEMP}" | ||
chmod ug+rwx "${GITEA_TEMP}" | ||
mkdir -pv "${GITEA_TEMP}" | ||
chmod -v ug+rwx "${GITEA_TEMP}" | ||
|
@@ -290,13 +292,33 @@ stringData: | |
local ACCOUNT_ID=$(echo "${actual_user_table}" | grep -E "\s+${GITEA_ADMIN_USERNAME}\s+" | awk -F " " "{printf \$1}") | ||
if [[ -z "${ACCOUNT_ID}" ]]; then | ||
local -a create_args | ||
create_args=(--admin --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}" --email "[email protected]") | ||
if [[ "${GITEA_ADMIN_PASSWORD_MODE}" = initialOnlyRequireReset ]]; then | ||
create_args+=(--must-change-password=true) | ||
else | ||
create_args+=(--must-change-password=false) | ||
fi | ||
echo "No admin user '${GITEA_ADMIN_USERNAME}' found. Creating now..." | ||
gitea admin user create --admin --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}" --email "[email protected]" --must-change-password=false | ||
gitea admin user create "${create_args[@]}" | ||
echo '...created.' | ||
else | ||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist. Running update to sync password..." | ||
gitea admin user change-password --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}" | ||
echo '...password sync done.' | ||
if [[ "${GITEA_ADMIN_PASSWORD_MODE}" = keepUpdated ]]; then | ||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist. Running update to sync password..." | ||
# See https://gitea.com/gitea/helm-chart/issues/673 | ||
# --must-change-password argument was added to change-password, defaulting to true, counter to the previous behavior | ||
# which acted as if it were provided with =false. If the argument is present in this version of gitea, then we | ||
# should add it to prevent requiring frequent admin password resets. | ||
local -a change_args | ||
change_args=(--username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}") | ||
if gitea admin user change-password --help | grep -qF -- '--must-change-password'; then | ||
change_args+=(--must-change-password=false) | ||
fi | ||
gitea admin user change-password "${change_args[@]}" | ||
echo '...password sync done.' | ||
else | ||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist, but update mode is set to '${GITEA_ADMIN_PASSWORD_MODE}'. Skipping." | ||
fi | ||
fi | ||
} | ||
|
@@ -340,13 +362,14 @@ apiVersion: v1 | |
kind: Service | ||
metadata: | ||
name: my-gitea-http | ||
namespace: gitea | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
annotations: | ||
{} | ||
|
@@ -366,13 +389,14 @@ apiVersion: v1 | |
kind: Service | ||
metadata: | ||
name: my-gitea-ssh | ||
namespace: gitea | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
annotations: | ||
{} | ||
|
@@ -394,14 +418,15 @@ apiVersion: apps/v1 | |
kind: Deployment | ||
metadata: | ||
name: my-gitea | ||
namespace: gitea | ||
annotations: | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
spec: | ||
replicas: 1 | ||
|
@@ -417,22 +442,22 @@ spec: | |
template: | ||
metadata: | ||
annotations: | ||
checksum/config: 9472556301411a93ff19830db2ba46ea781c96364243b2f06ab8e33fb785c25d | ||
checksum/config: 84d963775a319c5adebc83ffa879c7b7fa826991fd52351dc371e4f706025be4 | ||
labels: | ||
helm.sh/chart: gitea-10.1.4 | ||
helm.sh/chart: gitea-10.6.0 | ||
app: gitea | ||
app.kubernetes.io/name: gitea | ||
app.kubernetes.io/instance: my-gitea | ||
app.kubernetes.io/version: "1.22.0" | ||
version: "1.22.0" | ||
app.kubernetes.io/version: "1.22.3" | ||
version: "1.22.3" | ||
app.kubernetes.io/managed-by: Helm | ||
spec: | ||
|
||
securityContext: | ||
fsGroup: 1000 | ||
initContainers: | ||
- name: init-directories | ||
image: "gitea/gitea:1.22.0-rootless" | ||
image: "gitea/gitea:1.22.3-rootless" | ||
imagePullPolicy: IfNotPresent | ||
command: ["/usr/sbin/init_directory_structure.sh"] | ||
env: | ||
|
@@ -460,7 +485,7 @@ spec: | |
cpu: 100m | ||
memory: 128Mi | ||
- name: init-app-ini | ||
image: "gitea/gitea:1.22.0-rootless" | ||
image: "gitea/gitea:1.22.3-rootless" | ||
imagePullPolicy: IfNotPresent | ||
command: ["/usr/sbin/config_environment.sh"] | ||
env: | ||
|
@@ -490,7 +515,7 @@ spec: | |
cpu: 100m | ||
memory: 128Mi | ||
- name: configure-gitea | ||
image: "gitea/gitea:1.22.0-rootless" | ||
image: "gitea/gitea:1.22.3-rootless" | ||
command: ["/usr/sbin/configure_gitea.sh"] | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
|
@@ -516,6 +541,8 @@ spec: | |
secretKeyRef: | ||
key: password | ||
name: gitea-credential | ||
- name: GITEA_ADMIN_PASSWORD_MODE | ||
value: keepUpdated | ||
volumeMounts: | ||
- name: init | ||
mountPath: /usr/sbin | ||
|
@@ -532,7 +559,7 @@ spec: | |
terminationGracePeriodSeconds: 60 | ||
containers: | ||
- name: gitea | ||
image: "gitea/gitea:1.22.0-rootless" | ||
image: "gitea/gitea:1.22.3-rootless" | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
# SSH Port values have to be set here as well for openssh configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters