Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ff3cd4f
[CEM-16927] Created controller for device manager
lrebeja Dec 1, 2020
8527314
Use ubi in openshift (#462)
psykulsk Nov 17, 2020
1f06d68
Add encryption only when connecting https keystone endpoint
michalskalski Nov 19, 2020
bb50c0f
Revert R2011 specific changes
michalskalski Nov 19, 2020
58fd21e
Provisionmanager static config (#460)
Janek3d Nov 20, 2020
f04c339
Adding features for openshift/OVA for multinodes in operator.
Nov 24, 2020
e0726f9
Adding features for openshift/OVA for multinodes in operator2.
Nov 24, 2020
debf8c6
Removing some verifications that are redandant.
Nov 24, 2020
c7b70a8
Changed imagePullPolicy from Always to IfNotPresent (#467)
psykulsk Nov 24, 2020
5fc5a28
Removing some verifications that are redandant2.
Nov 24, 2020
33376fb
Contrailstatusmonitor r2011 update (#472) (#473)
psykulsk Nov 25, 2020
501a236
Add Service Type to Swift Proxy configuration.
Nov 24, 2020
df098c7
Change clientset to use config from config.GetConfig() (#468)
Janek3d Nov 26, 2020
f20611d
Rollback after unsuccessful upgrade of Command (#435)
kabart Nov 26, 2020
fc88c08
Add annotation to Swift Proxy LoadBalancer Service to pick correct Me…
katrybacka Nov 27, 2020
89a7165
Modified images pulled from docker.io to be pulled from hub.juniper.n…
psykulsk Nov 27, 2020
2e92d35
Add keystone authentication mode to kubemanager's config (#474)
Janek3d Nov 27, 2020
3cd59c5
Wait until all command pods get terminated (#480)
Nov 30, 2020
eba9afc
Move templates package out of api directory (#481)
Nov 30, 2020
57d6ac2
[CEM-16927] Fixed pod stack in creation.
lrebeja Dec 2, 2020
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
1 change: 1 addition & 0 deletions cmd/manager/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ go_library(
"@com_github_operator_framework_operator_sdk//pkg/metrics:go_default_library",
"@com_github_operator_framework_operator_sdk//version:go_default_library",
"@com_github_spf13_pflag//:go_default_library",
"@io_k8s_client_go//kubernetes:go_default_library",
"@io_k8s_client_go//plugin/pkg/client/auth:go_default_library",
"@io_k8s_sigs_controller_runtime//pkg/client/config:go_default_library",
"@io_k8s_sigs_controller_runtime//pkg/log:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
_ "github.com/operator-framework/operator-sdk/pkg/metrics"
sdkVersion "github.com/operator-framework/operator-sdk/version"
"github.com/spf13/pflag"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"sigs.k8s.io/controller-runtime/pkg/client/config"
logf "sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -91,7 +92,7 @@ func main() {
os.Exit(1)
}

clientset, err := v1alpha1.GetClientset()
clientset, err := kubernetes.NewForConfig(cfg)
if err != nil {
log.Error(err, "")
os.Exit(1)
Expand Down
50 changes: 28 additions & 22 deletions contrail-provisioner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,31 +351,37 @@ func getAPIClient(apiServerObj *APIServer, keystoneAuthParameters *KeystoneAuthP
}

func setupAuthKeystone(client *contrail.Client, keystoneAuthParameters *KeystoneAuthParameters) {
// AddEncryption expected http url in older versions of contrail-go-api
// https://github.com/Juniper/contrail-go-api/commit/4c876ba038a8ecec211376133375d467b6098202
var authUrl string
var keystone *contrail.KeepaliveKeystoneClient
if strings.HasPrefix(keystoneAuthParameters.AuthUrl, "https") {
authUrl = strings.Replace(keystoneAuthParameters.AuthUrl, "https", "http", 1)
// AddEncryption expected http url in older versions of contrail-go-api
// https://github.com/Juniper/contrail-go-api/commit/4c876ba038a8ecec211376133375d467b6098202
keystone = contrail.NewKeepaliveKeystoneClient(
strings.Replace(keystoneAuthParameters.AuthUrl, "https", "http", 1),
keystoneAuthParameters.TenantName,
keystoneAuthParameters.AdminUsername,
keystoneAuthParameters.AdminPassword,
"",
)
err := keystone.AddEncryption(
keystoneAuthParameters.Encryption.CA,
keystoneAuthParameters.Encryption.Key,
keystoneAuthParameters.Encryption.Cert,
keystoneAuthParameters.Encryption.Insecure)

if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
} else {
authUrl = keystoneAuthParameters.AuthUrl
}
keystone := contrail.NewKeepaliveKeystoneClient(
authUrl,
keystoneAuthParameters.TenantName,
keystoneAuthParameters.AdminUsername,
keystoneAuthParameters.AdminPassword,
"",
)
err := keystone.AddEncryption(
keystoneAuthParameters.Encryption.CA,
keystoneAuthParameters.Encryption.Key,
keystoneAuthParameters.Encryption.Cert,
keystoneAuthParameters.Encryption.Insecure)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
keystone = contrail.NewKeepaliveKeystoneClient(
keystoneAuthParameters.AuthUrl,
keystoneAuthParameters.TenantName,
keystoneAuthParameters.AdminUsername,
keystoneAuthParameters.AdminPassword,
"",
)
}
err = keystone.AuthenticateV3()
err := keystone.AuthenticateV3()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down
5 changes: 3 additions & 2 deletions deploy/1-create-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ rules:
- fernetkeymanagers
- contrailmonitors
- contrailstatusmonitors
- devicemanagers
verbs:
- '*'
- apiGroups:
Expand Down Expand Up @@ -196,12 +197,12 @@ spec:
- name: init
# Replace this with the built image name
image: registry:5000/contrail-operator/engprod-269421/contrail-operator-crdsloader:master.latest
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
containers:
- name: contrail-operator
# Replace this with the built image name
image: registry:5000/contrail-operator/engprod-269421/contrail-operator:master.latest
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
16 changes: 16 additions & 0 deletions deploy/crds/contrail.juniper.net_commands_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@ spec:
type: array
contrailVersion:
type: string
endpoints:
items:
description: CommandEndpoint is used to register extra endpoints
in Command
properties:
name:
type: string
privateURL:
type: string
publicURL:
type: string
type: object
type: array
keystoneInstance:
type: string
keystoneSecretName:
Expand Down Expand Up @@ -184,13 +197,16 @@ spec:
replicas:
format: int32
type: integer
targetContainerImage:
type: string
upgradeState:
enum:
- ""
- upgrading
- not upgrading
- shutting down before upgrade
- starting upgraded deployment
- upgrade failed
type: string
type: object
type: object
Expand Down
42 changes: 42 additions & 0 deletions deploy/crds/contrail.juniper.net_devicemanagers_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: devicemanagers.contrail.juniper.net
spec:
group: contrail.juniper.net
names:
kind: Devicemanager
listKind: DevicemanagerList
plural: devicemanagers
singular: devicemanager
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: Devicemanager is the Schema for the devicemanagers API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: DevicemanagerSpec defines the desired state of Devicemanager
type: object
status:
description: DevicemanagerStatus defines the observed state of Devicemanager
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
18 changes: 18 additions & 0 deletions deploy/crds/contrail.juniper.net_kubemanagers_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ spec:
description: KubemanagerServiceConfiguration is the Spec for the kubemanagers
API.
properties:
authMode:
enum:
- noauth
- keystone
type: string
cassandraNodesConfiguration:
description: CassandraClusterConfiguration stores all information
about Cassandra's endpoints.
Expand Down Expand Up @@ -195,6 +200,19 @@ spec:
type: boolean
ipFabricSubnets:
type: string
keystoneNodesConfiguration:
description: KeystoneClusterConfiguration defines all information
about Keystone's endpoints.
properties:
authProtocol:
type: string
endpoint:
type: string
port:
type: integer
userDomainName:
type: string
type: object
kubernetesAPIPort:
type: integer
kubernetesAPISSLPort:
Expand Down
87 changes: 48 additions & 39 deletions deploy/crds/contrail.juniper.net_managers_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,19 @@ spec:
type: array
contrailVersion:
type: string
endpoints:
items:
description: CommandEndpoint is used to register extra
endpoints in Command
properties:
name:
type: string
privateURL:
type: string
publicURL:
type: string
type: object
type: array
keystoneInstance:
type: string
keystoneSecretName:
Expand Down Expand Up @@ -464,13 +477,16 @@ spec:
replicas:
format: int32
type: integer
targetContainerImage:
type: string
upgradeState:
enum:
- ""
- upgrading
- not upgrading
- shutting down before upgrade
- starting upgraded deployment
- upgrade failed
type: string
type: object
type: object
Expand Down Expand Up @@ -1378,13 +1394,13 @@ spec:
kubemanagers:
items:
description: KubemanagerService defines desired configuration
of vRouter
of Kubemanager
properties:
metadata:
type: object
spec:
description: KubemanagerServiceSpec defines desired spec configuration
of vRouter
of Kubemanager
properties:
commonConfiguration:
description: PodConfiguration is the common services struct.
Expand Down Expand Up @@ -1487,6 +1503,11 @@ spec:
description: KubemanagerManagerServiceConfiguration defines
service configuration of Kubemanager
properties:
authMode:
enum:
- noauth
- keystone
type: string
cassandraInstance:
type: string
cloudOrchestrator:
Expand Down Expand Up @@ -1517,6 +1538,8 @@ spec:
type: boolean
ipFabricSubnets:
type: string
keystoneInstance:
type: string
kubernetesAPIPort:
type: integer
kubernetesAPISSLPort:
Expand Down Expand Up @@ -1873,26 +1896,14 @@ spec:
type: object
type: object
provisionManager:
description: ProvisionManager is the Schema for the provisionmanagers
API
description: ProvisionManagerService defines desired configuration
of ProvisionManager
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this
representation of an object. Servers should convert recognized
schemas to the latest internal value, and may reject unrecognized
values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource
this object represents. Servers may infer this from the endpoint
the client submits requests to. Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ProvisionManagerSpec defines the desired state
of ProvisionManager
description: ProvisionManagerServiceSpec defines desired spec
configuration of ProvisionManager
properties:
commonConfiguration:
description: PodConfiguration is the common services struct.
Expand Down Expand Up @@ -2036,25 +2047,6 @@ spec:
required:
- serviceConfiguration
type: object
status:
description: ProvisionManagerStatus defines the observed state
of ProvisionManager
properties:
active:
description: 'INSERT ADDITIONAL STATUS FIELD - define observed
state of cluster Important: Run "operator-sdk generate
k8s" to regenerate code after modifying this file Add
custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
type: boolean
globalConfiguration:
additionalProperties:
type: string
type: object
nodes:
additionalProperties:
type: string
type: object
type: object
type: object
rabbitmq:
description: Rabbitmq is the Schema for the rabbitmqs API.
Expand Down Expand Up @@ -2402,6 +2394,23 @@ spec:
type: string
ringConfigMapName:
type: string
service:
description: Service is the configuration of the
service that exposes a workload
properties:
annotations:
additionalProperties:
type: string
type: object
serviceType:
enum:
- ""
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
type: string
type: object
swiftConfSecretName:
type: string
swiftServiceName:
Expand Down Expand Up @@ -2471,12 +2480,12 @@ spec:
type: object
vrouters:
items:
description: VrouterService defines desired confgiuration of vRouter
description: VrouterService defines desired configuration of vRouter
properties:
metadata:
type: object
spec:
description: VrouterServiceSpec defines desired spec confgiuration
description: VrouterServiceSpec defines desired spec configuration
of vRouter
properties:
commonConfiguration:
Expand Down
Loading