Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/kubernetes-sigs/kubespray:
  Allow hosts with hyphen in name (kubernetes-sigs#6529)
  Update apiserver-audit-policy.yaml.j2 (kubernetes-sigs#6526)
  add master_volume_type variable (kubernetes-sigs#6524)
  Remove unused variable (kubernetes-sigs#6522)
  Add new cilium options for native routing (kubernetes-sigs#6519)
  Fixed Kubespray container-engine/docker role to populate docker.service (kubernetes-sigs#6518)
  Fix cilium_deploy_additionally with kubeadm etcd (kubernetes-sigs#6514)
  improve Cilium metrics support (kubernetes-sigs#6513)
  • Loading branch information
erulabs committed Aug 18, 2020
2 parents 10c243b + 73b2683 commit 3cd81d6
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 11 deletions.
2 changes: 1 addition & 1 deletion contrib/inventory_builder/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def ips(start_address, end_address):
return [ip_address(ip).exploded for ip in range(start, end + 1)]

for host in hosts:
if '-' in host and not host.startswith('-'):
if '-' in host and not (host.startswith('-') or host[0].isalpha()):
start, end = host.strip().split('-')
try:
reworked_hosts.extend(ips(start, end))
Expand Down
1 change: 1 addition & 0 deletions contrib/terraform/openstack/kubespray.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module "compute" {
node_root_volume_size_in_gb = var.node_root_volume_size_in_gb
gfs_root_volume_size_in_gb = var.gfs_root_volume_size_in_gb
gfs_volume_size_in_gb = var.gfs_volume_size_in_gb
master_volume_type = var.master_volume_type
public_key_path = var.public_key_path
image = var.image
image_gfs = var.image_gfs
Expand Down
4 changes: 4 additions & 0 deletions contrib/terraform/openstack/modules/compute/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ resource "openstack_compute_instance_v2" "k8s_master" {
uuid = data.openstack_images_image_v2.vm_image.id
source_type = "image"
volume_size = var.master_root_volume_size_in_gb
volume_type = var.master_volume_type
boot_index = 0
destination_type = "volume"
delete_on_termination = true
Expand Down Expand Up @@ -215,6 +216,7 @@ resource "openstack_compute_instance_v2" "k8s_master_no_etcd" {
uuid = data.openstack_images_image_v2.vm_image.id
source_type = "image"
volume_size = var.master_root_volume_size_in_gb
volume_type = var.master_volume_type
boot_index = 0
destination_type = "volume"
delete_on_termination = true
Expand Down Expand Up @@ -303,6 +305,7 @@ resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip" {
uuid = data.openstack_images_image_v2.vm_image.id
source_type = "image"
volume_size = var.master_root_volume_size_in_gb
volume_type = var.master_volume_type
boot_index = 0
destination_type = "volume"
delete_on_termination = true
Expand Down Expand Up @@ -346,6 +349,7 @@ resource "openstack_compute_instance_v2" "k8s_master_no_floating_ip_no_etcd" {
uuid = data.openstack_images_image_v2.vm_image.id
source_type = "image"
volume_size = var.master_root_volume_size_in_gb
volume_type = var.master_volume_type
boot_index = 0
destination_type = "volume"
delete_on_termination = true
Expand Down
2 changes: 2 additions & 0 deletions contrib/terraform/openstack/modules/compute/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ variable "gfs_root_volume_size_in_gb" {}

variable "gfs_volume_size_in_gb" {}

variable "master_volume_type" {}

variable "public_key_path" {}

variable "image" {}
Expand Down
4 changes: 4 additions & 0 deletions contrib/terraform/openstack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ variable "gfs_volume_size_in_gb" {
default = 75
}

variable "master_volume_type" {
default = "Default"
}

variable "public_key_path" {
description = "The path of the ssh pub key"
default = "~/.ssh/id_rsa.pub"
Expand Down
2 changes: 1 addition & 1 deletion roles/container-engine/docker/tasks/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
dest: /etc/systemd/system/docker.service
register: docker_service_file
notify: restart docker
when: not (ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"] or is_ostree)
when: not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"]

- name: Write docker options systemd drop-in
template:
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes/kubeadm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@
- etcd_kubeadm_enabled
- kubeadm_control_plane
- inventory_hostname not in groups['kube-master']
- kube_network_plugin in ["calico", "flannel", "canal", "cilium"]
- kube_network_plugin in ["calico", "flannel", "canal", "cilium"] or cilium_deploy_additionally | default(false) | bool
- kube_network_plugin != "calico" or calico_datastore == "etcd"
6 changes: 0 additions & 6 deletions roles/kubernetes/master/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ kube_apiserver_node_port_range: "30000-32767"
# ETCD backend for k8s data
kube_apiserver_storage_backend: etcd3

# By default, force back to etcd2. Set to true to force etcd3 (experimental!)
force_etcd3: false

kube_etcd_cacert_file: ca.pem
kube_etcd_cert_file: node-{{ inventory_hostname }}.pem
kube_etcd_key_file: node-{{ inventory_hostname }}-key.pem
Expand Down Expand Up @@ -166,9 +163,6 @@ kube_encryption_algorithm: "aescbc"
# Which kubernetes resources to encrypt
kube_encryption_resources: [secrets]

# You may want to use ca.pem depending on your situation
kube_front_proxy_ca: "front-proxy-ca.pem"

# If non-empty, will use this string as identification instead of the actual hostname
kube_override_hostname: >-
{%- if cloud_provider is defined and cloud_provider in [ 'aws' ] -%}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: audit.k8s.io/v1beta1
apiVersion: audit.k8s.io/v1
kind: Policy
rules:
{% if audit_policy_custom_rules is defined and audit_policy_custom_rules != "" %}
Expand Down
10 changes: 10 additions & 0 deletions roles/network_plugin/cilium/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cilium_cpu_requests: 100m
cilium_tunnel_mode: vxlan
# Optional features
cilium_enable_prometheus: false
cilium_enable_hubble_metrics: false
# Enable if you want to make use of hostPort mappings
cilium_enable_portmap: false
# Monitor aggregation level (none/low/medium/maximum)
Expand All @@ -39,3 +40,12 @@ cilium_enable_legacy_services: false
# Deploy cilium even if kube_network_plugin is not cilium.
# This enables to deploy cilium alongside another CNI to replace kube-proxy.
cilium_deploy_additionally: false

# Auto direct nodes routes can be used to advertise pods routes in your cluster
# without any tunelling (with `cilium_tunnel_mode` sets to `disabled`).
# This works only if you have a L2 connectivity between all your nodes.
# You wil also have to specify the variable `cilium_native_routing_cidr` to
# make this work. Please refer to the cilium documentation for more
# information about this kind of setups.
cilium_auto_direct_node_routes: false
cilium_native_routing_cidr: ""
3 changes: 3 additions & 0 deletions roles/network_plugin/cilium/templates/cilium-config.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,6 @@ data:
enable-legacy-services: "{{cilium_enable_legacy_services}}"

kube-proxy-replacement: "{{ cilium_kube_proxy_replacement }}"

native-routing-cidr: "{{ cilium_native_routing_cidr }}"
auto-direct-node-routes: "{{ cilium_auto_direct_node_routes }}"
12 changes: 12 additions & 0 deletions roles/network_plugin/cilium/templates/cilium-deploy.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
type: RollingUpdate
template:
metadata:
{% if cilium_enable_prometheus %}
annotations:
prometheus.io/port: "6942"
prometheus.io/scrape: "true"
{% endif %}
labels:
io.cilium/app: operator
name: cilium-operator
Expand Down Expand Up @@ -93,6 +98,13 @@ spec:
image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
imagePullPolicy: {{ k8s_image_pull_policy }}
name: cilium-operator
{% if cilium_enable_prometheus %}
ports:
- containerPort: 6942
hostPort: 6942
name: prometheus
protocol: TCP
{% endif %}
livenessProbe:
httpGet:
{% if cilium_enable_ipv4 %}
Expand Down
10 changes: 9 additions & 1 deletion roles/network_plugin/cilium/templates/cilium-ds.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,20 @@ spec:
successThreshold: 1
timeoutSeconds: 5
name: cilium-agent
{% if cilium_enable_prometheus %}
{% if cilium_enable_prometheus or cilium_enable_hubble_metrics %}
ports:
{% endif %}
{% if cilium_enable_prometheus %}
- containerPort: 9090
hostPort: 9090
name: prometheus
protocol: TCP
{% endif %}
{% if cilium_enable_hubble_metrics %}
- containerPort: 9091
hostPort: 9091
name: hubble-metrics
protocol: TCP
{% endif %}
readinessProbe:
httpGet:
Expand Down

0 comments on commit 3cd81d6

Please sign in to comment.