-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Allow bootstrap configuration to be configured and reentrant #16571
Changes from all commits
3b88b4a
e7de2fd
79750e9
1b2f999
ae01595
13ef9b9
737d65b
a04e494
c9db154
c3d5830
ae05ccd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
allowDisabledDocker: false | ||
apiVersion: v1 | ||
authConfig: | ||
authenticationCacheSize: 1000 | ||
authenticationCacheTTL: 5m | ||
authorizationCacheSize: 1000 | ||
authorizationCacheTTL: 5m | ||
dnsDomain: cluster.local | ||
dnsIP: 0.0.0.0 | ||
dnsBindAddress: 0.0.0.0:53 | ||
dnsRecursiveResolvConf: "" | ||
dockerConfig: | ||
dockerShimRootDirectory: /var/lib/dockershim | ||
dockerShimSocket: /var/run/kubernetes/dockershim.sock | ||
execHandlerName: native | ||
enableUnidling: true | ||
imageConfig: | ||
format: openshift/origin-${component}:${version} | ||
latest: false | ||
iptablesSyncPeriod: 30s | ||
kind: NodeConfig | ||
kubeletArguments: | ||
cert-dir: | ||
- ./certificates | ||
feature-gates: | ||
- RotateKubeletClientCertificate=true,RotateKubeletServerCertificate=true | ||
masterClientConnectionOverrides: | ||
acceptContentTypes: application/vnd.kubernetes.protobuf,application/json | ||
burst: 40 | ||
contentType: application/vnd.kubernetes.protobuf | ||
qps: 20 | ||
masterKubeConfig: node.kubeconfig | ||
networkConfig: | ||
mtu: 1450 | ||
networkPluginName: redhat/openshift-ovs-multitenant | ||
nodeIP: "" | ||
proxyArguments: | ||
healthz-bind-address: | ||
- 0.0.0.0 | ||
healthz-port: | ||
- "10256" | ||
metrics-bind-address: | ||
- 0.0.0.0:10257 | ||
servingInfo: | ||
bindAddress: 0.0.0.0:10250 | ||
bindNetwork: tcp4 | ||
namedCertificates: null | ||
volumeConfig: | ||
localQuota: | ||
perFSGroup: null | ||
volumeDirectory: /var/lib/origin/volumes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
kind: DaemonSet | ||
apiVersion: extensions/v1beta1 | ||
metadata: | ||
name: sdn | ||
annotations: | ||
kubernetes.io/description: | | ||
This daemon set launches the OpenShift networking components (kube-proxy, DNS, and openshift-sdn). | ||
It expects that OVS is running on the node. | ||
spec: | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
component: network | ||
type: infra | ||
openshift.io/role: network | ||
annotations: | ||
scheduler.alpha.kubernetes.io/critical-pod: '' | ||
spec: | ||
# Requires fairly broad permissions - ability to read all services and network functions as well | ||
# as all pods. | ||
serviceAccountName: sdn | ||
hostNetwork: true | ||
hostPID: true | ||
containers: | ||
- name: network | ||
image: openshift/node:v3.7.0-alpha.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a parameterized version/tag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just an example, wanted to have the larger discussion about how static config flows from openshift/origin -> ansible first. Wanted to have something checked in that should be reproducible for a bit, then will be made formal and moved out of here. |
||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
#!/bin/sh | ||
set -o errexit | ||
# Take over network functions on the node | ||
rm -Rf /etc/cni/net.d/* | ||
rm -Rf /host/opt/cni/bin/* | ||
cp -Rf /opt/cni/bin/* /host/opt/cni/bin/ | ||
# Use whichever node-config exists | ||
cfg=/etc/openshift/node | ||
if [[ ! -f "${cfg}/node-config.yaml" ]]; then | ||
cfg=/etc/origin/node | ||
fi | ||
# Use the same config as the node, but with the service account token | ||
openshift cli config "--config=${cfg}/node.kubeconfig" view --flatten > /tmp/kubeconfig | ||
openshift cli config --config=/tmp/kubeconfig set-credentials sa "--token=$( cat /var/run/secrets/kubernetes.io/serviceaccount/token )" | ||
openshift cli config --config=/tmp/kubeconfig set-context "$( openshift cli config current-context)" --user=sa | ||
# Launch the network process | ||
exec openshift start network "--config=${cfg}/node-config.yaml" --kubeconfig=/tmp/kubeconfig --loglevel=5 | ||
|
||
securityContext: | ||
runAsUser: 0 | ||
# Permission could be reduced by selecting an appropriate SELinux policy | ||
privileged: true | ||
# TODO: debugging only | ||
imagePullPolicy: Never | ||
volumeMounts: | ||
# Directory which contains the host configuration. We look at both locations | ||
# to simplify setup. | ||
- mountPath: /etc/origin/node/ | ||
name: host-config | ||
readOnly: true | ||
- mountPath: /etc/openshift/node/ | ||
name: host-config-alt | ||
readOnly: true | ||
# Run directories where we need to be able to access sockets | ||
- mountPath: /var/run/dbus/ | ||
name: host-var-run-dbus | ||
readOnly: true | ||
- mountPath: /var/run/openvswitch/ | ||
name: host-var-run-ovs | ||
readOnly: true | ||
- mountPath: /var/run/kubernetes/ | ||
name: host-var-run-kubernetes | ||
readOnly: true | ||
# We mount our socket here | ||
- mountPath: /var/run/openshift-sdn | ||
name: host-var-run-openshift-sdn | ||
# CNI related mounts which we take over | ||
- mountPath: /host/opt/cni/bin | ||
name: host-opt-cni-bin | ||
- mountPath: /etc/cni/net.d | ||
name: host-etc-cni-netd | ||
- mountPath: /var/lib/cni/networks/openshift-sdn | ||
name: host-var-lib-cni-networks-openshift-sdn | ||
|
||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 200Mi | ||
env: | ||
- name: OPENSHIFT_DNS_DOMAIN | ||
value: cluster.local | ||
ports: | ||
- name: healthz | ||
containerPort: 10256 | ||
livenessProbe: | ||
initialDelaySeconds: 10 | ||
httpGet: | ||
path: /healthz | ||
port: 10256 | ||
scheme: HTTP | ||
lifecycle: | ||
# postStart: | ||
# exec: | ||
# command: | ||
# - /usr/bin/dbus-send | ||
# - --system | ||
# - --dest=uk.org.thekelleys.dnsmasq | ||
# - /uk/org/thekelleys/dnsmasq | ||
# - uk.org.thekelleys.SetDomainServers | ||
# - array:string:/in-addr.arpa/127.0.0.1,/$(OPENSHIFT_DNS_DOMAIN)/127.0.0.1 | ||
# preStop: | ||
# exec: | ||
# command: | ||
# - /usr/bin/dbus-send | ||
# - --system | ||
# - --dest=uk.org.thekelleys.dnsmasq | ||
# - /uk/org/thekelleys/dnsmasq | ||
# - uk.org.thekelleys.SetDomainServers | ||
# - "array:string:" | ||
|
||
volumes: | ||
# In bootstrap mode, the host config contains information not easily available | ||
# from other locations. | ||
- name: host-config | ||
hostPath: | ||
path: /etc/origin/node | ||
- name: host-config-alt | ||
hostPath: | ||
path: /etc/openshift/node | ||
- name: host-modules | ||
hostPath: | ||
path: /lib/modules | ||
|
||
- name: host-var-run-ovs | ||
hostPath: | ||
path: /var/run/openvswitch | ||
- name: host-var-run-kubernetes | ||
hostPath: | ||
path: /var/run/kubernetes | ||
- name: host-var-run-dbus | ||
hostPath: | ||
path: /var/run/dbus | ||
- name: host-var-run-openshift-sdn | ||
hostPath: | ||
path: /var/run/openshift-sdn | ||
|
||
- name: host-opt-cni-bin | ||
hostPath: | ||
path: /opt/cni/bin | ||
- name: host-etc-cni-netd | ||
hostPath: | ||
path: /etc/cni/net.d | ||
- name: host-var-lib-cni-networks-openshift-sdn | ||
hostPath: | ||
path: /var/lib/cni/networks/openshift-sdn |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
kind: DaemonSet | ||
apiVersion: extensions/v1beta1 | ||
metadata: | ||
name: ovs | ||
annotations: | ||
kubernetes.io/description: | | ||
This daemon set launches the openvswitch daemon. | ||
spec: | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
component: network | ||
type: infra | ||
openshift.io/role: network | ||
annotations: | ||
scheduler.alpha.kubernetes.io/critical-pod: '' | ||
spec: | ||
# Requires fairly broad permissions - ability to read all services and network functions as well | ||
# as all pods. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment isn't accurate for the OVS pod; it shouldn't need any kubernetes access at all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dns and kube-proxy are in there too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw something reading pods, will double check who it was. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I mean, that comment is correct where it appears in network-daemonset.yaml, but I was pointing out that the same comment also appears in network-ovs.yaml, where it's totally wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, thanks. |
||
serviceAccountName: sdn | ||
hostNetwork: true | ||
containers: | ||
- name: openvswitch | ||
image: openshift/openvswitch:v3.7.0-alpha.1 | ||
securityContext: | ||
runAsUser: 0 | ||
privileged: true | ||
volumeMounts: | ||
- mountPath: /lib/modules | ||
name: host-modules | ||
readOnly: true | ||
- mountPath: /run/openvswitch | ||
name: host-run-ovs | ||
- mountPath: /sys | ||
name: host-sys | ||
readOnly: true | ||
- mountPath: /etc/openvswitch | ||
name: host-config-openvswitch | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 200Mi | ||
limits: | ||
cpu: 200m | ||
memory: 300Mi | ||
|
||
volumes: | ||
- name: host-modules | ||
hostPath: | ||
path: /lib/modules | ||
- name: host-run-ovs | ||
hostPath: | ||
path: /run/openvswitch | ||
- name: host-sys | ||
hostPath: | ||
path: /sys | ||
- name: host-config-openvswitch | ||
hostPath: | ||
path: /etc/origin/openvswitch |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
kind: List | ||
apiVersion: v1 | ||
items: | ||
- kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
name: sdn | ||
namespace: openshift-node | ||
- apiVersion: authorization.openshift.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: sdn-cluster-reader | ||
roleRef: | ||
name: cluster-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sdn | ||
namespace: openshift-node | ||
- apiVersion: authorization.openshift.io/v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What @enj said. RBAC is source of truth now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an example role, not productized yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, but it prevents compatibility with kube without good reason. |
||
kind: ClusterRoleBinding | ||
metadata: | ||
name: sdn-reader | ||
roleRef: | ||
name: system:sdn-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sdn | ||
namespace: openshift-node | ||
# TODO: PSP binding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qps looks ok, but burst looks small
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually our default.