Name vCPU RAM
k8s-control 2 4GB
k8s-worker-ops 2 6GB
k8s-worker-back 2 6GB
k8s-worker-run 2 4GB

Proxmox 환경 VM 에서 AWS 환경 대비 사전 구축 - Ubuntu 기반

자원을 최대한 절약하고 핵심 성능에 집중하고자 k3s를 선택

K3s 설치

kubeconfig=/etc/rancher/k3s/k3s.yaml

k8s-master

curl -sfL <https://get.k3s.io> | INSTALL_K3S_EXEC="--disable=traefik" sh -

Kourier와의 충돌을 방지하고자 traefik을 제외하고 설치 진행

K3S_TOKEN=/var/lib/rancher/k3s/server/node-token

k8s-worker

curl -sfL <https://get.k3s.io> | K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh -

Helm

curl -fsSL -o get_helm.sh <https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4>
chmod 700 get_helm.sh
./get_helm.sh

Install Knative by using the Knative Operator

helm repo add knative-operator <https://knative.github.io/operator>
helm install knative-operator --create-namespace --namespace knative-operator knative-operator/knative-operator
kubectl config set-context --current --namespace=knative-operator
kubectl get deployment knative-operator

Knative Custom Resource

apiVersion: v1
kind: Namespace
metadata:
  name: knative-serving
---
apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
  name: knative-serving
  namespace: knative-serving
spec:
  version: "1.20.0"
  ingress:
    kourier:
      enabled: true

  config:
    network:
      ingress-class: "kourier.ingress.networking.knative.dev"
    domain:
      "haifu.cloud": ""
    deployment:
      nodeSelector: |
        "group": "function"

    observability:
      "metrics.backend-destination": "prometheus"
      "metrics.request-metrics-backend-destination": "prometheus"

    tracing:
      "backend": "zipkin"
      "zipkin-endpoint": "<http://jaeger-collector.observability.svc:9411/api/v2/spans>"
      "sample-rate": "1.0"

  deployments:
  - name: controller
    nodeSelector:
      group: ops
  - name: autoscaler
    nodeSelector:
      group: ops
  - name: activator
    nodeSelector:
      group: ops
  - name: webhook
    nodeSelector:
      group: ops
  - name: autoscaler-hpa
    nodeSelector:
      group: ops
  - name: 3scale-kourier-gateway
    nodeSelector:
      group: ops
  - name: net-kourier-controller
    nodeSelector:
      group: ops