Skip to content

Commit

Permalink
Merge pull request #304 from rajatchopra/operators_wip
Browse files Browse the repository at this point in the history
tectonic manifests
  • Loading branch information
openshift-merge-robot authored Sep 21, 2018
2 parents 749b188 + dc4a94c commit dc4764d
Show file tree
Hide file tree
Showing 58 changed files with 932 additions and 113 deletions.
1 change: 1 addition & 0 deletions cmd/openshift-install/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func main() {
case manifestsCommand.FullCommand():
targetAssets = []asset.Asset{
assetStock.Manifests(),
assetStock.Tectonic(),
}
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/asset/ignition/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ go_library(
"//pkg/asset/ignition/content:go_default_library",
"//pkg/asset/installconfig:go_default_library",
"//pkg/asset/kubeconfig:go_default_library",
"//pkg/asset/manifests:go_default_library",
"//pkg/asset/tls:go_default_library",
"//pkg/types:go_default_library",
"//vendor/github.com/coreos/ignition/config/util:go_default_library",
Expand All @@ -28,7 +29,6 @@ go_library(
go_test(
name = "go_default_test",
srcs = [
"bootstrap_test.go",
"master_test.go",
"testasset_test.go",
"testutils_test.go",
Expand All @@ -37,7 +37,6 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/asset:go_default_library",
"//pkg/asset/ignition/content:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/github.com/vincent-petithory/dataurl:go_default_library",
],
Expand Down
10 changes: 9 additions & 1 deletion pkg/asset/manifests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ go_library(
"network-operator.go",
"operators.go",
"stock.go",
"tectonic.go",
"template.go",
"utils.go",
],
Expand All @@ -18,7 +19,14 @@ go_library(
"//pkg/asset:go_default_library",
"//pkg/asset/installconfig:go_default_library",
"//pkg/asset/kubeconfig:go_default_library",
"//pkg/asset/manifests/content:go_default_library",
"//pkg/asset/manifests/content/bootkube:go_default_library",
"//pkg/asset/manifests/content/tectonic/ingress:go_default_library",
"//pkg/asset/manifests/content/tectonic/rbac:go_default_library",
"//pkg/asset/manifests/content/tectonic/secrets:go_default_library",
"//pkg/asset/manifests/content/tectonic/security:go_default_library",
"//pkg/asset/manifests/content/tectonic/updater:go_default_library",
"//pkg/asset/manifests/content/tectonic/updater/appversions:go_default_library",
"//pkg/asset/manifests/content/tectonic/updater/operators:go_default_library",
"//pkg/asset/tls:go_default_library",
"//pkg/rhcos:go_default_library",
"//pkg/types:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// TectonicNamespace is the constant to represent contents of Tectonic_Namespace.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// IngressNamespace is the constant to represent contents of Ingress_Namespace.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// OpenshiftWebConsoleNamespace is the constant to represent contents of Openshift_WebConsoleNamespace.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// OpenshiftMachineConfigOperator is the constant to represent contents of Openshift_MachineConfigOperator.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// OpenshiftClusterAPINamespace is the constant to represent contents of Openshift_ClusterApiNamespace.yaml file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ go_library(
"pull.go",
"tectonic-network-operator.go",
],
importpath = "github.com/openshift/installer/pkg/asset/manifests/content",
importpath = "github.com/openshift/installer/pkg/asset/manifests/content/bootkube",
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// AppVersionKind is the constant to represent contents of App_VersionKind.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// AppVersionMao is the constant to represent contents of App_VersionMao.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// AppVersionTectonicNetwork is the constant to represent contents of App_VersionTectonicNetwork.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// MachineAPIOperator is the constant to represent contents of Machine_Api_Operator.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// MachineConfigOperator00ConfigCrd is the constant to represent contents of Machine_ConfigOperator00ConfigCrd.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// MachineConfigOperator01ImagesConfigmap is the constant to represent contents of Machine_ConfigOperator01ImagesConfigmap.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// MachineConfigOperator02Rbac is the constant to represent contents of manifest file machine-config-operator-02-rbac.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

const (
// OperatorstatusCrd is the constant to represent contents of Operatorstatus_Crd.yaml file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package content
package bootkube

import (
"text/template"
Expand Down
12 changes: 12 additions & 0 deletions pkg/asset/manifests/content/tectonic/ingress/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"cluster-config.go",
"pull.go",
"svc-account.go",
],
importpath = "github.com/openshift/installer/pkg/asset/manifests/content/tectonic/ingress",
visibility = ["//visibility:public"],
)
23 changes: 23 additions & 0 deletions pkg/asset/manifests/content/tectonic/ingress/cluster-config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package ingress

import (
"text/template"
)

var (
// ClusterConfig is the variable/constant representing the contents of the respective file
ClusterConfig = template.Must(template.New("cluster-config.yaml").Parse(`
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-config-v1
namespace: openshift-ingress
data:
ingress-config: |
apiVersion: v1
kind: TectonicIngressOperatorConfig
type: {{.IngressKind}}
statsPassword: {{.IngressStatusPassword}}
statsUsername: admin
`))
)
23 changes: 23 additions & 0 deletions pkg/asset/manifests/content/tectonic/ingress/pull.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package ingress

import (
"text/template"
)

var (
// Pull is the variable/constant representing the contents of the respective file
Pull = template.Must(template.New("pull.json").Parse(`
{
"apiVersion": "v1",
"kind": "Secret",
"type": "kubernetes.io/dockerconfigjson",
"metadata": {
"namespace": "openshift-ingress",
"name": "coreos-pull-secret"
},
"data": {
".dockerconfigjson": "{{.PullSecret}}"
}
}
`))
)
12 changes: 12 additions & 0 deletions pkg/asset/manifests/content/tectonic/ingress/svc-account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package ingress

const (
// SvcAccount is the variable/constant representing the contents of the respective file
SvcAccount = `
apiVersion: v1
kind: ServiceAccount
metadata:
name: tectonic-ingress-controller-operator
namespace: openshift-ingress
`
)
13 changes: 13 additions & 0 deletions pkg/asset/manifests/content/tectonic/rbac/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"binding-admin.go",
"binding-discovery.go",
"role-admin.go",
"role-user.go",
],
importpath = "github.com/openshift/installer/pkg/asset/manifests/content/tectonic/rbac",
visibility = ["//visibility:public"],
)
22 changes: 22 additions & 0 deletions pkg/asset/manifests/content/tectonic/rbac/binding-admin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package rbac

const (
// BindingAdmin is the variable/constant representing the contents of the respective file
BindingAdmin = `
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: admin-user
subjects:
- kind: ServiceAccount
namespace: tectonic-system
name: default
- kind: ServiceAccount
namespace: openshift-ingress
name: tectonic-ingress-controller-operator
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
`
)
20 changes: 20 additions & 0 deletions pkg/asset/manifests/content/tectonic/rbac/binding-discovery.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package rbac

const (
// BindingDiscovery is the variable/constant representing the contents of the respective file
BindingDiscovery = `
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'
`
)
17 changes: 17 additions & 0 deletions pkg/asset/manifests/content/tectonic/rbac/role-admin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package rbac

const (
// RoleAdmin is the variable/constant representing the contents of the respective file
RoleAdmin = `
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: admin
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
- nonResourceURLs: ["*"]
verbs: ["*"]
`
)
Loading

0 comments on commit dc4764d

Please sign in to comment.