mirror of https://github.com/kubernetes/kops.git
Use optional ConfigMap to configure k8s API endpoint for Calico
This commit is contained in:
parent
d739bae871
commit
2fe6ee4b37
|
@ -1,6 +1,18 @@
|
||||||
# Pulled and modified from:
|
# Pulled and modified from: https://docs.projectcalico.org/v3.16/manifests/calico-typha.yaml
|
||||||
# https://docs.projectcalico.org/v3.16/manifests/calico-bpf.yaml
|
|
||||||
# https://docs.projectcalico.org/v3.16/manifests/calico-typha.yaml
|
{{- if .Networking.Calico.BPFEnabled }}
|
||||||
|
---
|
||||||
|
# Set these to the IP and port of your API server; In BPF mode, we need to connect directly to the
|
||||||
|
# API server because we take over kube-proxy's role.
|
||||||
|
kind: ConfigMap
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: kubernetes-services-endpoint
|
||||||
|
namespace: kube-system
|
||||||
|
data:
|
||||||
|
KUBERNETES_SERVICE_HOST: "{{ .MasterInternalName }}"
|
||||||
|
KUBERNETES_SERVICE_PORT: "443"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
---
|
---
|
||||||
# Source: calico/templates/calico-config.yaml
|
# Source: calico/templates/calico-config.yaml
|
||||||
|
@ -13,12 +25,6 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
role.kubernetes.io/networking: "1"
|
role.kubernetes.io/networking: "1"
|
||||||
data:
|
data:
|
||||||
{{- if .Networking.Calico.BPFEnabled }}
|
|
||||||
# Set these to the IP and port of your API server; In BPF mode, we need to connect directly to the
|
|
||||||
# API server because we take over kube-proxy's role.
|
|
||||||
kubernetes_service_host: "{{ .MasterInternalName }}"
|
|
||||||
kubernetes_service_port: "443"
|
|
||||||
{{- end }}
|
|
||||||
# You must set a non-zero value for Typha replicas below.
|
# You must set a non-zero value for Typha replicas below.
|
||||||
typha_service_name: "{{- if .Networking.Calico.TyphaReplicas -}}calico-typha{{- else -}}none{{- end -}}"
|
typha_service_name: "{{- if .Networking.Calico.TyphaReplicas -}}calico-typha{{- else -}}none{{- end -}}"
|
||||||
# Configure the backend to use.
|
# Configure the backend to use.
|
||||||
|
@ -3766,19 +3772,6 @@ spec:
|
||||||
name: kubernetes-services-endpoint
|
name: kubernetes-services-endpoint
|
||||||
optional: true
|
optional: true
|
||||||
env:
|
env:
|
||||||
{{- if .Networking.Calico.BPFEnabled }}
|
|
||||||
# Overrides for kubernetes API server host/port. Needed in BPF mode.
|
|
||||||
- name: KUBERNETES_SERVICE_HOST
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: calico-config
|
|
||||||
key: kubernetes_service_host
|
|
||||||
- name: KUBERNETES_SERVICE_PORT
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: calico-config
|
|
||||||
key: kubernetes_service_port
|
|
||||||
{{- end }}
|
|
||||||
- name: KUBERNETES_NODE_NAME
|
- name: KUBERNETES_NODE_NAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
|
@ -3806,19 +3799,6 @@ spec:
|
||||||
name: kubernetes-services-endpoint
|
name: kubernetes-services-endpoint
|
||||||
optional: true
|
optional: true
|
||||||
env:
|
env:
|
||||||
{{- if .Networking.Calico.BPFEnabled }}
|
|
||||||
# Overrides for kubernetes API server host/port. Needed in BPF mode.
|
|
||||||
- name: KUBERNETES_SERVICE_HOST
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: calico-config
|
|
||||||
key: kubernetes_service_host
|
|
||||||
- name: KUBERNETES_SERVICE_PORT
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: calico-config
|
|
||||||
key: kubernetes_service_port
|
|
||||||
{{- end }}
|
|
||||||
# Name of the CNI config file to create.
|
# Name of the CNI config file to create.
|
||||||
- name: CNI_CONF_NAME
|
- name: CNI_CONF_NAME
|
||||||
value: "10-calico.conflist"
|
value: "10-calico.conflist"
|
||||||
|
@ -3870,19 +3850,6 @@ spec:
|
||||||
name: kubernetes-services-endpoint
|
name: kubernetes-services-endpoint
|
||||||
optional: true
|
optional: true
|
||||||
env:
|
env:
|
||||||
{{- if .Networking.Calico.BPFEnabled }}
|
|
||||||
# Overrides for kubernetes API server host/port. Needed in BPF mode.
|
|
||||||
- name: KUBERNETES_SERVICE_HOST
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: calico-config
|
|
||||||
key: kubernetes_service_host
|
|
||||||
- name: KUBERNETES_SERVICE_PORT
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: calico-config
|
|
||||||
key: kubernetes_service_port
|
|
||||||
{{- end }}
|
|
||||||
# Use Kubernetes API as the backing datastore.
|
# Use Kubernetes API as the backing datastore.
|
||||||
- name: DATASTORE_TYPE
|
- name: DATASTORE_TYPE
|
||||||
value: "kubernetes"
|
value: "kubernetes"
|
||||||
|
|
Loading…
Reference in New Issue