Skip to content
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
13 changes: 12 additions & 1 deletion cmd/openshift-install/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/openshift/installer/pkg/asset/installconfig"
"github.com/openshift/installer/pkg/asset/kubeconfig"
"github.com/openshift/installer/pkg/asset/manifests"
"github.com/openshift/installer/pkg/asset/templates"
destroybootstrap "github.com/openshift/installer/pkg/destroy/bootstrap"
)

Expand Down Expand Up @@ -59,6 +60,16 @@ var (
assets: []asset.WritableAsset{&manifests.Manifests{}, &manifests.Tectonic{}},
}

manifestTemplatesTarget = target{
name: "Manifest templates",
command: &cobra.Command{
Use: "manifest-templates",
Short: "Generates the unrendered Kubernetes manifest templates",
Long: "",
},
assets: []asset.WritableAsset{&templates.Templates{}},
}

ignitionConfigsTarget = target{
name: "Ignition Configs",
command: &cobra.Command{
Expand All @@ -84,7 +95,7 @@ var (
assets: []asset.WritableAsset{&cluster.TerraformVariables{}, &kubeconfig.Admin{}, &cluster.Cluster{}},
}

targets = []target{installConfigTarget, manifestsTarget, ignitionConfigsTarget, clusterTarget}
targets = []target{installConfigTarget, manifestTemplatesTarget, manifestsTarget, ignitionConfigsTarget, clusterTarget}
)

// Deprecated: Use 'create' subcommands instead.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
package bootkube

const (
// TectonicNamespace is the constant to represent contents of Tectonic_Namespace.yaml file
TectonicNamespace = `
---
apiVersion: v1
kind: Namespace
metadata:
name: tectonic-system # Create the namespace first.
labels: # network policy can only select by labels
name: tectonic-system
openshift.io/run-level: "1"
`
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package bootkube

const (
// OpenshiftWebConsoleNamespace is the constant to represent contents of Openshift_WebConsoleNamespace.yaml file
OpenshiftWebConsoleNamespace = `
---
apiVersion: v1
kind: Namespace
metadata:
Expand All @@ -12,5 +6,3 @@ metadata:
name: openshift-web-console
labels:
name: openshift-web-console
`
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-machine-config-operator
labels:
name: openshift-machine-config-operator
openshift.io/run-level: "1"
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package bootkube

const (
// OpenshiftClusterAPINamespace is the constant to represent contents of Openshift_ClusterApiNamespace.yaml file
OpenshiftClusterAPINamespace = `
---
apiVersion: v1
kind: Namespace
metadata:
Expand All @@ -12,5 +6,3 @@ metadata:
labels:
name: openshift-cluster-api
openshift.io/run-level: "1"
`
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
# This is the namespace used to hold the service-serving-cert-signer.
name: openshift-service-cert-signer
labels:
openshift.io/run-level: "1"
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package bootkube

const (
// AppVersionKind is the constant to represent contents of App_VersionKind.yaml file
AppVersionKind = `
---
apiVersion: "apiextensions.k8s.io/v1beta1"
kind: "CustomResourceDefinition"
metadata:
Expand All @@ -14,5 +8,3 @@ spec:
names:
plural: "appversions"
kind: "AppVersion"
`
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package bootkube

const (
// AppVersionTectonicNetwork is the constant to represent contents of App_VersionTectonicNetwork.yaml file
AppVersionTectonicNetwork = `
---
apiVersion: tco.coreos.com/v1
kind: AppVersion
metadata:
Expand All @@ -19,5 +13,3 @@ status:
paused: false
upgradereq: 1
upgradecomp: 0
`
)
17 changes: 17 additions & 0 deletions data/data/manifests/bootkube/cvo-overrides.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: config.openshift.io/v1
kind: ClusterVersion
metadata:
namespace: openshift-cluster-version
name: version
spec:
upstream: http://localhost:8080/graph
channel: fast
clusterID: {{.CVOClusterID}}
overrides:
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-cluster-network-operator
name: cluster-network-operator
unmanaged: true
- kind: APIService # packages.apps.redhat.com fails to start properly
name: v1alpha1.packages.apps.redhat.com
unmanaged: true
17 changes: 17 additions & 0 deletions data/data/manifests/bootkube/etcd-service-endpoints.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Endpoints
metadata:
name: etcd
namespace: kube-system
annotations:
alpha.installer.openshift.io/dns-suffix: {{.EtcdEndpointDNSSuffix}}
subsets:
- addresses:
{{- range $idx, $member := .EtcdEndpointHostnames }}
- ip: 192.0.2.{{ add $idx 1 }}
hostname: {{ $member }}
{{- end }}
ports:
- name: etcd
port: 2379
protocol: TCP
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package bootkube

const (
// EtcdServiceKubeSystem is the constant to represent contents of etcd-service.yaml file
EtcdServiceKubeSystem = `
---
apiVersion: v1
kind: Service
metadata:
Expand All @@ -18,5 +12,3 @@ spec:
- name: etcd
port: 2379
protocol: TCP
`
)
8 changes: 8 additions & 0 deletions data/data/manifests/bootkube/kube-cloud-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: kube-cloud-cfg
namespace: kube-system
type: Opaque
data:
config: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: etcd-serving-ca
namespace: kube-system
data:
ca-bundle.crt: |
{{.EtcdCaCert}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: root-ca
namespace: kube-system
data:
ca.crt: {{.RootCaCert}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: etcd-client
namespace: kube-system
type: SecretTypeTLS
data:
tls.crt: {{ .EtcdClientCert }}
tls.key: {{ .EtcdClientKey }}
16 changes: 16 additions & 0 deletions data/data/manifests/bootkube/legacy-cvo-overrides.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: clusterversion.openshift.io/v1
kind: CVOConfig
metadata:
namespace: openshift-cluster-version
name: cluster-version-operator
upstream: http://localhost:8080/graph
channel: fast
clusterID: {{.CVOClusterID}}
overrides:
- kind: Deployment # this conflicts with kube-core-operator
namespace: openshift-cluster-network-operator
name: cluster-network-operator
unmanaged: true
- kind: APIService # packages.apps.redhat.com fails to start properly
name: v1alpha1.packages.apps.redhat.com
unmanaged: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: machine-config-server-tls
namespace: openshift-machine-config-operator
type: Opaque
data:
tls.crt: {{.McsTLSCert}}
tls.key: {{.McsTLSKey}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: service-serving-cert-signer-signing-key
namespace: openshift-service-cert-signer
type: kubernetes.io/tls
data:
tls.crt: {{.ServiceServingCaCert}}
tls.key: {{.ServiceServingCaKey}}
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
package bootkube

import (
"text/template"
)

var (
// Pull is the constant to represent contents of pull.yaml file
Pull = template.Must(template.New("pull.json").Parse(`
{
"apiVersion": "v1",
"kind": "Secret",
Expand All @@ -19,5 +10,3 @@ var (
".dockerconfigjson": "{{.PullSecret}}"
}
}
`))
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
package bootkube

import (
"text/template"
)

var (
// TectonicNetworkOperator represents the template variable for tectonic-network-operator.yaml file
TectonicNetworkOperator = template.Must(template.New("tectonic-network-operator.yaml").Parse(`
---
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
Expand Down Expand Up @@ -67,5 +57,3 @@ spec:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
`))
)
13 changes: 13 additions & 0 deletions data/data/manifests/tectonic/binding-discovery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: discovery
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:discovery
subjects:
- kind: Group
name: 'system:unauthenticated'
- kind: Group
name: 'system:authenticated'
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
package tectonic

import (
"text/template"
)

var (
// CloudCredsSecret is the constant to represent contents of corresponding yaml file
CloudCredsSecret = template.Must(template.New("cloud-creds-secret.yaml").Parse(`
---
kind: Secret
apiVersion: v1
metadata:
Expand All @@ -24,5 +14,3 @@ data:
{{- else if .CloudCreds.OpenStack}}
clouds.yaml: {{.CloudCreds.OpenStack.Base64encodeCloudCreds}}
{{- end}}
`))
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package tectonic

const (
// AppVersionKubeAddon is the variable/constant representing the contents of the respective file
AppVersionKubeAddon = `
---
apiVersion: tco.coreos.com/v1
kind: AppVersion
metadata:
Expand All @@ -19,5 +13,3 @@ status:
paused: false
upgradereq: 1
upgradecomp: 0
`
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
package tectonic

import (
"text/template"
)

var (
// KubeAddonOperator is the variable/constant representing the contents of the respective file
KubeAddonOperator = template.Must(template.New("kube-addon-operator.yaml").Parse(`
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
Expand Down Expand Up @@ -59,5 +49,3 @@ spec:
items:
- key: addon-config
path: addon-config
`))
)
10 changes: 10 additions & 0 deletions data/data/manifests/tectonic/role-admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: admin
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
- nonResourceURLs: ["*"]
verbs: ["*"]
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
package tectonic

import (
"text/template"
)

var (
// RoleCloudCredsSecretReader is the variable to represent contents of corresponding file
RoleCloudCredsSecretReader = template.Must(template.New("role-cloud-creds-secret-reader.yaml").Parse(`
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
Expand All @@ -26,5 +16,3 @@ rules:
resourceNames: ["openstack-creds"]
{{- end}}
verbs: ["get"]
`))
)
Loading