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/11/09 07:30]
val [Развертывание через Kubespray]
система_kubernetes [2026/11/10 20:51] (current)
val [Deployment]
Line 869: Line 869:
  
 #        image: gowebd #        image: gowebd
-#        imagePullPolicy:​ "IfNotPresent"+#        imagePullPolicy:​ "Always" ​  # for tag latest
  
 #        lifecycle: #        lifecycle:
Line 928: 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 997: Line 997:
  
   * [[#Metrics Server]]   * [[#Metrics Server]]
-  * Пакет OpenSSL [[Пакет OpenSSL#​Проверка производительности CPU]]+  * Пакет OpenSSL [[Пакет OpenSSL#​Проверка производительности ​CPU]] или [[Анализ производительности системы#​Стресс тестирование и выявление нагрузки на CPU]]
  
 <​code>​ <​code>​
Line 1702: 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 1747: 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 1796: 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 1825: Line 1823:
         lifecycle:         lifecycle:
         ...         ...
 +                test -f /​usr/​local/​apache2/​htdocs/​index.html && exit 0 
 +        ...
       volumes:       volumes:
       - name: htdocs-volume       - name: htdocs-volume
Line 1833: 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 2054: 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 2171: 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 2279: 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 2481: 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 2502: 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
  
система_kubernetes.1794198618.txt.gz · Last modified: 2026/11/09 07:30 by val