Helm/GitLab: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 200: Line 200:
| valign="top" |
| valign="top" |
* [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>]
* [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>]
* [https://docs.gitlab.com/charts/installation/migration/ Helm » GitLab » Migration Guides]
* [https://docs.gitlab.com/charts/installation/deployment Helm » GitLab » Deploy CE]
* [https://docs.gitlab.com/charts/installation/deployment Helm » GitLab » Deploy CE]
* [[Helm/Prometheus Stack|Helm » Prometheus Stack]]
* [[Helm/Prometheus Stack|Helm » Prometheus Stack]]
* [https://docs.gitlab.com/charts/advanced/external-gitaly/ Helm » GitLab » Gitaly]
* [[Helm/Cert Manager|Helm » Cert Manager]]
* [[Helm/Cert Manager|Helm » Cert Manager]]
* [[Helm/SonarQube|Helm » SonarQube]]
* [[Helm/SonarQube|Helm » SonarQube]]
Line 209: Line 211:


| valign="top" |
| valign="top" |
* [https://docs.gitlab.com/charts/installation/migration/minio.html Helm » GitLab » MinIO]


| valign="top" |
| valign="top" |

Revision as of 17:18, 8 August 2024

helm repo add gitlab https://charts.gitlab.io
helm repo update && helm repo list

Config

export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"

Install

cat << DDL | psql -U ${USER}
CREATE DATABASE gitlab;
-- DROP DATABASE IF EXISTS gitlab;
CREATE USER gitlab WITH ENCRYPTED PASSWORD 'sadaqah!';
GRANT ALL PRIVILEGES ON DATABASE     gitlab TO gitlab;
DDL

kubectl create namespace gitlab
helm show values gitlab/gitlab --version 8.2.1|less
cat <<YML | helm -n gitlab install gitlab gitlab/gitlab --version 8.2.1 -f -
global:
  edition: ce
  hosts:
    https: false
    domain: k8s.local
  ingress:
    tls:
      enabled: false
    configureCertmanager: false
  smtp:
    enabled: true
    address: mail.chorke.local
    port: 10587
    user_name: "[email protected]"
    password:
      secret: "sadaqah!"
      key: password
    domain: mail.chorke.local
    authentication: "plain"
    starttls_auto: true
  email:
    from: "[email protected]"
    display_name: Academia Gitlab
    reply_to: "[email protected]"
  appConfig:
    omniauth:
      enabled: true
      blockAutoCreatedUsers: false
      allowSingleSignOn: ["openid_connect"]
      syncProfileFromProvider: |
        [{ 'name' => 'openid_connect', 'label' => 'Academia OpenID', 'icon' => '', 'args' => {'name' => 'openid_connect', 'scope' => ['openid','profile'], 'response_type' => 'code', 'issuer' => 'http://keycloak.chorke.local/realms/GoogleWorkspace', 'discovery' => true, 'client_auth_method' => 'query', 'uid_field' => 'sub', 'send_scope_to_token_endpoint' => 'false', 'client_options' => { 'identifier' => 'gitlab.chorke.local', 'secret' => '9f16a376-2114-45f4-9b69-873080764b15', 'redirect_uri' => 'http://gitlab.chorke.local/users/auth/openid_connect/callback' }}}]
  kas:
    enabled: false
  minio:
    enabled: true
  gitaly:
    enabled: true
  registry:
    enabled: false
  time_zone: "Asia/Kuala_Lumpur"
redis:
  install: true
postgresql:
  install: true
prometheus:
  install: false
certmanager:
  install: false
gitlab-runner:
  install: false
nginx-ingress:
  enabled: false
nginx-ingress-geo:
  enabled: false
YML

xdg-open http://gitlab.k8s.local &>/dev/null &
gnome-open http://gitlab.k8s.local &>/dev/null &
x-www-browser http://gitlab.k8s.local &>/dev/null &
sensible-browser http://gitlab.k8s.local &>/dev/null &

Uninstall

helm uninstall -n gitlab gitlab
kubectl delete namespace gitlab

Playground

helm -n gitlab install    gitlab gitlab/gitlab --version 8.0.1
helm -n gitlab upgrade -i gitlab gitlab/gitlab --version 8.2.1
helm show values gitlab/gitlab --version 8.2.1|less

kubectl -n gitlab exec -it svc/gitlab -c gitlab -- /opt/bitnami/gitlab/bin/kc.sh --version
kubectl -n gitlab exec -it svc/gitlab -c gitlab -- cat /opt/bitnami/gitlab/version.txt

ADMIN_PASS=$(kubectl -n gitlab get secret gitlab -o json|jq -r '.data."admin-password"'|base64 -d)
ADMIN_PASS=$(kubectl -n gitlab get secret gitlab -o jsonpath="{.data.admin-password}"|base64 -d)

kubectl -n gitlab exec -it svc/gitlab-postgresql -c postgresql -- psql -Ugitlab
kubectl -n gitlab exec -it svc/gitlab-postgresql -c postgresql -- bash
kubectl -n gitlab exec -it svc/gitlab -c gitlab -- ls -lah /var
kubectl -n gitlab exec -it svc/gitlab -c gitlab -- bash
kubectl -n gitlab exec -it gitlab-postgresql-0 -- bash

kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten

kubectl -n gitlab delete all --all
kubectl -n gitlab delete ing --all
kubectl -n gitlab delete sts --all
kubectl -n gitlab delete svc --all
kubectl -n gitlab delete pvc --all
kubectl -n gitlab delete pv  --all

kubectl -n gitlab rollout history sts gitlab
kubectl -n gitlab rollout restart sts gitlab
kubectl -n gitlab rollout status  sts gitlab
kubectl -n gitlab exec -it gitlab-postgresql-0 -- psql -Ugitlab
kubectl -n gitlab logs -f gitlab-postgresql-0
kubectl -n gitlab logs -f gitlab-0

References