forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
data/bootstrap: Pull content out of pkg/asset/ignition/bootstrap
It's easier for humans and linters to find this content if it's not hidden in Go variables. Since we're effectively pulling these files from Git now (either at build time or at run-time depending on release vs. dev mode in hack/build.sh), I'm being a bit more relaxed about file modes than the previous implementation. Files are now either 0555 (if they are in a 'bin' directory) or 0600 (if they aren't). This is a change for files like manifests.Manifests, which had previously been 0644. I've flattened the manifest overrides into a single directly, because the filenames are sufficient for sorting them by operator. And all of the override manifests now have their own comment explaining their target and eventual location.
- Loading branch information
Showing
18 changed files
with
308 additions
and
339 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...otstrap/files/opt/tectonic/bootkube-config-overrides/kube-apiserver-config-overrides.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kubecontrolplane.config.openshift.io/v1 | ||
kind: KubeAPIServerConfig | ||
kubeletClientInfo: | ||
ca: "" # kubelet uses self-signed serving certs. TODO: fix kubelet pki |
2 changes: 2 additions & 0 deletions
2
...iles/opt/tectonic/bootkube-config-overrides/kube-controller-manager-config-overrides.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apiVersion: kubecontrolplane.config.openshift.io/v1 | ||
kind: KubeControllerManagerConfig |
61 changes: 61 additions & 0 deletions
61
data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-daemonset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This is needed by kube-proxy. | ||
# TODO: move to the networking operator renderer. | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
labels: | ||
k8s-app: kube-proxy | ||
tier: node | ||
name: kube-proxy | ||
namespace: kube-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: kube-proxy | ||
tier: node | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: kube-proxy | ||
tier: node | ||
spec: | ||
containers: | ||
- command: | ||
- ./hyperkube | ||
- proxy | ||
- --cluster-cidr=10.3.0.0/16 | ||
- --hostname-override=$(NODE_NAME) | ||
- --kubeconfig=/etc/kubernetes/kubeconfig | ||
- --proxy-mode=iptables | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
image: quay.io/coreos/hyperkube:v1.9.3_coreos.0 | ||
name: kube-proxy | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- mountPath: /etc/ssl/certs | ||
name: ssl-certs-host | ||
readOnly: true | ||
- mountPath: /etc/kubernetes | ||
name: kubeconfig | ||
readOnly: true | ||
hostNetwork: true | ||
serviceAccountName: kube-proxy | ||
tolerations: | ||
- operator: Exists | ||
volumes: | ||
- hostPath: | ||
path: /etc/ssl/certs | ||
name: ssl-certs-host | ||
- name: kubeconfig | ||
secret: | ||
defaultMode: 420 | ||
secretName: kube-proxy-kubeconfig | ||
updateStrategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
type: RollingUpdate |
14 changes: 14 additions & 0 deletions
14
...strap/files/opt/tectonic/manifest-overrides/kube-proxy-kube-system-rbac-role-binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This is needed by kube-proxy. | ||
# TODO: move to the networking operator renderer. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: system:default-sa | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: kube-system |
7 changes: 7 additions & 0 deletions
7
.../data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-kubeconfig.yaml.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: kube-proxy-kubeconfig | ||
namespace: kube-system | ||
data: | ||
kubeconfig: {{ .AdminKubeConfigBase64 }} |
14 changes: 14 additions & 0 deletions
14
data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-role-binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This is needed by kube-proxy. | ||
# TODO: move to the networking operator renderer. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kube-proxy | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:node-proxier # Automatically created system role. | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kube-proxy | ||
namespace: kube-system |
7 changes: 7 additions & 0 deletions
7
data/data/bootstrap/files/opt/tectonic/manifest-overrides/kube-proxy-service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This is needed by kube-proxy. | ||
# TODO: move to the networking operator renderer. | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
namespace: kube-system | ||
name: kube-proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
data/data/bootstrap/files/usr/local/bin/report-progress.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
KUBECONFIG="${1}" | ||
NAME="${2}" | ||
MESSAGE="${3}" | ||
TIMESTAMP="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" | ||
|
||
echo "Reporting install progress..." | ||
|
||
oc --config="$KUBECONFIG" create -f - <<EOF | ||
apiVersion: v1 | ||
kind: Event | ||
metadata: | ||
name: "${NAME}" | ||
namespace: kube-system | ||
involvedObject: | ||
namespace: kube-system | ||
message: "${MESSAGE}" | ||
firstTimestamp: "${TIMESTAMP}" | ||
lastTimestamp: "${TIMESTAMP}" | ||
count: 1 | ||
source: | ||
component: cluster | ||
host: $(hostname) | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Bootstrap a Kubernetes cluster | ||
Wants=kubelet.service | ||
After=kubelet.service | ||
ConditionPathExists=!/opt/tectonic/.bootkube.done | ||
|
||
[Service] | ||
WorkingDirectory=/opt/tectonic | ||
ExecStart=/usr/local/bin/bootkube.sh | ||
|
||
Restart=on-failure | ||
RestartSec=5s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Unit] | ||
Description=Report the completion of the cluster bootstrap process | ||
# Workaround for https://github.com/systemd/systemd/issues/1312 | ||
Wants=bootkube.service tectonic.service | ||
After=bootkube.service tectonic.service | ||
|
||
[Service] | ||
# Workaround for https://github.com/systemd/systemd/issues/1312 and https://github.com/opencontainers/runc/pull/1807 | ||
ExecStartPre=/usr/bin/test -f /opt/tectonic/.bootkube.done | ||
ExecStartPre=/usr/bin/test -f /opt/tectonic/.tectonic.done | ||
ExecStart=/usr/local/bin/report-progress.sh /opt/tectonic/auth/kubeconfig bootstrap-complete "cluster bootstrapping has completed" | ||
|
||
Restart=on-failure | ||
RestartSec=5s | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Bootstrap a Tectonic cluster | ||
Wants=bootkube.service | ||
After=bootkube.service | ||
ConditionPathExists=!/opt/tectonic/.tectonic.done | ||
|
||
[Service] | ||
WorkingDirectory=/opt/tectonic/tectonic | ||
ExecStart=/usr/local/bin/tectonic.sh /opt/tectonic/auth/kubeconfig | ||
|
||
Restart=on-failure | ||
RestartSec=5s |
Oops, something went wrong.