Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Cilium agents to connect to apiserver explicitly #365

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manifests.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ locals {
cluster_domain_suffix = var.cluster_domain_suffix
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
server = format("https://%s:%s", var.api_servers[0], var.external_apiserver_port)
apiserver_host = var.api_servers[0]
apiserver_port = var.external_apiserver_port
daemonset_tolerations = var.daemonset_tolerations
token_id = random_password.bootstrap-token-id.result
token_secret = random_password.bootstrap-token-secret.result
Expand Down
10 changes: 10 additions & 0 deletions resources/cilium/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: KUBERNETES_SERVICE_HOST
valueFrom:
configMapKeyRef:
name: in-cluster
key: apiserver-host
- name: KUBERNETES_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: in-cluster
key: apiserver-port
ports:
# Not yet used, prefer exec's
- name: health
Expand Down
10 changes: 10 additions & 0 deletions resources/cilium/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: KUBERNETES_SERVICE_HOST
valueFrom:
configMapKeyRef:
name: in-cluster
key: apiserver-host
- name: KUBERNETES_SERVICE_PORT
valueFrom:
configMapKeyRef:
name: in-cluster
key: apiserver-port
- name: CILIUM_DEBUG
valueFrom:
configMapKeyRef:
Expand Down
10 changes: 10 additions & 0 deletions resources/manifests/in-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# in-cluster ConfigMap is for control plane components that must reach
# kube-apiserver before service IPs are available (e.g. 10.3.0.1)
apiVersion: v1
kind: ConfigMap
metadata:
name: in-cluster
namespace: kube-system
data:
apiserver-host: ${apiserver_host}
apiserver-port: "${apiserver_port}"