This is an old revision of the document!
Запустите с правами Administrator C:\cmder\cmder.exe bash cd test -d conf && rm -rf conf git clone http://val.bmstu.ru/unix/conf.git cd conf/virtualbox/ !!! 10 - это номер курса, вместо X укажите Ваш номер стенда, если не знаете его, спросите преподавателя !!! ./setup.sh X 10
# sh net_gate.sh # init 6
# sh net_server.sh # init 6
server# apt update
gate:~# ###git -C conf/ pull gate:~# sh conf/dhcp.sh
# cat /etc/resolv.conf
search corpX.un nameserver 192.168.X.10
# host kubeN
kube1:~# kubectl create ns my-keycloak-ns kube1:~# kubectl create secret tls keycloak-tls --key /tmp/keycloak.key --cert /tmp/keycloak.crt -n my-keycloak-ns
kube1:~/gitlab# sed -i -e 's/server.corpX/gitlab.corpX/' docker-compose.yml
...
privileged: true
...
- '22:22'
...
# - '/etc/gitlab:/etc/gitlab'
...
server# scp /opt/freeipa-data/etc/ipa/ca.crt kube1:/tmp/ kube1:~/gitlab# kubectl -n my-gitlab-ns create configmap ca-crt --from-file=/tmp/ca.crt
kube1:~/gitlab# kompose convert kube1:~/gitlab# cat vol1-persistentvolumeclaim.yaml
...
storage: 2000Mi
kube1:~/gitlab# cat gitlab-deployment.yaml
...
image: ...
# lifecycle:
# postStart:
# exec:
# command:
# - /bin/sh
# - -c
# - |
# mkdir -p /etc/gitlab/trusted-certs/
# cp /etc/gitlab/tmp/ca.crt /etc/gitlab/trusted-certs/ca.crt
# apt update && DEBIAN_FRONTEND=noninteractive apt install msmtp-mta bsd-mailx -y
# echo -e 'account default\nhost mail.corpX.un' > /etc/msmtprc
...
volumeMounts:
- name: gitlab-tls-volume
subPath: tls.crt
mountPath: /etc/gitlab/ssl/gitlab.corpX.un.crt
- name: gitlab-tls-volume
subPath: tls.key
mountPath: /etc/gitlab/ssl/gitlab.corpX.un.key
# - name: ca-crt-volume
# subPath: ca.crt
# mountPath: /etc/gitlab/tmp/ca.crt
...
hostname: gitlab
...
volumes:
- name: gitlab-tls-volume
secret:
secretName: gitlab-tls
# - name: ca-crt-volume
# configMap:
# name: ca-crt
...
kube1:~/gitlab# cat gitlab-service.yaml
... spec: loadBalancerIP: 192.168.X.65 type: LoadBalancer ...
kube1:~/gitlab# kubectl -n my-gitlab-ns apply -f vol1-persistentvolumeclaim.yaml,gitlab-service.yaml,gitlab-deployment.yaml kube1:~/gitlab# kubectl -n my-gitlab-ns logs pods/gitlab-<TAB> -f
kube1:~/webd-k8s# cat my-webd-deployment.yaml
...
image: httpd
lifecycle:
...
cd /usr/local/apache2/htdocs/
echo "<h1>Hello from htwebd on $(hostname) ver1.1</h1>" > index.html
kube1:~/webd-k8s# cp my-webd-deployment.yaml my-webd-deployment2.yaml kube1:~/webd-k8s# cp my-webd-service.yaml my-webd-service2.yaml ...
kube1:~/webd-k8s# curl -fsSL https://val.bmstu.ru/unix/uni-webd-chart.tgz | tar xzvf - kube1:~/webd-k8s# mkdir -p apps/htwebd/ kube1:~/webd-k8s# cat apps/htwebd/values.yaml
kube1:~/webd-k8s# cp -v my-httproute.yaml uni-webd-chart/templates/ kube1:~/webd-k8s# cp -v my-gateway.yaml uni-webd-chart/templates/
client1:~# time docker build -t gitlab.corpX.un:5000/student/gowebd:ver1.1 gowebd/ ... client1:~# time docker build -t gitlab.corpX.un:5000/student/gowebd:ver1.2 gowebd/
server# cp /opt/freeipa-data/etc/ipa/ca.crt kube1:/usr/local/share/ca-certificates/ update-ca-certificates systemctl reload docker
server# bash -c ' scp /opt/freeipa-data/etc/ipa/ca.crt kube1:/usr/local/share/ca-certificates/ ssh kube1 update-ca-certificates ssh kube1 systemctl restart containerd scp /opt/freeipa-data/etc/ipa/ca.crt kube2:/usr/local/share/ca-certificates/ ssh kube2 update-ca-certificates ssh kube2 systemctl restart containerd scp /opt/freeipa-data/etc/ipa/ca.crt kube3:/usr/local/share/ca-certificates/ ssh kube3 update-ca-certificates ssh kube3 systemctl restart containerd scp /opt/freeipa-data/etc/ipa/ca.crt kube4:/usr/local/share/ca-certificates/ ssh kube4 update-ca-certificates ssh kube4 systemctl restart containerd '