From 1add377fb7062f7061d68c2d01f20669b5776bb2 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Mon, 19 Oct 2026 08:50:17 +0200 Subject: [PATCH] Remove legacy Kubernetes CD bootstrap --- ci-deployer.yaml | 88 ----------- create-ci-kubeconfig.sh | 50 ------ phppgadmin.yaml | 333 ---------------------------------------- 3 files changed, 471 deletions(-) delete mode 100644 ci-deployer.yaml delete mode 100755 create-ci-kubeconfig.sh delete mode 100644 phppgadmin.yaml diff --git a/ci-deployer.yaml b/ci-deployer.yaml deleted file mode 100644 index 1fd818f..0000000 --- a/ci-deployer.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Bootstrap this file once with an administrator identity. CI can update only -# the existing phpPgAdmin resources and cannot call the Kubernetes Secrets API. -apiVersion: v1 -kind: ServiceAccount -metadata: - name: phppgadmin-deployer - namespace: default -automountServiceAccountToken: false ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: phppgadmin-deployer - namespace: default -rules: - - apiGroups: - - "" - resources: - - configmaps - resourceNames: - - phppgadmin-config - verbs: - - get - - patch - - update - - apiGroups: - - "" - resources: - - services - resourceNames: - - phppgadmin - verbs: - - get - - patch - - update - - apiGroups: - - apps - resources: - - deployments - resourceNames: - - phppgadmin - verbs: - - get - - patch - - update - - apiGroups: - - networking.k8s.io - resources: - - ingresses - resourceNames: - - phppgadmin - verbs: - - get - - patch - - update - - apiGroups: - - traefik.io - resources: - - middlewares - resourceNames: - - phppgadmin-root-redirect - verbs: - - get - - patch - - update ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: phppgadmin-deployer - namespace: default -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: phppgadmin-deployer -subjects: - - kind: ServiceAccount - name: phppgadmin-deployer - namespace: default ---- -apiVersion: v1 -kind: Secret -metadata: - name: phppgadmin-deployer-token - namespace: default - annotations: - kubernetes.io/service-account.name: phppgadmin-deployer -type: kubernetes.io/service-account-token diff --git a/create-ci-kubeconfig.sh b/create-ci-kubeconfig.sh deleted file mode 100755 index 1becd0c..0000000 --- a/create-ci-kubeconfig.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) -namespace=${NAMESPACE:-default} -service_account=${SERVICE_ACCOUNT:-phppgadmin-deployer} -secret=${TOKEN_SECRET:-phppgadmin-deployer-token} - -[[ $(kubectl config current-context) == kubernetes-admin@kubernetes ]] || { echo "Wrong Kubernetes context" >&2; exit 1; } -kubectl apply --dry-run=server --filename "${project_dir}/ci-deployer.yaml" >&2 -kubectl apply --filename "${project_dir}/ci-deployer.yaml" >&2 - -for attempt in {1..30}; do - if kubectl --namespace "${namespace}" get secret "${secret}" \ - --output=jsonpath='{.data.token}' 2>/dev/null | grep -q .; then - break - fi - if [[ "${attempt}" == 30 ]]; then - echo "Timed out waiting for the service-account token" >&2 - exit 1 - fi - sleep 1 -done - -workdir=$(mktemp --directory) -trap 'rm -rf "${workdir}"' EXIT - -server=$(kubectl config view --minify --output=jsonpath='{.clusters[0].cluster.server}') -kubectl --namespace "${namespace}" get secret "${secret}" \ - --output=jsonpath='{.data.ca\.crt}' | base64 --decode > "${workdir}/ca.crt" -token=$(kubectl --namespace "${namespace}" get secret "${secret}" \ - --output=jsonpath='{.data.token}' | base64 --decode) - -export KUBECONFIG="${workdir}/config" -kubectl config set-cluster cluster \ - --server="${server}" \ - --certificate-authority="${workdir}/ca.crt" \ - --embed-certs=true >/dev/null -kubectl config set-credentials "${service_account}" --token="${token}" >/dev/null -kubectl config set-context phppgadmin \ - --cluster=cluster \ - --user="${service_account}" \ - --namespace="${namespace}" >/dev/null -kubectl config use-context phppgadmin >/dev/null - -echo "Store the following single line as the Gitea Actions secret KUBE_CONFIG_BASE64." >&2 -echo "Treat it as a password; do not commit it." >&2 -base64 --wrap=0 "${KUBECONFIG}" -printf '\n' diff --git a/phppgadmin.yaml b/phppgadmin.yaml deleted file mode 100644 index de519a6..0000000 --- a/phppgadmin.yaml +++ /dev/null @@ -1,333 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: phppgadmin-config - namespace: default - labels: - app.kubernetes.io/name: phppgadmin -data: - config.inc.php: | -