diff --git a/config.sample.yaml b/config.sample.yaml index 5a62249..10e86b0 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -83,6 +83,8 @@ modules: enabled: true account_email: g.stykalin@rockitsoft.ru storage: + local_path_provisioner: + data_dir: "/app/local-path-provisioner" longhorn: enabled: false secrets_store_csi_driver: diff --git a/examples/argo-cd-example.yaml b/examples/argo-cd-example.yaml deleted file mode 100644 index 1b95d1d..0000000 --- a/examples/argo-cd-example.yaml +++ /dev/null @@ -1 +0,0 @@ -https://github.com/argoproj/argocd-example-apps/tree/master/guestbook diff --git a/examples/demo-app/argocd-app.yaml b/examples/demo-app/argocd-app.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/examples/demo-app/raw/cluster-issuer.yaml b/examples/demo-app/raw/cluster-issuer.yaml deleted file mode 100644 index 086d4c2..0000000 --- a/examples/demo-app/raw/cluster-issuer.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: ClusterIssuer -metadata: - name: demo-app-issuer -spec: - acme: - server: https://acme-v02.api.letsencrypt.org/directory - email: reversstorm@gmail.com - privateKeySecretRef: - name: demo-app-acme-secret - solvers: - - http01: - ingress: - ingressTemplate: - metadata: - annotations: - kubernetes.io/ingress.class: nginx diff --git a/examples/demo-app/raw/ingress.yaml b/examples/demo-app/raw/ingress.yaml deleted file mode 100644 index 9f8f926..0000000 --- a/examples/demo-app/raw/ingress.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: demo-app-ingress - labels: - name: demo-app-ingress - annotations: - cert-manager.io/cluster-issuer: "demo-app-issuer" - nginx.ingress.kubernetes.io/cors-allow-headers: Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range - nginx.ingress.kubernetes.io/enable-cors: "true" - nginx.ingress.kubernetes.io/proxy-buffer-size: 128k - nginx.ingress.kubernetes.io/proxy-buffers: 4 256k - nginx.ingress.kubernetes.io/proxy-busy-buffers-size: 256k - nginx.ingress.kubernetes.io/ssl-redirect: "true" -spec: - ingressClassName: nginx - tls: - - hosts: - - demo.disk.lt.t1.cloud - secretName: kvazaric-frontend-tls - rules: - - host: demo.disk.lt.t1.cloud - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: kvazaric-frontend - port: - number: 80 diff --git a/examples/demo-app/raw/kvazaric-frontend/deployment.yaml b/examples/demo-app/raw/kvazaric-frontend/deployment.yaml deleted file mode 100644 index ec71ae2..0000000 --- a/examples/demo-app/raw/kvazaric-frontend/deployment.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kvazaric-frontend - labels: - app: kvazaric-frontend - app.kubernetes.io/component: "kvazaric-frontend" -spec: - replicas: 1 - selector: - matchLabels: - app: kvazaric-frontend - app.kubernetes.io/component: "kvazaric-frontend" - template: - metadata: - labels: - app: kvazaric-frontend - app.kubernetes.io/component: "kvazaric-frontend" - annotations: - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/agent-inject-secret-env: demo-app/kvazaric-frontend - vault.hashicorp.com/agent-inject-template-env: | - {{- with secret "demo-app/kvazaric-frontend" -}} - {{- range $key, $value := .Data.data }} - export {{ $key }}={{ $value }} - {{- end }} - {{- end }} - vault.hashicorp.com/auth-path: auth/kubernetes-local - vault.hashicorp.com/role: demo-app - spec: - imagePullSecrets: - - name: docker - serviceAccountName: demo-app - containers: - - name: kvazaric-frontend - image: harbor.disk.lt.t1.cloud/demo-app/frontend:dev-8d74ed10 - imagePullPolicy: Always - ports: - - containerPort: 3000 - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 50m - memory: 50Mi diff --git a/examples/demo-app/raw/kvazaric-frontend/service-account.yaml b/examples/demo-app/raw/kvazaric-frontend/service-account.yaml deleted file mode 100644 index 962a0cb..0000000 --- a/examples/demo-app/raw/kvazaric-frontend/service-account.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: demo-app diff --git a/examples/demo-app/raw/kvazaric-frontend/service.yaml b/examples/demo-app/raw/kvazaric-frontend/service.yaml deleted file mode 100644 index ac62fad..0000000 --- a/examples/demo-app/raw/kvazaric-frontend/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: kvazaric-frontend -spec: - selector: - app: kvazaric-frontend - app.kubernetes.io/component: "kvazaric-frontend" - ports: - - port: 80 - targetPort: 3000 diff --git a/examples/rollouts-app-test.yaml b/examples/rollouts-app-test.yaml deleted file mode 100644 index dbb7a74..0000000 --- a/examples/rollouts-app-test.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: canary-demo-preview -spec: - ports: - - port: 80 - targetPort: http - protocol: TCP - name: http - selector: - app: canary-demo ---- -apiVersion: v1 -kind: Service -metadata: - name: canary-demo -spec: - ports: - - port: 80 - targetPort: http - protocol: TCP - name: http - selector: - app: canary-demo ---- -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo -spec: - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - app: canary-demo - template: - metadata: - labels: - app: canary-demo - spec: - containers: - - name: canary-demo - image: argoproj/rollouts-demo:green - imagePullPolicy: Always - ports: - - name: http - containerPort: 8080 - protocol: TCP - resources: - requests: - memory: 32Mi - cpu: 5m - strategy: - canary: - canaryService: canary-demo-preview - steps: - - setWeight: 20 - - pause: {} - - setWeight: 40 - - pause: { duration: 10 } - - setWeight: 60 - - pause: { duration: 10 } - - setWeight: 80 - - pause: { duration: 10 } diff --git a/examples/vault-inject-example.yaml b/examples/vault-inject-example.yaml deleted file mode 100644 index b2d94a3..0000000 --- a/examples/vault-inject-example.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: vault-inject-example ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vault-inject-example-deployment -spec: - replicas: 1 - selector: - matchLabels: - app: vault-inject-example - template: - metadata: - labels: - app: vault-inject-example - annotations: - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/role: "vault-example" - vault.hashicorp.com/agent-inject-secret-env: "vault-example/creds" - vault.hashicorp.com/auth-path: "auth/kubernetes-local" - vault.hashicorp.com/agent-inject-template-env: | - {{- with secret "vault-example/creds" -}} - {{- range $key, $value := .Data.data }} - export {{ $key }}={{ $value }} - {{- end }} - {{- end }} - spec: - containers: - - name: app - image: "postgres:latest" - env: - - name: POSTGRES_PASSWORD - value: admin - serviceAccountName: vault-inject-example diff --git a/internal/config/modules_additional.go b/internal/config/modules_additional.go index 5aa040c..f55459b 100644 --- a/internal/config/modules_additional.go +++ b/internal/config/modules_additional.go @@ -52,6 +52,7 @@ type Additional struct { LocalPathProvisioner struct { StorageClassName string `yaml:"storage_class_name" env-default:"local-path"` ReclaimPolicy string `yaml:"reclaim_policy" env-default:"Delete"` + DataDir string `yaml:"data_dir" env-default:"/opt/local-path-provisioner/"` } `yaml:"local_path_provisioner"` Longhorn struct { ChartRef string `yaml:"chart_ref" env-default:"kube-forge/longhorn"` diff --git a/internal/resources/templates/kubespray/inventory/group_vars/k8s_cluster/addons.yml.tmpl b/internal/resources/templates/kubespray/inventory/group_vars/k8s_cluster/addons.yml.tmpl index d918bbe..8fafcfa 100644 --- a/internal/resources/templates/kubespray/inventory/group_vars/k8s_cluster/addons.yml.tmpl +++ b/internal/resources/templates/kubespray/inventory/group_vars/k8s_cluster/addons.yml.tmpl @@ -12,7 +12,7 @@ local_path_provisioner_enabled: true # local_path_provisioner_namespace: "local-path-storage" local_path_provisioner_storage_class: {{ .Modules.Additional.Storage.LocalPathProvisioner.StorageClassName }} local_path_provisioner_reclaim_policy: {{ .Modules.Additional.Storage.LocalPathProvisioner.ReclaimPolicy }} -# local_path_provisioner_claim_root: /opt/local-path-provisioner/ +local_path_provisioner_claim_root: {{ .Modules.Additional.Storage.LocalPathProvisioner.DataDir }} # local_path_provisioner_debug: false # local_path_provisioner_image_repo: "rancher/local-path-provisioner" # local_path_provisioner_image_tag: "v0.0.23" diff --git a/kubespray/inventory/group_vars/k8s_cluster/addons.yml b/kubespray/inventory/group_vars/k8s_cluster/addons.yml index d7d015a..1cd7750 100644 --- a/kubespray/inventory/group_vars/k8s_cluster/addons.yml +++ b/kubespray/inventory/group_vars/k8s_cluster/addons.yml @@ -12,7 +12,7 @@ local_path_provisioner_enabled: true # local_path_provisioner_namespace: "local-path-storage" local_path_provisioner_storage_class: local-path local_path_provisioner_reclaim_policy: Delete -# local_path_provisioner_claim_root: /opt/local-path-provisioner/ +local_path_provisioner_claim_root: /opt/local-path-provisioner/ # local_path_provisioner_debug: false # local_path_provisioner_image_repo: "rancher/local-path-provisioner" # local_path_provisioner_image_tag: "v0.0.23" diff --git a/kubespray/inventory/group_vars/k8s_cluster/k8s-cluster.yml b/kubespray/inventory/group_vars/k8s_cluster/k8s-cluster.yml index 95777c4..7b25fed 100644 --- a/kubespray/inventory/group_vars/k8s_cluster/k8s-cluster.yml +++ b/kubespray/inventory/group_vars/k8s_cluster/k8s-cluster.yml @@ -17,7 +17,7 @@ kube_token_dir: "{{ kube_config_dir }}/tokens" kube_api_anonymous_auth: true ## Change this to use another Kubernetes version, e.g. a current beta release -kube_version: v1.30.3 +kube_version: v1.29.0 # Where the binaries will be downloaded. # Note: ensure that you've enough disk space (about 1G) @@ -404,7 +404,4 @@ auto_renew_certificates: true kubeadm_patches: enabled: false source_dir: "{{ inventory_dir }}/patches" - dest_dir: "{{ kube_config_dir }}/patches" -## Kubelet additional settings -kubelet_custom_flags: - - "--root-dir=/app/k8s/kubelet" \ No newline at end of file + dest_dir: "{{ kube_config_dir }}/patches" \ No newline at end of file diff --git a/kubespray/inventory/hosts b/kubespray/inventory/hosts index b10172d..e861a80 100644 --- a/kubespray/inventory/hosts +++ b/kubespray/inventory/hosts @@ -1,17 +1,33 @@ -t1-disk-lt-k8s-test-master-01 ansible_host=10.100.20.47 ip=10.100.20.47 -t1-disk-lt-k8s-test-slave-01 ansible_host=10.100.20.48 ip=10.100.20.48 -t1-disk-lt-k8s-test-slave-02 ansible_host=10.100.20.49 ip=10.100.20.49 +t1-disk-lt-k8s-master-01 ansible_host=10.100.20.43 ip=10.100.20.43 +t1-disk-lt-k8s-master-02 ansible_host=10.100.20.38 ip=10.100.20.38 +t1-disk-lt-k8s-master-03 ansible_host=10.100.20.42 ip=10.100.20.42 +t1-disk-lt-k8s-slave-01 ansible_host=10.100.20.40 ip=10.100.20.40 +t1-disk-lt-k8s-slave-02 ansible_host=10.100.20.41 ip=10.100.20.41 +t1-disk-lt-k8s-slave-03 ansible_host=10.100.20.39 ip=10.100.20.39 +t1-disk-lt-k8s-slave-04 ansible_host=10.100.20.45 ip=10.100.20.45 +t1-disk-lt-k8s-slave-05 ansible_host=10.100.20.44 ip=10.100.20.44 +t1-disk-lt-k8s-slave-06 ansible_host=10.100.20.50 ip=10.100.20.50 +t1-disk-lt-k8s-slave-07 ansible_host=10.100.20.51 ip=10.100.20.51 [kube_control_plane] -t1-disk-lt-k8s-test-master-01 +t1-disk-lt-k8s-master-01 +t1-disk-lt-k8s-master-02 +t1-disk-lt-k8s-master-03 [etcd] -t1-disk-lt-k8s-test-master-01 +t1-disk-lt-k8s-master-01 +t1-disk-lt-k8s-master-02 +t1-disk-lt-k8s-master-03 [kube_node] -t1-disk-lt-k8s-test-slave-01 -t1-disk-lt-k8s-test-slave-02 +t1-disk-lt-k8s-slave-01 +t1-disk-lt-k8s-slave-02 +t1-disk-lt-k8s-slave-03 +t1-disk-lt-k8s-slave-04 +t1-disk-lt-k8s-slave-05 +t1-disk-lt-k8s-slave-06 +t1-disk-lt-k8s-slave-07 [k8s_cluster:children] kube_control_plane