Helm/GitLab: Difference between revisions
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
DDL | DDL | ||
</syntaxhighlight> | </syntaxhighlight> | ||
---- | |||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
cat << DDL | psql -U ${USER} | cat << DDL | psql -U ${USER} | ||
Line 28: | Line 27: | ||
DDL | DDL | ||
</syntaxhighlight> | </syntaxhighlight> | ||
---- | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
helm show values gitlab/gitlab --version 8.0.1|less | helm show values gitlab/gitlab --version 8.0.1|less | ||
Line 38: | Line 36: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign="top"| | |valign="top"| | ||
<syntaxhighlight lang="yaml" highlight="6,18-20" line> | |||
<syntaxhighlight lang="yaml" highlight="6,18" line> | |||
cat << YML | kubectl apply -n gitlab -f - | cat << YML | kubectl apply -n gitlab -f - | ||
--- | --- | ||
Line 73: | Line 44: | ||
kind: Secret | kind: Secret | ||
metadata: | metadata: | ||
name: gitlab | name: gitlab | ||
namespace: gitlab | namespace: gitlab | ||
labels: | labels: | ||
Line 85: | Line 56: | ||
meta.helm.sh/release-namespace: gitlab | meta.helm.sh/release-namespace: gitlab | ||
data: | data: | ||
password: c2FkYXFhaCE= | smtp-password: c2FkYXFhaCE= | ||
psql-password: c2FkYXFhaCE= | |||
root-password: c2FkYXFhaCE= | |||
type: Opaque | type: Opaque | ||
YML | YML | ||
Line 115: | Line 64: | ||
|- | |- | ||
|colspan=" | |colspan="2"| | ||
---- | ---- | ||
|- | |- | ||
|colspan=" | |colspan="2"| | ||
<syntaxhighlight lang="yaml" highlight="16-18,24-26,49-51" line> | <syntaxhighlight lang="yaml" highlight="16-18,24-26,49-51" line> | ||
cat <<YML | helm -n gitlab install gitlab gitlab/gitlab --version 8.2.1 -f - | cat <<YML | helm -n gitlab install gitlab gitlab/gitlab --version 8.2.1 -f - | ||
Line 136: | Line 85: | ||
database: gitlab | database: gitlab | ||
password: | password: | ||
secret: gitlab | secret: gitlab | ||
key: password | key: psql-password | ||
smtp: | smtp: | ||
enabled: true | enabled: true | ||
Line 144: | Line 93: | ||
user_name: "[email protected]" | user_name: "[email protected]" | ||
password: | password: | ||
secret: gitlab | secret: gitlab | ||
key: password | key: smtp-password | ||
domain: mail.k8s.local | domain: mail.k8s.local | ||
authentication: "plain" | authentication: "plain" | ||
Line 169: | Line 118: | ||
enabled: false | enabled: false | ||
initialRootPassword: | initialRootPassword: | ||
secret: gitlab | secret: gitlab | ||
key: password | key: root-password | ||
time_zone: "Asia/Kuala_Lumpur" | time_zone: "Asia/Kuala_Lumpur" | ||
redis: | redis: | ||
Line 204: | Line 153: | ||
|- | |- | ||
|colspan=" | |colspan="2"| | ||
---- | ---- | ||
|- | |- | ||
Line 218: | Line 167: | ||
sensible-browser http://gitlab.k8s.local &>/dev/null & | sensible-browser http://gitlab.k8s.local &>/dev/null & | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Revision as of 07:25, 22 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
kubectl delete namespace gitlab
cat << DDL | psql -U ${USER}
DROP DATABASE IF EXISTS gitlab;
DROP USER IF EXISTS gitlab;
DDL
cat << DDL | psql -U ${USER}
CREATE DATABASE gitlab;
CREATE USER gitlab WITH ENCRYPTED PASSWORD 'sadaqah!';
GRANT ALL PRIVILEGES ON DATABASE gitlab TO gitlab;
DDL
helm show values gitlab/gitlab --version 8.0.1|less
helm show values gitlab/gitlab --version 8.2.1|less
kubectl get ns|grep gitlab
kubectl create namespace gitlab
|
cat << YML | kubectl apply -n gitlab -f -
---
apiVersion: v1
kind: Secret
metadata:
name: gitlab
namespace: gitlab
labels:
app.kubernetes.io/managed-by: kubectl
app.kubernetes.io/instance: gitlab
app.kubernetes.io/version: 8.2.1
app.kubernetes.io/name: gitlab
helm.sh/chart: gitlab-8.2.1
annotations:
meta.helm.sh/release-name: gitlab
meta.helm.sh/release-namespace: gitlab
data:
smtp-password: c2FkYXFhaCE=
psql-password: c2FkYXFhaCE=
root-password: c2FkYXFhaCE=
type: Opaque
YML
|
| |
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
psql:
host: host.minikube.internal
username: gitlab
database: gitlab
password:
secret: gitlab
key: psql-password
smtp:
enabled: true
address: mail.k8s.local
port: 10587
user_name: "[email protected]"
password:
secret: gitlab
key: smtp-password
domain: mail.k8s.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.k8s.local/realms/GoogleWorkspace', 'discovery' => true, 'client_auth_method' => 'query', 'uid_field' => 'sub', 'send_scope_to_token_endpoint' => 'false', 'client_options' => { 'identifier' => 'gitlab.k8s.local', 'secret' => '9f16a376-2114-45f4-9b69-873080764b15', 'redirect_uri' => 'http://gitlab.k8s.local/users/auth/openid_connect/callback' }}}]
kas:
enabled: false
minio:
enabled: true
gitaly:
enabled: true
registry:
enabled: false
initialRootPassword:
secret: gitlab
key: root-password
time_zone: "Asia/Kuala_Lumpur"
redis:
install: true
gitlab:
webservice:
minReplicas: 1
maxReplicas: 2
gitlab-shell:
minReplicas: 1
maxReplicas: 2
registry:
enabled: false
hpa:
minReplicas: 1
maxReplicas: 2
postgresql:
install: false
prometheus:
install: false
certmanager:
install: false
upgradeCheck:
enabled: 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 get secret gitlab-gitlab-initial-root-password -ojsonpath='{.data.password}'|base64 -d;echo
kubectl -n gitlab get secret gitlab-gitlab-initial-root-password -ojson|jq -r '.data.password'|base64 -d;echo
| |
| |
kubectl -n gitlab get secret gitlab-smtp-secret -o json|jq -r '.data.password'|base64 -d;echo
kubectl -n gitlab get secret gitlab-psql-secret -o json|jq -r '.data.password'|base64 -d;echo
kubectl -n gitlab get secret gitlab-root-secret -o json|jq -r '.data.password'|base64 -d;echo
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-webservice-default -c gitlab-workhorse -- bash
kubectl -n gitlab exec -it svc/gitlab-webservice-default -c webservice -- bash
kubectl -n gitlab exec -it svc/gitlab-redis-master -c redis -- bash
kubectl -n gitlab exec -it svc/gitlab-gitaly -c gitaly -- 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-redis-master-0 -- bash
kubectl -n gitlab exec -it gitlab-postgresql-0 -- bash
kubectl -n gitlab exec -it gitlab-gitaly-0 -- bash
|