kontena / pharos-cluster

Pharos - The Kubernetes Distribution
https://k8spharos.dev/
Apache License 2.0
312 stars 43 forks source link

pharos-cluster init subcommand #1276

Open matti opened 5 years ago

matti commented 5 years ago

pharos-cluster init should create this or some good basic yaml structure:

hosts:
  - address: 192.168.110.100
    user: vagrant
    role: master
    ssh_key_path: ~/.ssh/my_key
  - address: 192.168.110.101
    user: vagrant
    role: worker
    ssh_key_path: ~/.ssh/my_key
network: {} # Use Weave networking with default config
addons:
  ingress-nginx:
    enabled: true # Enable Nginx ingress controller

because currently user needs to navigate to docs and copy/paste this anyway.

kke commented 5 years ago

Pharos::Config.new.to_yaml currently generates:

---
network:
  provider: weave
  service_cidr: 10.96.0.0/12
  pod_network_cidr: 10.32.0.0/12
  node_local_dns_cache: true
  firewalld:
    enabled: false
    open_ports:
    - port: '22'
      protocol: tcp
      roles:
      - "*"
    - port: '80'
      protocol: tcp
      roles:
      - worker
    - port: '443'
      protocol: tcp
      roles:
      - worker
    - port: '6443'
      protocol: tcp
      roles:
      - master
    - port: 30000-32767
      protocol: tcp
      roles:
      - "*"
    - port: 30000-32767
      protocol: udp
      roles:
      - "*"
  weave:
    no_masq_local: false
  calico:
    ipip_mode: Always
    nat_outgoing: true
    environment: {}
    mtu: 1500
  custom: {}
kube_proxy:
  mode: iptables
api: {}
etcd: {}
cloud: {}
authentication:
  token_webhook: {}
  oidc: {}
audit:
  webhook: {}
  file: {}
kubelet:
  read_only_port: false
control_plane:
  use_proxy: false
telemetry:
  enabled: true
pod_security_policy:
  default_policy: 00-pharos-privileged
image_repository: registry.pharos.sh/kontenapharos
addon_paths: []
addons: {}
container_runtime:
  insecure_registries: []

The pharos init should probably reflect that or vice versa?