-
-
Save zhangguanzhang/f2c225324aa64ca8b3cb02b3b1f51487 to your computer and use it in GitHub Desktop.
k0s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` | |
| $ cat > k0sctl.yaml << EOF | |
| apiVersion: k0sctl.k0sproject.io/v1beta1 | |
| kind: Cluster | |
| metadata: | |
| name: k0s-cluster | |
| user: admin | |
| spec: | |
| hosts: | |
| - ssh: | |
| address: 192.168.1.200 | |
| user: root | |
| port: 22 | |
| keyPath: ~/.ssh/id_ed25519 | |
| role: controller | |
| hooks: | |
| apply: | |
| before: | |
| - mkdir -p /opt/cni/bin/ | |
| - curl -sSL https://github.com/containernetworking/plugins/releases/download/v1.9.1/cni-plugins-linux-amd64-v1.9.1.tgz | tar -C /opt/cni/bin -xzf - | |
| - rm -f /opt/cni/bin/LICENSE /opt/cni/bin/README.md | |
| - chmod +x /opt/cni/bin/* | |
| - ssh: | |
| address: 192.168.1.201 | |
| user: root | |
| port: 22 | |
| keyPath: ~/.ssh/id_ed25519 | |
| role: worker | |
| hooks: | |
| apply: | |
| before: | |
| - mkdir -p /opt/cni/bin/ | |
| - curl -sSL https://github.com/containernetworking/plugins/releases/download/v1.9.1/cni-plugins-linux-amd64-v1.9.1.tgz | tar -C /opt/cni/bin -xzf - | |
| - rm -f /opt/cni/bin/LICENSE /opt/cni/bin/README.md | |
| - chmod +x /opt/cni/bin/* | |
| - ssh: | |
| address: 192.168.1.202 | |
| user: root | |
| port: 22 | |
| keyPath: ~/.ssh/id_ed25519 | |
| role: worker | |
| hooks: | |
| apply: | |
| before: | |
| - mkdir -p /opt/cni/bin/ | |
| - curl -sSL https://github.com/containernetworking/plugins/releases/download/v1.9.1/cni-plugins-linux-amd64-v1.9.1.tgz | tar -C /opt/cni/bin -xzf - | |
| - rm -f /opt/cni/bin/LICENSE /opt/cni/bin/README.md | |
| - chmod +x /opt/cni/bin/* | |
| - ssh: | |
| address: 192.168.1.203 | |
| user: root | |
| port: 22 | |
| keyPath: ~/.ssh/id_ed25519 | |
| role: worker | |
| hooks: | |
| apply: | |
| before: | |
| - mkdir -p /opt/cni/bin/ | |
| - curl -sSL https://github.com/containernetworking/plugins/releases/download/v1.9.1/cni-plugins-linux-amd64-v1.9.1.tgz | tar -C /opt/cni/bin -xzf - | |
| - rm -f /opt/cni/bin/LICENSE /opt/cni/bin/README.md | |
| - chmod +x /opt/cni/bin/* | |
| k0s: | |
| config: | |
| spec: | |
| network: | |
| provider: custom | |
| options: | |
| wait: | |
| enabled: false | |
| drain: | |
| enabled: true | |
| gracePeriod: 2m0s | |
| timeout: 5m0s | |
| force: true | |
| ignoreDaemonSets: true | |
| deleteEmptyDirData: true | |
| podSelector: "" | |
| skipWaitForDeleteTimeout: 0s | |
| concurrency: | |
| limit: 30 | |
| workerDisruptionPercent: 10 | |
| uploads: 5 | |
| evictTaint: | |
| enabled: false | |
| taint: k0sctl.k0sproject.io/evict=true | |
| effect: NoExecute | |
| controllerWorkers: false | |
| EOF | |
| ``` | |
| 然后 apply | |
| ```shell | |
| k0sctl apply --config k0sctl.yaml | |
| ``` | |
| 然后安装 flannel | |
| ``` | |
| alias k='k0s kubectl' | |
| mkdir -p ~/.kube/ | |
| k0sctl kubeconfig > ~/.kube/config | |
| k0s kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml | |
| ``` | |
| ## 删除的话 | |
| ``` | |
| k0sctl reset --config k0sctl.yaml | |
| ``` |
Author
Author
Author
victoriametrics
https://docs.victoriametrics.com/helm/
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm repo update
kubectl create ns monitoring
cat << EOF| kubectl apply -f -
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: vmui
namespace: monitoring
spec:
gatewayClassName: eg
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: Same
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: vm-stack-grafana
namespace: monitoring
spec:
hostnames:
- grafana.sa.k8slocal
parentRefs:
- name: vmui
rules:
- backendRefs:
- group: ""
kind: Service
name: vm-stack-grafana
port: 80
weight: 1
matches:
- path:
type: PathPrefix
value: /
EOF
cat > vm-stack.values << EOF
vmsingle:
spec:
retentionPeriod: "2d"
route:
enabled: true
hostnames:
- vm.sa.k8slocal
parentRefs:
- name: vmui
namespace: monitoring
grafana:
adminUser: admin
adminPassword: 'xxxxxxxx'
persistence:
enabled: true
plugins:
- victoriametrics-logs-datasource
defaultDatasources:
extra:
- name: VictoriaLogs
type: victoriametrics-logs-datasource
access: proxy
url: http://vlogs-victoria-logs-single-server.monitoring.svc:9428
- name: VictoriaTraces (Jaeger)
type: jaeger
access: proxy
url: http://vtraces-vt-single-server.monitoring.svc:10428/select/jaeger
- name: VictoriaTraces (Tempo)
type: tempo
access: proxy
url: http://vtraces-vt-single-server.monitoring.svc:10428/select/tempo
EOF
helm install -n monitoring vm-stack vm/victoria-metrics-k8s-stack -f vm-stack.values
helm install -n monitoring vlogs vm/victoria-logs-single
helm install -n monitoring vlogs-collector vm/victoria-logs-collector --set 'remoteWrite[0].url=http://vlogs-victoria-logs-single-server.monitoring.svc.cluster.local:9428'
# https://github.com/VictoriaMetrics/VictoriaTraces/tree/master/deployment/docker
helm install -n monitoring vtraces vm/victoria-traces-single
cat > otel-demo.yaml << EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: hotrod
spec:
replicas: 1
selector:
matchLabels:
app: hotrod
template:
metadata:
labels:
app: hotrod
spec:
containers:
- name: hotrod
image: jaegertracing/example-hotrod:1.70.0
args:
- all
env:
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
value: http://vtraces-vt-single-server.monitoring.svc.cluster.local:10428/insert/opentelemetry/v1/traces
ports:
- name: web
containerPort: 8080
- name: admin
containerPort: 8083
---
apiVersion: v1
kind: Service
metadata:
name: hotrod
spec:
type: NodePort
selector:
app: hotrod
ports:
- name: web
port: 8080
targetPort: 8080
nodePort: 30080
- name: admin
port: 8083
targetPort: 8083
nodePort: 30083
EOF
Author
fluxcd
kubectl create ns flux-system
helm install -n flux-system flux oci://ghcr.io/fluxcd-community/charts/flux2
# ---
# apiVersion: v1
# kind: Secret
# metadata:
# name: git-auth
# type: Opaque
# data:
# username: <BASE64>
# password: <BASE64>
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo
namespace: default
spec:
interval: 5m0s
url: https://github.com/stefanprodan/podinfo
ref:
branch: master
# secretRef:
# name: git-auth
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
envoy
安装 envoy-gateway https://gateway.envoyproxy.io/docs/install/install-helm/
metalLB
安装 metalLB:
metalLB demo https://metallb.io/usage/