User Tools

Site Tools


система_kubernetes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
система_kubernetes [2026/07/01 16:34]
val [Дополнительные материалы по Kubespray]
система_kubernetes [2026/11/10 20:51] (current)
val [Deployment]
Line 489: Line 489:
 (venv1) server# cd kubespray/ (venv1) server# cd kubespray/
  
-(venv1) server:​~/​kubespray#​ git tag -l+(venv1) server:​~/​kubespray#​ git tag -l   #​--sort=v:​refname | tail
  
 (venv1) server:​~/​kubespray#​ git checkout tags/​v2.26.0 (venv1) server:​~/​kubespray#​ git checkout tags/​v2.26.0
-  или +  или, до 
-(venv1) server:​~/​kubespray#​ git checkout tags/v2.27.0+(venv1) server:​~/​kubespray#​ git checkout tags/v2.30.0
  
 (venv1) server:​~/​kubespray#​ time pip3 install -r requirements.txt (venv1) server:​~/​kubespray#​ time pip3 install -r requirements.txt
Line 610: Line 610:
 root@cf764ca3b291:/​kubespray#​ cp -rv inventory/​sample/​group_vars/​ /inventory/ root@cf764ca3b291:/​kubespray#​ cp -rv inventory/​sample/​group_vars/​ /inventory/
 </​code>​ </​code>​
-  * [[#​Настройка registry-mirrors для Kubespray]] ​и [[#​Добавление insecure_registries через Kubespray]]+  * [[#​Настройка registry-mirrors для Kubespray]] 
 +  * [[#​Добавление insecure_registries ​через Kubespray]] 
 +  * [[#​Использование proxy при установке ​через Kubespray]]
  
 <​code>​ <​code>​
Line 867: Line 869:
  
 #        image: gowebd #        image: gowebd
-#        imagePullPolicy:​ "IfNotPresent"+#        imagePullPolicy:​ "Always" ​  # for tag latest
  
 #        lifecycle: #        lifecycle:
Line 926: Line 928:
 #        args: #        args:
 #        - | #        - |
-#          test -d /mnt/img/ && exit 0+#          ​#test -d /mnt/img/ && exit 0
 #          mkdir /mnt/img; cd /mnt/img #          mkdir /mnt/img; cd /mnt/img
 #          curl http://​val.bmstu.ru/​unix/​Media/​logo.gif > logo.gif #          curl http://​val.bmstu.ru/​unix/​Media/​logo.gif > logo.gif
Line 995: Line 997:
  
   * [[#Metrics Server]]   * [[#Metrics Server]]
-  * Пакет OpenSSL [[Пакет OpenSSL#​Проверка производительности CPU]]+  * Пакет OpenSSL [[Пакет OpenSSL#​Проверка производительности ​CPU]] или [[Анализ производительности системы#​Стресс тестирование и выявление нагрузки на CPU]]
  
 <​code>​ <​code>​
Line 1700: Line 1702:
 metadata: metadata:
   name: my-pv-kube3-sz-128m-num-001   name: my-pv-kube3-sz-128m-num-001
-#  name: my-pv-kube3-keycloak 
-#  labels: 
-#    type: local 
 spec: spec:
-## comment storageClassName for keycloak 
   storageClassName:​ my-ha-sc   storageClassName:​ my-ha-sc
   capacity:   capacity:
     storage: 128Mi     storage: 128Mi
-#    storage: 8Gi 
   accessModes:​   accessModes:​
     - ReadWriteOnce     - ReadWriteOnce
   hostPath:   hostPath:
-#    path: /disk2 
     path: /disk2/dir1     path: /disk2/dir1
   persistentVolumeReclaimPolicy:​ Retain   persistentVolumeReclaimPolicy:​ Retain
Line 1745: Line 1741:
  
 <​code>​ <​code>​
 +kube1:~/pv# mkdir -p my-ha-pv-chart/​templates/​
 +
 kube1:~/pv# cat my-ha-pv-chart/​Chart.yaml kube1:~/pv# cat my-ha-pv-chart/​Chart.yaml
 </​code><​code>​ </​code><​code>​
Line 1794: Line 1792:
 kube1# kubectl get pv kube1# kubectl get pv
  
-kube1:~/pv# ###helm uninstall my-ha-pv-chart+kube1# helm list 
 + 
 +kube1# ###helm uninstall my-ha-pv-chart
 </​code><​code>​ </​code><​code>​
 kube1:​~/​pywebd-k8s#​ cat my-webd-pvc.yaml kube1:​~/​pywebd-k8s#​ cat my-webd-pvc.yaml
Line 1823: Line 1823:
         lifecycle:         lifecycle:
         ...         ...
 +                test -f /​usr/​local/​apache2/​htdocs/​index.html && exit 0 
 +        ...
       volumes:       volumes:
       - name: htdocs-volume       - name: htdocs-volume
Line 1831: Line 1832:
       initContainers:​       initContainers:​
       ...       ...
 +          test -d /mnt/img/ && exit 0
 +      ...
 +#      nodeSelector:​
 +#        htdocs-node:​ "​yes"​
 +...
 </​code><​code>​ </​code><​code>​
 kube3# find /disk2 kube3# find /disk2
Line 2052: Line 2058:
       - name: my-webd       - name: my-webd
         image: server.corpX.un:​5000/​student/​pywebd:​ver1.2         image: server.corpX.un:​5000/​student/​pywebd:​ver1.2
-        imagePullPolicy:​ "Always"+        imagePullPolicy:​ "IfNotPresent"
  
 #        env: #        env:
Line 2169: Line 2175:
 # ###wget https://​get.helm.sh/​helm-v3.16.4-linux-amd64.tar.gz # ###wget https://​get.helm.sh/​helm-v3.16.4-linux-amd64.tar.gz
 # wget https://​get.helm.sh/​helm-v4.0.4-linux-amd64.tar.gz # wget https://​get.helm.sh/​helm-v4.0.4-linux-amd64.tar.gz
 +# ###wget https://​get.helm.sh/​helm-v4.3.1-linux-amd64.tar.gz
  
 # tar -zxvf helm-*-linux-amd64.tar.gz # tar -zxvf helm-*-linux-amd64.tar.gz
Line 2277: Line 2284:
 image: image:
   repository: server.corpX.un:​5000/​student/​webd   repository: server.corpX.un:​5000/​student/​webd
-  pullPolicy: Always+  pullPolicy: Always ​  # for tag latest
 ... ...
 serviceAccount:​ serviceAccount:​
Line 2374: Line 2381:
 <​code>​ <​code>​
 ~/​gowebd-k8s$ helm repo add --username student --password NNNNN-NNNNNNNNNNNNNNNNNNN webd https://​server.corpX.un/​api/​v4/​projects/​N/​packages/​helm/​stable ~/​gowebd-k8s$ helm repo add --username student --password NNNNN-NNNNNNNNNNNNNNNNNNN webd https://​server.corpX.un/​api/​v4/​projects/​N/​packages/​helm/​stable
 +...
 "​webd"​ has been added to your repositories "​webd"​ has been added to your repositories
  
Line 2478: Line 2486:
         namespace = "​{{.Release.Namespace}}"​         namespace = "​{{.Release.Namespace}}"​
         image = "​alpine"​         image = "​alpine"​
-        privileged = true           #​insert this+        privileged = true           #​insert this, no need if kaniko
 ... ...
 securityContext:​ securityContext:​
-  allowPrivilegeEscalation:​ true    #change this+  allowPrivilegeEscalation:​ true    #change this, no need if kaniko
   readOnlyRootFilesystem:​ false   readOnlyRootFilesystem:​ false
   runAsNonRoot:​ true   runAsNonRoot:​ true
-  privileged: true                  #change this+  privileged: true                  #change this, no need if kaniko
 ... ...
 #​volumeMounts:​ []                   #​comment this #​volumeMounts:​ []                   #​comment this
Line 2499: Line 2507:
 ... ...
 </​code><​code>​ </​code><​code>​
 +kube1:​~/​gitlab-runner#​ helm template gitlab-runner gitlab/​gitlab-runner -f values.yaml -n gitlab-runner --version 0.70.5
 +
 kube1:​~/​gitlab-runner#​ helm upgrade -i gitlab-runner gitlab/​gitlab-runner -f values.yaml -n gitlab-runner --version 0.70.5 kube1:​~/​gitlab-runner#​ helm upgrade -i gitlab-runner gitlab/​gitlab-runner -f values.yaml -n gitlab-runner --version 0.70.5
  
Line 3253: Line 3263:
 https_proxy:​ "​http://​proxy.isp.un:​3128/"​ https_proxy:​ "​http://​proxy.isp.un:​3128/"​
 ... ...
 +
 +После развертывания удалить на узлах /​etc/​systemd/​system/​containerd.service.d/​http-proxy.conf
 </​code>​ </​code>​
 ==== Kustomize ​ ==== ==== Kustomize ​ ====
система_kubernetes.1782912880.txt.gz · Last modified: 2026/07/01 16:34 by val