diff --git a/.gitignore b/.gitignore index d04aebe61..e19c0f5dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build/contrail-api-client build/contrail-go-api bazel-* +.vscode diff --git a/build/Dockerfile b/build/Dockerfile deleted file mode 100644 index ee98a51f3..000000000 --- a/build/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM registry.access.redhat.com/ubi7/ubi-minimal:latest - -ENV OPERATOR=/usr/local/bin/contrail-operator \ - USER_UID=1001 \ - USER_NAME=contrail-operator - -# install operator binary -COPY build/_output/bin/contrail-operator ${OPERATOR} - -COPY build/bin /usr/local/bin -RUN /usr/local/bin/user_setup - -ENTRYPOINT ["/usr/local/bin/entrypoint"] - -USER ${USER_UID} diff --git a/build/bin/entrypoint b/build/bin/entrypoint deleted file mode 100755 index 12bb55978..000000000 --- a/build/bin/entrypoint +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -e - -# This is documented here: -# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines - -if ! whoami &>/dev/null; then - if [ -w /etc/passwd ]; then - echo "${USER_NAME:-contrail-manager}:x:$(id -u):$(id -g):${USER_NAME:-contrail-manager} user:${HOME}:/sbin/nologin" >> /etc/passwd - fi -fi - -exec ${OPERATOR} $@ diff --git a/build/bin/user_setup b/build/bin/user_setup deleted file mode 100755 index 1e36064cb..000000000 --- a/build/bin/user_setup +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -x - -# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be) -mkdir -p ${HOME} -chown ${USER_UID}:0 ${HOME} -chmod ug+rwx ${HOME} - -# runtime user will need to be able to self-insert in /etc/passwd -chmod g+rw /etc/passwd - -# no need for this script to remain in the image after running -rm $0 diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 6043b66a6..20762880e 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -8,7 +8,7 @@ steps: - BRANCH_NAME=$BRANCH_NAME - TAG_NAME=$TAG_NAME - REVISION_ID=$REVISION_ID - args: ['test', '--config=remote', '//pkg/apis/contrail/v1alpha1/tests:go_default_test'] + args: ['test', '--config=remote', '//pkg/...'] - name: 'gcr.io/cloud-builders/bazel' args: ['run', '--config=remote', '//cmd/manager:contrail-operator-push' ] env: @@ -49,6 +49,26 @@ steps: - BRANCH_NAME=$BRANCH_NAME - TAG_NAME=$TAG_NAME - REVISION_ID=$REVISION_ID +- name: 'gcr.io/cloud-builders/bazel' + args: ['run', '--config=remote', '//statusmonitor:contrail-statusmonitor-push-debug' ] + env: + - BUILD_ID=$BUILD_ID + - COMMIT_SHA=$COMMIT_SHA + - SHORT_SHA=$SHORT_SHA + - REPO_NAME=$REPO_NAME + - BRANCH_NAME=$BRANCH_NAME + - TAG_NAME=$TAG_NAME + - REVISION_ID=$REVISION_ID +- name: 'gcr.io/cloud-builders/bazel' + args: ['run', '--config=remote', '//statusmonitor:contrail-statusmonitor-push-debug-latest' ] + env: + - BUILD_ID=$BUILD_ID + - COMMIT_SHA=$COMMIT_SHA + - SHORT_SHA=$SHORT_SHA + - REPO_NAME=$REPO_NAME + - BRANCH_NAME=$BRANCH_NAME + - TAG_NAME=$TAG_NAME + - REVISION_ID=$REVISION_ID - name: 'gcr.io/cloud-builders/bazel' args: ['run', '--config=remote', '//contrail-provisioner:contrail-provisioner-push' ] env: @@ -69,6 +89,26 @@ steps: - BRANCH_NAME=$BRANCH_NAME - TAG_NAME=$TAG_NAME - REVISION_ID=$REVISION_ID +- name: 'gcr.io/cloud-builders/bazel' + args: ['run', '--config=remote', '//contrail-provisioner:contrail-provisioner-push-debug' ] + env: + - BUILD_ID=$BUILD_ID + - COMMIT_SHA=$COMMIT_SHA + - SHORT_SHA=$SHORT_SHA + - REPO_NAME=$REPO_NAME + - BRANCH_NAME=$BRANCH_NAME + - TAG_NAME=$TAG_NAME + - REVISION_ID=$REVISION_ID +- name: 'gcr.io/cloud-builders/bazel' + args: ['run', '--config=remote', '//contrail-provisioner:contrail-provisioner-push-debug-latest' ] + env: + - BUILD_ID=$BUILD_ID + - COMMIT_SHA=$COMMIT_SHA + - SHORT_SHA=$SHORT_SHA + - REPO_NAME=$REPO_NAME + - BRANCH_NAME=$BRANCH_NAME + - TAG_NAME=$TAG_NAME + - REVISION_ID=$REVISION_ID timeout: '1h' options: machineType: 'N1_HIGHCPU_8' diff --git a/contrail-provisioner/BUILD.bazel b/contrail-provisioner/BUILD.bazel index 281740add..9c15011e0 100644 --- a/contrail-provisioner/BUILD.bazel +++ b/contrail-provisioner/BUILD.bazel @@ -39,7 +39,7 @@ container_push( format = "Docker", registry = "gcr.io", repository = "eng-prod-237922/contrail-provisioner", - tag = "{BUILD_SCM_BRANCH}.{BUILD_SCM_REVISION}" + tag = "{BUILD_SCM_BRANCH}.{BUILD_SCM_REVISION}", ) container_push( @@ -48,7 +48,7 @@ container_push( format = "Docker", registry = "gcr.io", repository = "eng-prod-237922/contrail-provisioner", - tag = "{BUILD_SCM_BRANCH}.latest" + tag = "{BUILD_SCM_BRANCH}.latest", ) go_image( @@ -64,6 +64,15 @@ container_push( image = ":contrail-provisioner-image-debug", format = "Docker", registry = "gcr.io", - repository = "eng-prod-237922/contrail-provisioner", - tag = "{BUILD_SCM_VERSION}", + repository = "eng-prod-237922/contrail-provisioner-debug", + tag = "{BUILD_SCM_BRANCH}.{BUILD_SCM_REVISION}", +) + +container_push( + name = "contrail-provisioner-push-debug-latest", + image = ":contrail-provisioner-image-debug", + format = "Docker", + registry = "gcr.io", + repository = "eng-prod-237922/contrail-provisioner-debug", + tag = "{BUILD_SCM_BRANCH}.latest", ) diff --git a/deploy/kustomize/cluster.yaml b/deploy/kustomize/cluster.yaml new file mode 100644 index 000000000..87767a995 --- /dev/null +++ b/deploy/kustomize/cluster.yaml @@ -0,0 +1,304 @@ +--- +apiVersion: contrail.juniper.net/v1alpha1 +kind: Manager +metadata: + name: cluster1 + namespace: contrail +spec: + commonConfiguration: + hostNetwork: true + replicas: 1 + keystoneSecretInstance : cluster1-admin-password + services: + cassandras: + - metadata: + labels: + contrail_cluster: cluster1 + name: cassandra1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + cassandra: + image: $(DOCKER_REGISTRY)/cassandra:3.11.4 + init: + image: $(DOCKER_REGISTRY)/python:alpine + init2: + image: $(DOCKER_REGISTRY)/cassandra:3.11.4 + config: + metadata: + labels: + contrail_cluster: cluster1 + name: config1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + keystoneInstance: keystone + containers: + analyticsapi: + image: $(CONTRAIL_REGISTRY)/contrail-analytics-api:$(CONTRAIL_TAG) + api: + image: $(CONTRAIL_REGISTRY)/contrail-controller-config-api:$(CONTRAIL_TAG) + collector: + image: $(CONTRAIL_REGISTRY)/contrail-analytics-collector:$(CONTRAIL_TAG) + devicemanager: + image: $(CONTRAIL_REGISTRY)/contrail-controller-config-devicemgr:$(CONTRAIL_TAG) + dnsmasq: + image: $(CONTRAIL_REGISTRY)/contrail-controller-config-dnsmasq:$(CONTRAIL_TAG) + init: + image: $(CONTRAIL_REGISTRY)/python:alpine + init2: + image: $(DOCKER_REGISTRY)/busybox + nodeinit: + image: $(CONTRAIL_REGISTRY)/contrail-node-init:$(CONTRAIL_TAG) + redis: + image: $(DOCKER_REGISTRY)/redis:4.0.2 + schematransformer: + image: $(CONTRAIL_REGISTRY)/contrail-controller-config-schema:$(CONTRAIL_TAG) + servicemonitor: + image: $(CONTRAIL_REGISTRY)/contrail-controller-config-svcmonitor:$(CONTRAIL_TAG) + queryengine: + image: $(CONTRAIL_REGISTRY)/contrail-analytics-query-engine:$(CONTRAIL_TAG) + statusmonitor: + image: $(OPERATOR_REGISTRY)/contrail-statusmonitor:$(OPERATOR_TAG) + zookeeperInstance: zookeeper1 + authMode: keystone + controls: + - metadata: + labels: + contrail_cluster: cluster1 + control_role: master + name: control1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + control: + image: $(CONTRAIL_REGISTRY)/contrail-controller-control-control:$(CONTRAIL_TAG) + dns: + image: $(CONTRAIL_REGISTRY)/contrail-controller-control-dns:$(CONTRAIL_TAG) + init: + image: $(DOCKER_REGISTRY)/python:alpine + named: + image: $(CONTRAIL_REGISTRY)/contrail-controller-control-named:$(CONTRAIL_TAG) + nodeinit: + image: $(CONTRAIL_REGISTRY)/contrail-node-init:$(CONTRAIL_TAG) + statusmonitor: + image: $(CONTRAIL_REGISTRY)/contrail-statusmonitor:$(CONTRAIL_TAG) + zookeeperInstance: zookeeper1 + provisionManager: + metadata: + labels: + contrail_cluster: cluster1 + name: provmanager1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + replicas: 1 + serviceConfiguration: + keystoneInstance: keystone + containers: + init: + image: $(DOCKER_REGISTRY)/python:alpine + provisioner: + image: $(OPERATOR_REGISTRY)/contrail-provisioner:$(OPERATOR_TAG) + rabbitmq: + metadata: + labels: + contrail_cluster: cluster1 + name: rabbitmq1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + init: + image: $(DOCKER_REGISTRY)/python:alpine + rabbitmq: + image: $(DOCKER_REGISTRY)/rabbitmq:3.7 + webui: + metadata: + labels: + contrail_cluster: cluster1 + name: webui1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + keystoneInstance: keystone + containers: + init: + image: $(DOCKER_REGISTRY)/python:alpine + nodeinit: + image: $(CONTRAIL_REGISTRY)/contrail-node-init:$(CONTRAIL_TAG) + redis: + image: $(DOCKER_REGISTRY)/redis:4.0.2 + webuijob: + image: $(CONTRAIL_REGISTRY)/contrail-controller-webui-job:$(CONTRAIL_TAG) + webuiweb: + image: $(CONTRAIL_REGISTRY)/contrail-controller-webui-web:$(CONTRAIL_TAG) + zookeepers: + - metadata: + labels: + contrail_cluster: cluster1 + name: zookeeper1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + init: + image: $(DOCKER_REGISTRY)/python:alpine + zookeeper: + image: $(DOCKER_REGISTRY)/zookeeper:3.5.5 + command: + metadata: + name: command + spec: + commonConfiguration: + activate: true + create: true + hostNetwork: true + tolerations: + - effect: NoSchedule + operator: Exists + - effect: NoExecute + operator: Exists + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + configAPIURL: https://kind-control-plane:8082 + telemetryURL: https://kind-control-plane:8081 + postgresInstance: postgres + swiftInstance: swift + swiftProxyPort: 5080 + keystonePort: 5555 + keystoneInstance: keystone + containers: + api: + image: $(CONTRAIL_REGISTRY)/contrail-command:$(CONTRAIL_TAG) + init: + image: $(CONTRAIL_REGISTRY)/contrail-command:$(CONTRAIL_TAG) + wait-for-ready-conf: + image: $(DOCKER_REGISTRY)/busybox + keystone: + metadata: + name: keystone + spec: + commonConfiguration: + activate: true + create: true + hostNetwork: true + tolerations: + - effect: NoSchedule + operator: Exists + - effect: NoExecute + operator: Exists + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + memcachedInstance: "memcached" + postgresInstance: postgres + listenPort: 5555 + containers: + wait-for-ready-conf: + image: $(DOCKER_REGISTRY)/busybox + keystoneDbInit: + image: $(DOCKER_REGISTRY)/postgresql-client + keystoneInit: + image: $(KOLLA_REGISTRY)/centos-binary-keystone:$(KOLLA_TAG) + keystone: + image: $(KOLLA_REGISTRY)/centos-binary-keystone:$(KOLLA_TAG) + keystoneSsh: + image: $(KOLLA_REGISTRY)/centos-binary-keystone-ssh:$(KOLLA_TAG) + keystoneFernet: + image: $(KOLLA_REGISTRY)/centos-binary-keystone-fernet:$(KOLLA_TAG) + postgres: + metadata: + name: postgres + spec: + containers: + postgres: + image: $(DOCKER_REGISTRY)/postgres + wait-for-ready-conf: + image: $(DOCKER_REGISTRY)/busybox + memcached: + metadata: + name: memcached + namespace: contrail + spec: + serviceConfiguration: + container: + image: $(KOLLA_REGISTRY)/centos-binary-memcached:$(KOLLA_TAG) + swift: + metadata: + name: swift + spec: + serviceConfiguration: + credentialsSecretName: "swift-credentials-secret" + containers: + ring-reconciler: + image: $(KOLLA_REGISTRY)/centos-source-swift-base:$(KOLLA_TAG) + swiftProxyConfiguration: + memcachedInstance: "memcached" + keystoneInstance: "keystone" + listenPort: 5080 + containers: + init: + image: $(KOLLA_REGISTRY)/centos-binary-kolla-toolbox:$(KOLLA_TAG) + wait-for-ready-conf: + image: $(DOCKER_REGISTRY)/busybox + api: + image: $(KOLLA_REGISTRY)/centos-binary-swift-proxy-server:$(KOLLA_TAG) + swiftStorageConfiguration: + accountBindPort: 6001 + containerBindPort: 6002 + objectBindPort: 6000 + device: d1 + containers: + swiftObjectExpirer: + image: $(KOLLA_REGISTRY)/centos-binary-swift-object-expirer:$(KOLLA_TAG) + swiftObjectUpdater: + image: $(KOLLA_REGISTRY)/centos-binary-swift-object:$(KOLLA_TAG) + swiftObjectReplicator: + image: $(KOLLA_REGISTRY)/centos-binary-swift-object:$(KOLLA_TAG) + swiftObjectAuditor: + image: $(KOLLA_REGISTRY)/centos-binary-swift-object:$(KOLLA_TAG) + swiftObjectServer: + image: $(KOLLA_REGISTRY)/centos-binary-swift-object:$(KOLLA_TAG) + swiftContainerUpdater: + image: $(KOLLA_REGISTRY)/centos-binary-swift-container:$(KOLLA_TAG) + swiftContainerReplicator: + image: $(KOLLA_REGISTRY)/centos-binary-swift-container:$(KOLLA_TAG) + swiftContainerAuditor: + image: $(KOLLA_REGISTRY)/centos-binary-swift-container:$(KOLLA_TAG) + swiftContainerServer: + image: $(KOLLA_REGISTRY)/centos-binary-swift-container:$(KOLLA_TAG) + swiftAccountReaper: + image: $(KOLLA_REGISTRY)/centos-binary-swift-account:$(KOLLA_TAG) + swiftAccountReplicator: + image: $(KOLLA_REGISTRY)/centos-binary-swift-account:$(KOLLA_TAG) + swiftAccountAuditor: + image: $(KOLLA_REGISTRY)/centos-binary-swift-account:$(KOLLA_TAG) + swiftAccountServer: + image: $(KOLLA_REGISTRY)/centos-binary-swift-account:$(KOLLA_TAG) diff --git a/deploy/kustomize/images.yaml b/deploy/kustomize/images.yaml new file mode 100644 index 000000000..d020803af --- /dev/null +++ b/deploy/kustomize/images.yaml @@ -0,0 +1,12 @@ +apiVersion: v1alpha1 +kind: ContrailImages +metadata: + name: cluster1 +spec: + contrailRegistry: registry:5000 + dockerRegistry: registry:5000 + operatorRegistry: registry:5000 + kollaRegistry: registry:5000 + contrailTag: master.latest + operatorTag: master.latest + kollaTag: train diff --git a/deploy/kustomize/kustomization.yaml b/deploy/kustomize/kustomization.yaml new file mode 100644 index 000000000..e3b1092b4 --- /dev/null +++ b/deploy/kustomize/kustomization.yaml @@ -0,0 +1,57 @@ +resources: +- cluster.yaml +- images.yaml + +vars: +- name: CONTRAIL_REGISTRY + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.contrailRegistry +- name: DOCKER_REGISTRY + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.dockerRegistry +- name: OPERATOR_REGISTRY + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.operatorRegistry +- name: KOLLA_REGISTRY + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.kollaRegistry +- name: OPERATOR_TAG + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.operatorTag +- name: CONTRAIL_TAG + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.contrailTag +- name: KOLLA_TAG + objref: + kind: ContrailImages + name: cluster1 + apiVersion: v1alpha1 + fieldref: + fieldpath: spec.kollaTag + +configurations: +- kustomizeconfig/manager.yaml diff --git a/deploy/kustomize/kustomizeconfig/manager.yaml b/deploy/kustomize/kustomizeconfig/manager.yaml new file mode 100644 index 000000000..3dc0d35f1 --- /dev/null +++ b/deploy/kustomize/kustomizeconfig/manager.yaml @@ -0,0 +1,65 @@ +varReference: +- path: spec/services/cassandras/spec/serviceConfiguration/containers/cassandra/image +- path: spec/services/cassandras/spec/serviceConfiguration/containers/init/image +- path: spec/services/cassandras/spec/serviceConfiguration/containers/init2/image +- path: spec/services/config/spec/serviceConfiguration/containers/api/image +- path: spec/services/config/spec/serviceConfiguration/containers/analyticsapi/image +- path: spec/services/config/spec/serviceConfiguration/containers/collector/image +- path: spec/services/config/spec/serviceConfiguration/containers/devicemanager/image +- path: spec/services/config/spec/serviceConfiguration/containers/dnsmasq/image +- path: spec/services/config/spec/serviceConfiguration/containers/init/image +- path: spec/services/config/spec/serviceConfiguration/containers/init2/image +- path: spec/services/config/spec/serviceConfiguration/containers/nodeinit/image +- path: spec/services/config/spec/serviceConfiguration/containers/redis/image +- path: spec/services/config/spec/serviceConfiguration/containers/schematransformer/image +- path: spec/services/config/spec/serviceConfiguration/containers/servicemonitor/image +- path: spec/services/config/spec/serviceConfiguration/containers/queryengine/image +- path: spec/services/config/spec/serviceConfiguration/containers/statusmonitor/image +- path: spec/services/controls/spec/serviceConfiguration/containers/control/image +- path: spec/services/controls/spec/serviceConfiguration/containers/dns/image +- path: spec/services/controls/spec/serviceConfiguration/containers/init/image +- path: spec/services/controls/spec/serviceConfiguration/containers/named/image +- path: spec/services/controls/spec/serviceConfiguration/containers/nodeinit/image +- path: spec/services/controls/spec/serviceConfiguration/containers/statusmonitor/image +- path: spec/services/provisionManager/spec/serviceConfiguration/containers/init/image +- path: spec/services/provisionManager/spec/serviceConfiguration/containers/provisioner/image +- path: spec/services/rabbitmq/spec/serviceConfiguration/containers/init/image +- path: spec/services/rabbitmq/spec/serviceConfiguration/containers/rabbitmq/image +- path: spec/services/webui/spec/serviceConfiguration/containers/init/image +- path: spec/services/webui/spec/serviceConfiguration/containers/nodeinit/image +- path: spec/services/webui/spec/serviceConfiguration/containers/redis/image +- path: spec/services/webui/spec/serviceConfiguration/containers/webuijob/image +- path: spec/services/webui/spec/serviceConfiguration/containers/webuiweb/image +- path: spec/services/zookeepers/spec/serviceConfiguration/containers/init/image +- path: spec/services/zookeepers/spec/serviceConfiguration/containers/zookeeper/image +- path: spec/services/command/spec/serviceConfiguration/containers/api/image +- path: spec/services/command/spec/serviceConfiguration/containers/init/image +- path: spec/services/command/spec/serviceConfiguration/containers/wait-for-ready-conf/image +- path: spec/services/keystone/spec/serviceConfiguration/containers/wait-for-ready-conf/image +- path: spec/services/keystone/spec/serviceConfiguration/containers/keystoneDbInit/image +- path: spec/services/keystone/spec/serviceConfiguration/containers/keystoneInit/image +- path: spec/services/keystone/spec/serviceConfiguration/containers/keystone/image +- path: spec/services/keystone/spec/serviceConfiguration/containers/keystoneSsh/image +- path: spec/services/keystone/spec/serviceConfiguration/containers/keystoneFernet/image +- path: spec/services/postgres/spec/containers/postgres/image +- path: spec/services/postgres/spec/containers/wait-for-ready-conf/image +- path: spec/services/memcached/spec/serviceConfiguration/container/image +- path: spec/services/swift/spec/serviceConfiguration/containers/ring-reconciler/image +- path: spec/services/swift/spec/serviceConfiguration/swiftProxyConfiguration/containers/init/image +- path: spec/services/swift/spec/serviceConfiguration/swiftProxyConfiguration/containers/wait-for-ready-conf/image +- path: spec/services/swift/spec/serviceConfiguration/swiftProxyConfiguration/containers/api/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftObjectExpirer/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftObjectUpdater/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftObjectReplicator/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftObjectAuditor/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftObjectServer/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftContainerUpdater/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftContainerReplicator/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftContainerAuditor/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftContainerServer/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftAccountReaper/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftAccountReplicator/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftAccountAuditor/image +- path: spec/services/swift/spec/serviceConfiguration/swiftStorageConfiguration/containers/swiftAccountServer/image + + kind: Manager diff --git a/deploy/svl_artifactory/1-create-operator.yaml b/deploy/svl_artifactory/1-create-operator.yaml new file mode 100644 index 000000000..f4689a9d3 --- /dev/null +++ b/deploy/svl_artifactory/1-create-operator.yaml @@ -0,0 +1,4657 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: contrail +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + creationTimestamp: null + name: contrail-operator + namespace: contrail +rules: +- apiGroups: + - "" + resources: + - pods + - services + - endpoints + - persistentvolumeclaims + - events + - configmaps + - secrets + verbs: + - '*' +- apiGroups: + - apps + resources: + - deployments + - daemonsets + - replicasets + - statefulsets + verbs: + - '*' +- apiGroups: + - monitoring.coreos.com + resources: + - servicemonitors + verbs: + - get + - create +- apiGroups: + - apps + resourceNames: + - contrail-operator + resources: + - deployments/finalizers + verbs: + - update +- apiGroups: + - contrail.juniper.net + resources: + - '*' + - managers + - cassandras + - zookeepers + - rabbitmqs + - controls + - kubemanagers + - webuis + - vrouters + - provisionmanagers + - contrailcommands + - swiftstorages + - keystones + - swifts + - memcacheds + verbs: + - '*' +- apiGroups: + - storage + resources: + - storageclasses + verbs: + - '*' +- apiGroups: + - contrail + resources: + - '*' + verbs: + - '*' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: contrail-operator + namespace: contrail +rules: + - apiGroups: + - "*" + resources: + - "*" + verbs: + - "*" +#- apiGroups: +# - "" +# resources: +# - pods +# - services +# - endpoints +# - events +# - configmaps +# verbs: +# - get +# - list +# - update +# - watch +# - patch +#- apiGroups: +# - apiextensions.k8s.io +# - extensions +# resources: +# - customresourcedefinitions +# verbs: +# - get +# - create +# - list +# - update +# - watch +# - delete +# - patch +#- apiGroups: +# - rbac +# - rbac.authorization.k8s.io +# resources: +# - clusterroles +# - clusterrolebindings +# verbs: +# - get +# - create +# - list +# - update +# - watch +# - delete +# - patch +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: contrail-operator + namespace: contrail +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: contrail-operator + namespace: contrail +subjects: +- kind: ServiceAccount + name: contrail-operator + namespace: contrail +roleRef: + kind: Role + name: contrail-operator + apiGroup: rbac.authorization.k8s.io +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: contrail-operator + namespace: contrail +subjects: +- kind: ServiceAccount + name: contrail-operator + namespace: contrail +roleRef: + kind: ClusterRole + name: contrail-operator + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: cassandras.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Cassandra + listKind: CassandraList + plural: cassandras + singular: cassandra + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Cassandra is the Schema for the cassandras 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: CassandraSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: CassandraConfiguration is the Spec for the cassandras API. + properties: + clusterName: + type: string + containers: {} + cqlPort: + type: integer + jmxLocalPort: + type: integer + listenAddress: + type: string + maxHeapSize: + type: string + minHeapSize: + type: string + port: + type: integer + sslStoragePort: + type: integer + startRPC: + type: boolean + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + storagePort: + type: integer + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: CassandraStatus defines the status of the cassandra object. + properties: + active: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + description: CassandraStatusPorts defines the status of the ports of + the cassandra object. + properties: + cqlPort: + type: string + jmxPort: + type: string + port: + type: string + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: commands.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Command + listKind: CommandList + plural: commands + singular: command + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Command is the Schema for the commands 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: CommandSpec defines the desired state of Command + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: CommandConfiguration is the Spec for the Command configuration + properties: + clusterName: + type: string + configAPIURL: + type: string + containers: {} + keystoneInstance: + type: string + keystoneSecretName: + type: string + postgresInstance: + type: string + swiftInstance: + type: string + telemetryURL: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: CommandStatus defines the observed state of Command + properties: + active: + type: boolean + ips: + items: + type: string + type: array + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: configs.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Config + listKind: ConfigList + plural: configs + singular: config + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Config is the Schema for the configs 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: ConfigSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ConfigConfiguration is the Spec for the cassandras API. + properties: + aaaMode: + enum: + - noauth + - rbac + type: string + analyticsPort: + type: integer + apiPort: + type: integer + authMode: + enum: + - noauth + - keystone + type: string + cassandraInstance: + type: string + collectorPort: + type: integer + containers: {} + fabricMgmtIP: + type: string + keystoneInstance: + type: string + keystoneSecretName: + type: string + logLevel: + type: string + nodeManager: + type: boolean + rabbitmqPassword: + type: string + rabbitmqUser: + type: string + rabbitmqVhost: + type: string + redisPort: + type: integer + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + zookeeperInstance: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + configChanged: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + properties: + analyticsPort: + type: string + apiPort: + type: string + collectorPort: + type: string + redisPort: + type: string + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: controls.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Control + listKind: ControlList + plural: controls + singular: control + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Control is the Schema for the controls 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: ControlSpec is the Spec for the controls API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ControlConfiguration is the Spec for the controls API. + properties: + asnNumber: + type: integer + bgpPort: + type: integer + cassandraInstance: + type: string + containers: {} + dnsIntrospectPort: + type: integer + dnsPort: + type: integer + nodeManager: + type: boolean + rabbitmqPassword: + type: string + rabbitmqUser: + type: string + rabbitmqVhost: + type: string + xmppPort: + type: integer + zookeeperInstance: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + properties: + active: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + properties: + asnNumber: + type: string + bgpPort: + type: string + dnsIntrospectPort: + type: string + dnsPort: + type: string + xmppPort: + type: string + type: object + serviceStatus: + additionalProperties: + type: object + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: keystones.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Keystone + listKind: KeystoneList + plural: keystones + singular: keystone + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Keystone is the Schema for the keystones 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: KeystoneSpec defines the desired state of Keystone + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: KeystoneConfiguration is the Spec for the keystone API. + properties: + containers: {} + keystoneSecretName: + type: string + listenPort: + type: integer + memcachedInstance: + type: string + postgresInstance: + type: string + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: KeystoneStatus defines the observed state of Keystone + properties: + active: + type: boolean + ips: + items: + type: string + type: array + port: + type: integer + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: kubemanagers.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Kubemanager + listKind: KubemanagerList + plural: kubemanagers + singular: kubemanager + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Kubemanager is the Schema for the kubemanagers 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: KubemanagerSpec is the Spec for the kubemanagers API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: KubemanagerConfiguration is the Spec for the kubemanagers + API. + properties: + cassandraInstance: + type: string + cloudOrchestrator: + type: string + clusterRole: + type: string + clusterRoleBinding: + type: string + containers: {} + hostNetworkService: + type: boolean + ipFabricForwarding: + type: boolean + ipFabricSnat: + type: boolean + ipFabricSubnets: + type: string + kubernetesAPIPort: + type: integer + kubernetesAPISSLPort: + type: integer + kubernetesAPIServer: + type: string + kubernetesClusterName: + type: string + kubernetesTokenFile: + type: string + podSubnets: + type: string + rabbitmqPassword: + type: string + rabbitmqUser: + type: string + rabbitmqVhost: + type: string + serviceAccount: + type: string + serviceSubnets: + type: string + useKubeadmConfig: + type: boolean + zookeeperInstance: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + configChanged: + type: boolean + nodes: + additionalProperties: + type: string + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: managers.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Manager + listKind: ManagerList + plural: managers + singular: manager + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Manager is the Schema for the managers 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: ManagerSpec defines the desired state of Manager. + properties: + commonConfiguration: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "operator-sdk generate k8s" to regenerate code after + modifying this file Add custom validation using kubebuilder tags: + https://book.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + keystoneSecretName: + type: string + services: + description: Services defines the desired state of Services. + properties: + cassandras: + items: + description: Cassandra is the Schema for the cassandras 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: CassandraSpec is the Spec for the cassandras + API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will + be activated by Manager. + type: boolean + create: + description: Create defines if the service will be + created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option + is set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list + of references to secrets in the same namespace to + use for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator + . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values + and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must + be of effect NoExecute, otherwise this field + is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint + forever (do not evict). Zero and negative + values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the + value should be empty, otherwise just a regular + string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: CassandraConfiguration is the Spec for the + cassandras API. + properties: + clusterName: + type: string + containers: {} + cqlPort: + type: integer + jmxLocalPort: + type: integer + listenAddress: + type: string + maxHeapSize: + type: string + minHeapSize: + type: string + port: + type: integer + sslStoragePort: + type: integer + startRPC: + type: boolean + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + storagePort: + type: integer + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: CassandraStatus defines the status of the cassandra + object. + properties: + active: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + description: CassandraStatusPorts defines the status of + the ports of the cassandra object. + properties: + cqlPort: + type: string + jmxPort: + type: string + port: + type: string + type: object + type: object + type: object + type: array + command: + description: Command is the Schema for the commands 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: CommandSpec defines the desired state of Command + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will be + activated by Manager. + type: boolean + create: + description: Create defines if the service will be created + by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option is + set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of + references to secrets in the same namespace to use + for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to + tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must be + of effect NoExecute, otherwise this field is + ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever + (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value + should be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: CommandConfiguration is the Spec for the Command + configuration + properties: + clusterName: + type: string + configAPIURL: + type: string + containers: {} + keystoneInstance: + type: string + keystoneSecretName: + type: string + postgresInstance: + type: string + swiftInstance: + type: string + telemetryURL: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: CommandStatus defines the observed state of Command + properties: + active: + type: boolean + ips: + items: + type: string + type: array + type: object + type: object + config: + description: Config is the Schema for the configs 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: ConfigSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will be + activated by Manager. + type: boolean + create: + description: Create defines if the service will be created + by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option is + set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of + references to secrets in the same namespace to use + for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to + tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must be + of effect NoExecute, otherwise this field is + ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever + (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value + should be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ConfigConfiguration is the Spec for the cassandras + API. + properties: + aaaMode: + enum: + - noauth + - rbac + type: string + analyticsPort: + type: integer + apiPort: + type: integer + authMode: + enum: + - noauth + - keystone + type: string + cassandraInstance: + type: string + collectorPort: + type: integer + containers: {} + fabricMgmtIP: + type: string + keystoneInstance: + type: string + keystoneSecretName: + type: string + logLevel: + type: string + nodeManager: + type: boolean + rabbitmqPassword: + type: string + rabbitmqUser: + type: string + rabbitmqVhost: + type: string + redisPort: + type: integer + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + zookeeperInstance: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + configChanged: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + properties: + analyticsPort: + type: string + apiPort: + type: string + collectorPort: + type: string + redisPort: + type: string + type: object + type: object + type: object + controls: + items: + description: Control is the Schema for the controls 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: ControlSpec is the Spec for the controls API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will + be activated by Manager. + type: boolean + create: + description: Create defines if the service will be + created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option + is set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list + of references to secrets in the same namespace to + use for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator + . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values + and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must + be of effect NoExecute, otherwise this field + is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint + forever (do not evict). Zero and negative + values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the + value should be empty, otherwise just a regular + string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ControlConfiguration is the Spec for the + controls API. + properties: + asnNumber: + type: integer + bgpPort: + type: integer + cassandraInstance: + type: string + containers: {} + dnsIntrospectPort: + type: integer + dnsPort: + type: integer + nodeManager: + type: boolean + rabbitmqPassword: + type: string + rabbitmqUser: + type: string + rabbitmqVhost: + type: string + xmppPort: + type: integer + zookeeperInstance: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + properties: + active: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + properties: + asnNumber: + type: string + bgpPort: + type: string + dnsIntrospectPort: + type: string + dnsPort: + type: string + xmppPort: + type: string + type: object + serviceStatus: + additionalProperties: + type: object + type: object + type: object + type: object + type: array + keystone: + description: Keystone is the Schema for the keystones 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: KeystoneSpec defines the desired state of Keystone + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will be + activated by Manager. + type: boolean + create: + description: Create defines if the service will be created + by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option is + set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of + references to secrets in the same namespace to use + for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to + tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must be + of effect NoExecute, otherwise this field is + ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever + (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value + should be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: KeystoneConfiguration is the Spec for the keystone + API. + properties: + containers: {} + keystoneSecretName: + type: string + listenPort: + type: integer + memcachedInstance: + type: string + postgresInstance: + type: string + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: KeystoneStatus defines the observed state of Keystone + properties: + active: + type: boolean + ips: + items: + type: string + type: array + port: + type: integer + type: object + type: object + kubemanagers: + items: + description: Kubemanager is the Schema for the kubemanagers 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: KubemanagerSpec is the Spec for the kubemanagers + API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will + be activated by Manager. + type: boolean + create: + description: Create defines if the service will be + created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option + is set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list + of references to secrets in the same namespace to + use for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator + . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values + and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must + be of effect NoExecute, otherwise this field + is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint + forever (do not evict). Zero and negative + values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the + value should be empty, otherwise just a regular + string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: KubemanagerConfiguration is the Spec for + the kubemanagers API. + properties: + cassandraInstance: + type: string + cloudOrchestrator: + type: string + clusterRole: + type: string + clusterRoleBinding: + type: string + containers: {} + hostNetworkService: + type: boolean + ipFabricForwarding: + type: boolean + ipFabricSnat: + type: boolean + ipFabricSubnets: + type: string + kubernetesAPIPort: + type: integer + kubernetesAPISSLPort: + type: integer + kubernetesAPIServer: + type: string + kubernetesClusterName: + type: string + kubernetesTokenFile: + type: string + podSubnets: + type: string + rabbitmqPassword: + type: string + rabbitmqUser: + type: string + rabbitmqVhost: + type: string + serviceAccount: + type: string + serviceSubnets: + type: string + useKubeadmConfig: + type: boolean + zookeeperInstance: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + configChanged: + type: boolean + nodes: + additionalProperties: + type: string + type: object + type: object + type: object + type: array + memcached: + description: Memcached is the Schema for the memcacheds 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: MemcachedSpec defines the desired state of Memcached + properties: + serviceConfiguration: + properties: + connectionLimit: + format: int32 + type: integer + container: + description: Container defines name, image and command. + properties: + command: + items: + type: string + type: array + image: + type: string + type: object + listenPort: + format: int32 + type: integer + maxMemory: + format: int32 + type: integer + required: + - container + type: object + required: + - serviceConfiguration + type: object + status: + description: MemcachedStatus defines the observed state of Memcached + properties: + active: + type: boolean + node: + type: string + type: object + type: object + postgres: + description: Postgres is the Schema for the postgres 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: PostgresSpec defines the desired state of Postgres + properties: + containers: {} + hostNetwork: + type: boolean + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + type: object + status: + description: PostgresStatus defines the observed state of Postgres + properties: + active: + type: boolean + node: + type: string + type: object + type: object + provisionManager: + description: ProvisionManager is the Schema for the provisionmanagers + 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: ProvisionManagerSpec defines the desired state + of ProvisionManager + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will be + activated by Manager. + type: boolean + create: + description: Create defines if the service will be created + by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option is + set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of + references to secrets in the same namespace to use + for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to + tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must be + of effect NoExecute, otherwise this field is + ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever + (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value + should be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ProvisionManagerConfiguration defines the provision + manager configuration + properties: + containers: {} + keystoneInstance: + type: string + keystoneSecretName: + type: string + type: object + required: + - commonConfiguration + - 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. + 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: RabbitmqSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will be + activated by Manager. + type: boolean + create: + description: Create defines if the service will be created + by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option is + set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of + references to secrets in the same namespace to use + for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to + tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must be + of effect NoExecute, otherwise this field is + ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever + (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value + should be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: RabbitmqConfiguration is the Spec for the cassandras + API. + properties: + containers: {} + erlangCookie: + type: string + password: + type: string + port: + type: integer + secret: + type: string + sslPort: + type: integer + user: + type: string + vhost: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + properties: + port: + type: string + sslPort: + type: string + type: object + secret: + type: string + type: object + type: object + swift: + description: Swift is the Schema for the swifts 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: SwiftSpec defines the desired state of Swift + properties: + serviceConfiguration: + description: SwiftConfiguration is the Spec for the keystone + API. + properties: + containers: {} + credentialsSecretName: + type: string + ringsStorage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + swiftProxyConfiguration: + description: SwiftProxyConfiguration is the Spec for + the keystone API. + properties: + containers: {} + credentialsSecretName: + type: string + endpoint: + type: string + keystoneInstance: + type: string + keystoneSecretName: + type: string + listenPort: + type: integer + memcachedInstance: + type: string + ringPersistentVolumeClaim: + type: string + swiftConfSecretName: + type: string + type: object + swiftStorageConfiguration: + description: SwiftStorageConfiguration is the Spec for + the keystone API. + properties: + accountBindPort: + type: integer + containerBindPort: + type: integer + containers: {} + device: + type: string + objectBindPort: + type: integer + ringPersistentVolumeClaim: + type: string + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + swiftConfSecretName: + type: string + type: object + required: + - swiftProxyConfiguration + - swiftStorageConfiguration + type: object + required: + - serviceConfiguration + type: object + status: + description: SwiftStatus defines the observed state of Swift + properties: + active: + type: boolean + credentialsSecretName: + type: string + swiftProxyPort: + type: integer + type: object + type: object + vrouters: + items: + description: Vrouter is the Schema for the vrouters 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: VrouterSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will + be activated by Manager. + type: boolean + create: + description: Create defines if the service will be + created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option + is set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list + of references to secrets in the same namespace to + use for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator + . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values + and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must + be of effect NoExecute, otherwise this field + is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint + forever (do not evict). Zero and negative + values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the + value should be empty, otherwise just a regular + string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: VrouterConfiguration is the Spec for the + cassandras API. + properties: + cassandraInstance: + type: string + clusterRole: + type: string + clusterRoleBinding: + type: string + containers: {} + controlInstance: + type: string + distribution: + type: string + gateway: + type: string + metaDataSecret: + type: string + nodeManager: + type: boolean + physicalInterface: + type: string + serviceAccount: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + properties: + active: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + analyticsPort: + type: string + apiPort: + type: string + collectorPort: + type: string + redisPort: + type: string + type: object + type: object + type: object + type: array + webui: + description: Webui is the Schema for the webuis 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: WebuiSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will be + activated by Manager. + type: boolean + create: + description: Create defines if the service will be created + by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option is + set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of + references to secrets in the same namespace to use + for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to + tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must be + of effect NoExecute, otherwise this field is + ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever + (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the value + should be empty, otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: WebuiConfiguration is the Spec for the cassandras + API. + properties: + cassandraInstance: + type: string + clusterRole: + type: string + clusterRoleBinding: + type: string + containers: {} + keystoneInstance: + type: string + keystoneSecretName: + type: string + serviceAccount: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + nodes: + additionalProperties: + type: string + type: object + type: object + type: object + zookeepers: + items: + description: Zookeeper is the Schema for the zookeepers 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: ZookeeperSpec is the Spec for the zookeepers + API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services + struct. + properties: + activate: + description: Activate defines if the service will + be activated by Manager. + type: boolean + create: + description: Create defines if the service will be + created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. + Use the host's network namespace. If this option + is set, the ports that will be used must be specified. + Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list + of references to secrets in the same namespace to + use for pulling any of the images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer + to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator + . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values + and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must + be of effect NoExecute, otherwise this field + is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint + forever (do not evict). Zero and negative + values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the + value should be empty, otherwise just a regular + string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ZookeeperConfiguration is the Spec for the + zookeepers API. + properties: + clientPort: + type: integer + containers: {} + electionPort: + type: integer + serverPort: + type: integer + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: ZookeeperStatus defines the status of the zookeeper + object. + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + description: ZookeeperStatusPorts defines the status of + the ports of the zookeeper object. + properties: + clientPort: + type: string + type: object + type: object + type: object + type: array + type: object + type: object + status: + description: ManagerStatus defines the observed state of Manager. + properties: + cassandras: + items: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + type: array + command: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + conditions: + items: + description: ManagerCondition is used to represent cluster condition + properties: + status: + description: Status of the condition, one of True or False. + type: string + type: + description: Type of manager condition. + type: string + required: + - status + - type + type: object + type: array + config: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + controls: + items: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + type: array + crdStatus: + items: + description: CrdStatus tracks status of CRD. + properties: + active: + type: boolean + name: + type: string + type: object + type: array + keystone: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + kubemanagers: + items: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + type: array + memcached: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + postgres: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + provisionManager: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + rabbitmq: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + swift: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + vrouters: + items: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + type: array + webui: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + zookeepers: + items: + description: ServiceStatus provides information on the current status + of the service. + properties: + active: + type: boolean + created: + type: boolean + name: + type: string + type: object + type: array + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: memcacheds.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Memcached + listKind: MemcachedList + plural: memcacheds + singular: memcached + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: Memcached is the Schema for the memcacheds 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: MemcachedSpec defines the desired state of Memcached + properties: + serviceConfiguration: + properties: + connectionLimit: + format: int32 + type: integer + container: + description: Container defines name, image and command. + properties: + command: + items: + type: string + type: array + image: + type: string + type: object + listenPort: + format: int32 + type: integer + maxMemory: + format: int32 + type: integer + required: + - container + type: object + required: + - serviceConfiguration + type: object + status: + description: MemcachedStatus defines the observed state of Memcached + properties: + active: + type: boolean + node: + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: postgres.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Postgres + listKind: PostgresList + plural: postgres + singular: postgres + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Postgres is the Schema for the postgres 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: PostgresSpec defines the desired state of Postgres + properties: + containers: {} + hostNetwork: + type: boolean + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + type: object + status: + description: PostgresStatus defines the observed state of Postgres + properties: + active: + type: boolean + node: + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: provisionmanagers.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: ProvisionManager + listKind: ProvisionManagerList + plural: provisionmanagers + singular: provisionmanager + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: ProvisionManager is the Schema for the provisionmanagers 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: ProvisionManagerSpec defines the desired state of ProvisionManager + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ProvisionManagerConfiguration defines the provision manager + configuration + properties: + containers: {} + keystoneInstance: + type: string + keystoneSecretName: + type: string + type: object + required: + - commonConfiguration + - 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 + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: rabbitmqs.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Rabbitmq + listKind: RabbitmqList + plural: rabbitmqs + singular: rabbitmq + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Rabbitmq is the Schema for the rabbitmqs 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: RabbitmqSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: RabbitmqConfiguration is the Spec for the cassandras API. + properties: + containers: {} + erlangCookie: + type: string + password: + type: string + port: + type: integer + secret: + type: string + sslPort: + type: integer + user: + type: string + vhost: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + properties: + port: + type: string + sslPort: + type: string + type: object + secret: + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: swiftproxies.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: SwiftProxy + listKind: SwiftProxyList + plural: swiftproxies + singular: swiftproxy + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: SwiftProxy is the Schema for the swiftproxies 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: SwiftProxySpec defines the desired state of SwiftProxy + properties: + serviceConfiguration: + description: SwiftProxyConfiguration is the Spec for the keystone API. + properties: + containers: {} + credentialsSecretName: + type: string + endpoint: + type: string + keystoneInstance: + type: string + keystoneSecretName: + type: string + listenPort: + type: integer + memcachedInstance: + type: string + ringPersistentVolumeClaim: + type: string + swiftConfSecretName: + type: string + type: object + required: + - serviceConfiguration + type: object + status: + description: SwiftProxyStatus defines the observed state of SwiftProxy + properties: + active: + type: boolean + required: + - active + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: swifts.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Swift + listKind: SwiftList + plural: swifts + singular: swift + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Swift is the Schema for the swifts 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: SwiftSpec defines the desired state of Swift + properties: + serviceConfiguration: + description: SwiftConfiguration is the Spec for the keystone API. + properties: + containers: {} + credentialsSecretName: + type: string + ringsStorage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + swiftProxyConfiguration: + description: SwiftProxyConfiguration is the Spec for the keystone + API. + properties: + containers: {} + credentialsSecretName: + type: string + endpoint: + type: string + keystoneInstance: + type: string + keystoneSecretName: + type: string + listenPort: + type: integer + memcachedInstance: + type: string + ringPersistentVolumeClaim: + type: string + swiftConfSecretName: + type: string + type: object + swiftStorageConfiguration: + description: SwiftStorageConfiguration is the Spec for the keystone + API. + properties: + accountBindPort: + type: integer + containerBindPort: + type: integer + containers: {} + device: + type: string + objectBindPort: + type: integer + ringPersistentVolumeClaim: + type: string + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + swiftConfSecretName: + type: string + type: object + required: + - swiftProxyConfiguration + - swiftStorageConfiguration + type: object + required: + - serviceConfiguration + type: object + status: + description: SwiftStatus defines the observed state of Swift + properties: + active: + type: boolean + credentialsSecretName: + type: string + swiftProxyPort: + type: integer + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: swiftstorages.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: SwiftStorage + listKind: SwiftStorageList + plural: swiftstorages + singular: swiftstorage + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: SwiftStorage is the Schema for the swiftstorages 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: SwiftStorageSpec defines the desired state of SwiftStorage + properties: + serviceConfiguration: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired 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' + properties: + accountBindPort: + type: integer + containerBindPort: + type: integer + containers: {} + device: + type: string + objectBindPort: + type: integer + ringPersistentVolumeClaim: + type: string + storage: + properties: + path: + type: string + size: + pattern: ^([0-9]+)([KMGTPE]i)?$ + type: string + type: object + swiftConfSecretName: + type: string + type: object + required: + - serviceConfiguration + type: object + status: + description: SwiftStorageStatus defines the observed state of SwiftStorage + properties: + active: + type: boolean + required: + - active + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: vrouters.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Vrouter + listKind: VrouterList + plural: vrouters + singular: vrouter + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Vrouter is the Schema for the vrouters 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: VrouterSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: VrouterConfiguration is the Spec for the cassandras API. + properties: + cassandraInstance: + type: string + clusterRole: + type: string + clusterRoleBinding: + type: string + containers: {} + controlInstance: + type: string + distribution: + type: string + gateway: + type: string + metaDataSecret: + type: string + nodeManager: + type: boolean + physicalInterface: + type: string + serviceAccount: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + properties: + active: + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + properties: + analyticsPort: + type: string + apiPort: + type: string + collectorPort: + type: string + redisPort: + type: string + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: webuis.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Webui + listKind: WebuiList + plural: webuis + singular: webui + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Webui is the Schema for the webuis 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: WebuiSpec is the Spec for the cassandras API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: WebuiConfiguration is the Spec for the cassandras API. + properties: + cassandraInstance: + type: string + clusterRole: + type: string + clusterRoleBinding: + type: string + containers: {} + keystoneInstance: + type: string + keystoneSecretName: + type: string + serviceAccount: + type: string + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + nodes: + additionalProperties: + type: string + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: zookeepers.contrail.juniper.net +spec: + group: contrail.juniper.net + names: + kind: Zookeeper + listKind: ZookeeperList + plural: zookeepers + singular: zookeeper + scope: "" + subresources: + status: {} + validation: + openAPIV3Schema: + description: Zookeeper is the Schema for the zookeepers 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: ZookeeperSpec is the Spec for the zookeepers API. + properties: + commonConfiguration: + description: CommonConfiguration is the common services struct. + properties: + activate: + description: Activate defines if the service will be activated by + Manager. + type: boolean + create: + description: Create defines if the service will be created by Manager. + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's + network namespace. If this option is set, the ports that will + be used must be specified. Default to false. + type: boolean + imagePullSecrets: + description: ImagePullSecrets is an optional list of references + to secrets in the same namespace to use for pulling any of the + images used by this PodSpec. + items: + type: string + type: array + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must be true for + the pod to fit on a node. Selector which must match a node''s + labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/.' + type: object + replicas: + description: Number of desired pods. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 1. + format: int32 + type: integer + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + serviceConfiguration: + description: ZookeeperConfiguration is the Spec for the zookeepers API. + properties: + clientPort: + type: integer + containers: {} + electionPort: + type: integer + serverPort: + type: integer + type: object + required: + - commonConfiguration + - serviceConfiguration + type: object + status: + description: ZookeeperStatus defines the status of the zookeeper object. + 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.kubebuilder.io/beyond_basics/generating_crd.html' + type: boolean + nodes: + additionalProperties: + type: string + type: object + ports: + description: ZookeeperStatusPorts defines the status of the ports of + the zookeeper object. + properties: + clientPort: + type: string + type: object + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: contrail-operator + namespace: contrail +spec: + replicas: 1 + selector: + matchLabels: + name: contrail-operator + template: + metadata: + labels: + name: contrail-operator + spec: + serviceAccountName: contrail-operator + hostNetwork: true + tolerations: + - key: node.kubernetes.io/not-ready + operator: "Exists" + effect: "NoSchedule" + containers: + - name: contrail-operator + # Replace this with the built image name + image: svl-artifactory.juniper.net/contrail-operator.gcr.io/eng-prod-237922/contrail-operator:svl_artifactory.latest + imagePullPolicy: Always + env: + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: OPERATOR_NAME + value: "contrail-operator" diff --git a/deploy/svl_artifactory/2-start-operator-1node.yaml b/deploy/svl_artifactory/2-start-operator-1node.yaml new file mode 100644 index 000000000..e3fd68366 --- /dev/null +++ b/deploy/svl_artifactory/2-start-operator-1node.yaml @@ -0,0 +1,246 @@ +--- +apiVersion: contrail.juniper.net/v1alpha1 +kind: Manager +metadata: + name: cluster1 + namespace: contrail +spec: + commonConfiguration: + hostNetwork: true + replicas: 1 + services: + cassandras: + - metadata: + labels: + contrail_cluster: cluster1 + name: cassandra1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + cassandra: + image: cassandra:3.11.4 + init: + image: python:alpine + init2: + image: cassandra:3.11.4 + config: + metadata: + labels: + contrail_cluster: cluster1 + name: config1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + analyticsapi: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-analytics-api:master.latest + api: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-api:master.latest + collector: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-analytics-collector:master.latest + devicemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-devicemgr:master.latest + dnsmasq: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-dnsmasq:master.latest + init: + image: python:alpine + init2: + image: busybox + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + redis: + image: redis:4.0.2 + schematransformer: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-schema:master.latest + servicemonitor: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-svcmonitor:master.latest + queryengine: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-analytics-query-engine:master.latest + logLevel: SYS_DEBUG + zookeeperInstance: zookeeper1 + controls: + - metadata: + labels: + contrail_cluster: cluster1 + control_role: master + name: control1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + control: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-control-control:master.latest + dns: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-control-dns:master.latest + init: + image: python:alpine + named: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-control-named:master.latest + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + statusmonitor: + image: svl-artifactory.juniper.net/contrail-operator.gcr.io/eng-prod-237922/contrail-statusmonitor-debug:svl_artifactory.latest + zookeeperInstance: zookeeper1 + kubemanagers: + - metadata: + labels: + contrail_cluster: cluster1 + name: kubemanager1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + kubemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-kubernetes-kube-manager:master.latest + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + ipFabricForwarding: false + ipFabricSnat: true + kubernetesTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + useKubeadmConfig: true + zookeeperInstance: zookeeper1 + provisionManager: + metadata: + labels: + contrail_cluster: cluster1 + name: provmanager1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + replicas: 1 + serviceConfiguration: + containers: + init: + image: python:alpine + provisioner: + image: svl-artifactory.juniper.net/contrail-operator.gcr.io/eng-prod-237922/contrail-provisioner-debug:svl_artifactory.latest + rabbitmq: + metadata: + labels: + contrail_cluster: cluster1 + name: rabbitmq1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + init: + image: python:alpine + rabbitmq: + image: rabbitmq:3.7 + vrouters: + - metadata: + labels: + contrail_cluster: cluster1 + name: vroutermaster + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + nodemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-nodemgr:master.latest + vrouteragent: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-agent:master.latest + vroutercni: + image: michaelhenkel/contrailcni:v0.0.1 + vrouterkernelbuildinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-build-init:master.latest + vrouterkernelinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-init:master.latest + controlInstance: control1 + - metadata: + labels: + contrail_cluster: cluster1 + name: vrouternodes + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.opencontrail.org: vrouter + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + nodemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-nodemgr:master.latest + vrouteragent: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-agent:master.latest + vroutercni: + image: michaelhenkel/contrailcni:v0.0.1 + vrouterkernelbuildinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-build-init:master.latest + vrouterkernelinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-init:master.latest + controlInstance: control1 + webui: + metadata: + labels: + contrail_cluster: cluster1 + name: webui1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + redis: + image: redis:4.0.2 + webuijob: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-webui-job:master.latest + webuiweb: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-webui-web:master.latest + zookeepers: + - metadata: + labels: + contrail_cluster: cluster1 + name: zookeeper1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + init: + image: python:alpine + zookeeper: + image: docker.io/zookeeper:3.5.5 diff --git a/deploy/svl_artifactory/2-start-operator-3node.yaml b/deploy/svl_artifactory/2-start-operator-3node.yaml new file mode 100644 index 000000000..77515f252 --- /dev/null +++ b/deploy/svl_artifactory/2-start-operator-3node.yaml @@ -0,0 +1,246 @@ +--- +apiVersion: contrail.juniper.net/v1alpha1 +kind: Manager +metadata: + name: cluster1 + namespace: contrail +spec: + commonConfiguration: + hostNetwork: true + replicas: 3 + services: + cassandras: + - metadata: + labels: + contrail_cluster: cluster1 + name: cassandra1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + cassandra: + image: cassandra:3.11.4 + init: + image: python:alpine + init2: + image: cassandra:3.11.4 + config: + metadata: + labels: + contrail_cluster: cluster1 + name: config1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + analyticsapi: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-analytics-api:master.latest + api: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-api:master.latest + collector: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-analytics-collector:master.latest + devicemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-devicemgr:master.latest + dnsmasq: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-dnsmasq:master.latest + init: + image: python:alpine + init2: + image: busybox + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + redis: + image: redis:4.0.2 + schematransformer: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-schema:master.latest + servicemonitor: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-config-svcmonitor:master.latest + queryengine: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-analytics-query-engine:master.latest + logLevel: SYS_DEBUG + zookeeperInstance: zookeeper1 + controls: + - metadata: + labels: + contrail_cluster: cluster1 + control_role: master + name: control1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + control: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-control-control:master.latest + dns: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-control-dns:master.latest + init: + image: python:alpine + named: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-control-named:master.latest + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + statusmonitor: + image: svl-artifactory.juniper.net/contrail-operator.gcr.io/eng-prod-237922/contrail-statusmonitor-debug:svl_artifactory.latest + zookeeperInstance: zookeeper1 + kubemanagers: + - metadata: + labels: + contrail_cluster: cluster1 + name: kubemanager1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + kubemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-kubernetes-kube-manager:master.latest + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + ipFabricForwarding: false + ipFabricSnat: true + kubernetesTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + useKubeadmConfig: true + zookeeperInstance: zookeeper1 + provisionManager: + metadata: + labels: + contrail_cluster: cluster1 + name: provmanager1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + replicas: 1 + serviceConfiguration: + containers: + init: + image: python:alpine + provisioner: + image: svl-artifactory.juniper.net/contrail-operator.gcr.io/eng-prod-237922/contrail-provisioner-debug:svl_artifactory.latest + rabbitmq: + metadata: + labels: + contrail_cluster: cluster1 + name: rabbitmq1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + init: + image: python:alpine + rabbitmq: + image: rabbitmq:3.7 + vrouters: + - metadata: + labels: + contrail_cluster: cluster1 + name: vroutermaster + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + nodemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-nodemgr:master.latest + vrouteragent: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-agent:master.latest + vroutercni: + image: michaelhenkel/contrailcni:v0.0.1 + vrouterkernelbuildinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-build-init:master.latest + vrouterkernelinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-init:master.latest + controlInstance: control1 + - metadata: + labels: + contrail_cluster: cluster1 + name: vrouternodes + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.opencontrail.org: vrouter + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + nodemanager: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-nodemgr:master.latest + vrouteragent: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-agent:master.latest + vroutercni: + image: michaelhenkel/contrailcni:v0.0.1 + vrouterkernelbuildinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-build-init:master.latest + vrouterkernelinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-vrouter-kernel-init:master.latest + controlInstance: control1 + webui: + metadata: + labels: + contrail_cluster: cluster1 + name: webui1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + cassandraInstance: cassandra1 + containers: + init: + image: python:alpine + nodeinit: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-node-init:master.latest + redis: + image: redis:4.0.2 + webuijob: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-webui-job:master.latest + webuiweb: + image: svl-artifactory.juniper.net/contrail-nightly/contrail-controller-webui-web:master.latest + zookeepers: + - metadata: + labels: + contrail_cluster: cluster1 + name: zookeeper1 + spec: + commonConfiguration: + create: true + nodeSelector: + node-role.kubernetes.io/master: "" + serviceConfiguration: + containers: + init: + image: python:alpine + zookeeper: + image: docker.io/zookeeper:3.5.5 diff --git a/pkg/apis/contrail/v1alpha1/BUILD.bazel b/pkg/apis/contrail/v1alpha1/BUILD.bazel index d2d240060..639fe674f 100644 --- a/pkg/apis/contrail/v1alpha1/BUILD.bazel +++ b/pkg/apis/contrail/v1alpha1/BUILD.bazel @@ -61,15 +61,17 @@ go_library( go_test( name = "go_default_test", - srcs = ["manager_types_test.go"], + srcs = [ + "contrail_test.go", + "manager_types_test.go", + ], + embed = [":go_default_library"], deps = [ - "//pkg/apis/contrail/v1alpha1:go_default_library", - "@io_k8s_apimachinery//pkg/types:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", + "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_client_go//kubernetes/scheme:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/client/fake:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/reconcile:go_default_library", - "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", ], ) - diff --git a/pkg/apis/contrail/v1alpha1/base_types.go b/pkg/apis/contrail/v1alpha1/base_types.go index 05d034de5..2e195e0dc 100644 --- a/pkg/apis/contrail/v1alpha1/base_types.go +++ b/pkg/apis/contrail/v1alpha1/base_types.go @@ -1090,8 +1090,7 @@ func NewConfigClusterConfiguration(name string, namespace string, myclient clien for _, ip := range configList.Items[0].Status.Nodes { configNodes = append(configNodes, ip) } - configConfigInterface := configList.Items[0].ConfigurationParameters() - configConfig := configConfigInterface.(ConfigConfiguration) + configConfig := configList.Items[0].ConfigurationParameters() authMode = configConfig.AuthMode apiServerPort = strconv.Itoa(*configConfig.APIPort) analyticsServerPort = strconv.Itoa(*configConfig.AnalyticsPort) diff --git a/pkg/apis/contrail/v1alpha1/config_types.go b/pkg/apis/contrail/v1alpha1/config_types.go index 97a634206..450c147ad 100644 --- a/pkg/apis/contrail/v1alpha1/config_types.go +++ b/pkg/apis/contrail/v1alpha1/config_types.go @@ -86,7 +86,7 @@ type ConfigConfiguration struct { KeystoneInstance string `json:"keystoneInstance,omitempty"` AuthMode AuthenticationMode `json:"authMode,omitempty"` AAAMode AAAMode `json:"aaaMode,omitempty"` - Storage Storage `json:"storage,omitempty"` + Storages map[string]Storage `json:"storage,omitempty"` FabricMgmtIP string `json:"fabricMgmtIP,omitempty"` } @@ -176,8 +176,7 @@ func (c *Config) InstanceConfiguration(request reconcile.Request, rabbitmqSecretVhost = string(rabbitmqSecret.Data["vhost"]) } - configConfigInterface := c.ConfigurationParameters() - configConfig := configConfigInterface.(ConfigConfiguration) + configConfig := c.ConfigurationParameters() if rabbitmqSecretUser == "" { rabbitmqSecretUser = configConfig.RabbitmqUser } @@ -712,8 +711,7 @@ func (c *Config) WaitForPeerPods(request reconcile.Request, reconcileClient clie func (c *Config) ManageNodeStatus(podNameIPMap map[string]string, client client.Client) error { c.Status.Nodes = podNameIPMap - configConfigInterface := c.ConfigurationParameters() - configConfig := configConfigInterface.(ConfigConfiguration) + configConfig := c.ConfigurationParameters() c.Status.Ports.APIPort = strconv.Itoa(*configConfig.APIPort) c.Status.Ports.AnalyticsPort = strconv.Itoa(*configConfig.AnalyticsPort) c.Status.Ports.CollectorPort = strconv.Itoa(*configConfig.CollectorPort) @@ -744,8 +742,8 @@ func (c *Config) IsActive(name string, namespace string, myclient client.Client) return false } -func (c *Config) ConfigurationParameters() interface{} { - configConfiguration := ConfigConfiguration{} +func (c *Config) ConfigurationParameters() *ConfigConfiguration { + configConfiguration := &ConfigConfiguration{} var apiPort int var analyticsPort int var collectorPort int @@ -754,6 +752,28 @@ func (c *Config) ConfigurationParameters() interface{} { var rabbitmqPassword string var rabbitmqVhost string var logLevel string + var storagesMap = make(map[string]Storage) + tftpStorage := Storage{ + Size: "10M", + Path: "/etc/tftp", + } + dnsmasqStorage := Storage{ + Size: "10M", + Path: "/var/lib/dnsmasq", + } + if len(c.Spec.ServiceConfiguration.Storages) == 0 { + storagesMap["tftp"] = tftpStorage + storagesMap["dnsmasq"] = dnsmasqStorage + configConfiguration.Storages = storagesMap + } else { + storagesMap = configConfiguration.Storages + if _, ok := storagesMap["tftp"]; !ok { + storagesMap["tftp"] = tftpStorage + } + if _, ok := storagesMap["dnsmasq"]; !ok { + storagesMap["dnsmasq"] = dnsmasqStorage + } + } if c.Spec.ServiceConfiguration.LogLevel != "" { logLevel = c.Spec.ServiceConfiguration.LogLevel } else { diff --git a/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go index 1b579cc7c..885d4b4f8 100644 --- a/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/contrail/v1alpha1/zz_generated.deepcopy.go @@ -621,7 +621,13 @@ func (in *ConfigConfiguration) DeepCopyInto(out *ConfigConfiguration) { *out = new(bool) **out = **in } - out.Storage = in.Storage + if in.Storages != nil { + in, out := &in.Storages, &out.Storages + *out = make(map[string]Storage, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } diff --git a/pkg/controller/cassandra/cassandra_controller.go b/pkg/controller/cassandra/cassandra_controller.go index 7d59fbe6d..b7b302a04 100644 --- a/pkg/controller/cassandra/cassandra_controller.go +++ b/pkg/controller/cassandra/cassandra_controller.go @@ -269,6 +269,20 @@ func (r *ReconcileCassandra) Reconcile(request reconcile.Request) (reconcile.Res }, } statefulSet.Spec.Template.Spec.Volumes = append(statefulSet.Spec.Template.Spec.Volumes, emptyVolume) + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } for idx, container := range statefulSet.Spec.Template.Spec.Containers { diff --git a/pkg/controller/command/command_controller.go b/pkg/controller/command/command_controller.go index 0a27ff379..33b4c6294 100644 --- a/pkg/controller/command/command_controller.go +++ b/pkg/controller/command/command_controller.go @@ -271,6 +271,20 @@ func (r *ReconcileCommand) Reconcile(request reconcile.Request) (reconcile.Resul }, }) deployment.Spec.Template.Spec.Volumes = volumes + deployment.Spec.Template.Spec.Affinity = &core.Affinity{ + PodAntiAffinity: &core.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []core.PodAffinityTerm{{ + LabelSelector: &meta.LabelSelector{ + MatchExpressions: []meta.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } if _, err = controllerutil.CreateOrUpdate(context.Background(), r.client, deployment, func() error { _, err = command.PrepareIntendedDeployment(deployment, diff --git a/pkg/controller/command/command_controller_test.go b/pkg/controller/command/command_controller_test.go index 4f531f916..d80560d1c 100644 --- a/pkg/controller/command/command_controller_test.go +++ b/pkg/controller/command/command_controller_test.go @@ -659,6 +659,20 @@ func newDeployment(s apps.DeploymentStatus) *apps.Deployment { }, }, }, + Affinity: &core.Affinity{ + PodAntiAffinity: &core.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []core.PodAffinityTerm{{ + LabelSelector: &meta.LabelSelector{ + MatchExpressions: []meta.LabelSelectorRequirement{{ + Key: "command", + Operator: "In", + Values: []string{"command"}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + }, Tolerations: []core.Toleration{ {Key: "", Operator: "Exists", Value: "", Effect: "NoSchedule"}, {Key: "", Operator: "Exists", Value: "", Effect: "NoExecute"}, diff --git a/pkg/controller/config/BUILD.bazel b/pkg/controller/config/BUILD.bazel index f09a46a77..ca56e6c4b 100644 --- a/pkg/controller/config/BUILD.bazel +++ b/pkg/controller/config/BUILD.bazel @@ -17,13 +17,17 @@ go_library( "@com_github_ghodss//:go_default_library", "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", + "@io_k8s_api//storage/v1:go_default_library", "@io_k8s_apimachinery//pkg/api/errors:go_default_library", "@io_k8s_apimachinery//pkg/api/resource:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", + "@io_k8s_apimachinery//pkg/labels:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_client_go//util/workqueue:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/client:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/controller:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/controller/controllerutil:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/event:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/handler:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/log:go_default_library", @@ -47,6 +51,7 @@ go_test( "@com_github_stretchr_testify//require:go_default_library", "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", + "@io_k8s_api//storage/v1:go_default_library", "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", diff --git a/pkg/controller/config/config_controller.go b/pkg/controller/config/config_controller.go index e0fac774f..c74007cfc 100644 --- a/pkg/controller/config/config_controller.go +++ b/pkg/controller/config/config_controller.go @@ -2,8 +2,8 @@ package config import ( "context" - "os" "reflect" + "strconv" "github.com/Juniper/contrail-operator/pkg/apis/contrail/v1alpha1" "github.com/Juniper/contrail-operator/pkg/cacertificates" @@ -13,11 +13,13 @@ import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/workqueue" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -26,6 +28,8 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + storagev1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logf "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -261,31 +265,35 @@ func (r *ReconcileConfig) Reconcile(request reconcile.Request) (reconcile.Result return reconcile.Result{}, err } - for _, vol := range statefulSet.Spec.Template.Spec.Volumes { - pvc := vol.VolumeSource.PersistentVolumeClaim - if pvc == nil { - continue - } - pvc.ClaimName = config.Name + "-" + instanceType + "-" + vol.Name - claimName := types.NamespacedName{Namespace: config.Namespace, Name: pvc.ClaimName} - claim := r.claims.New(claimName, config) - if config.Spec.ServiceConfiguration.Storage.Path != "" { - path := config.Spec.ServiceConfiguration.Storage.Path + string(os.PathSeparator) + vol.Name - claim.SetStoragePath(path) - } - if config.Spec.ServiceConfiguration.Storage.Size != "" { - var quantity resource.Quantity - quantity, err = config.Spec.ServiceConfiguration.Storage.SizeAsQuantity() - if err != nil { - return reconcile.Result{}, err - } - claim.SetStorageSize(quantity) - } - claim.SetNodeSelector(config.Spec.CommonConfiguration.NodeSelector) - if err = claim.EnsureExists(); err != nil { + configDefaultConfiguration := config.ConfigurationParameters() + var persistentVolumeClaimList []corev1.PersistentVolumeClaim + for storageName, storage := range configDefaultConfiguration.Storages { + storageResource := corev1.ResourceStorage + diskSize, err := resource.ParseQuantity(storage.Size) + if err != nil { return reconcile.Result{}, err } + storageClassName := "local-storage" + pvc := corev1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + Name: storageName, + Namespace: request.Namespace, + Labels: map[string]string{"contrail_manager": instanceType, instanceType: request.Name}, + }, + Spec: corev1.PersistentVolumeClaimSpec{ + AccessModes: []corev1.PersistentVolumeAccessMode{ + "ReadWriteOnce", + }, + StorageClassName: &storageClassName, + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{storageResource: diskSize}, + }, + }, + } + persistentVolumeClaimList = append(persistentVolumeClaimList, pvc) + } + statefulSet.Spec.VolumeClaimTemplates = persistentVolumeClaimList csrSignerCaVolumeName := request.Name + "-csr-signer-ca" config.AddVolumesToIntendedSTS(statefulSet, map[string]string{ @@ -322,6 +330,36 @@ func (r *ReconcileConfig) Reconcile(request reconcile.Request) (reconcile.Result } statefulSet.Spec.Template.Spec.ServiceAccountName = "serviceaccount-statusmonitor-config" + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } + + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } + for idx, container := range statefulSet.Spec.Template.Spec.Containers { switch container.Name { @@ -624,7 +662,6 @@ func (r *ReconcileConfig) Reconcile(request reconcile.Request) (reconcile.Result ) (&statefulSet.Spec.Template.Spec.Containers[idx]).VolumeMounts = volumeMountList (&statefulSet.Spec.Template.Spec.Containers[idx]).Image = config.Spec.ServiceConfiguration.Containers[container.Name].Image - } case "statusmonitor": command := []string{"sh", "-c", @@ -675,12 +712,124 @@ func (r *ReconcileConfig) Reconcile(request reconcile.Request) (reconcile.Result } } + var initVolumeList []corev1.Volume + for storageName, storage := range configDefaultConfiguration.Storages { + initHostPathType := corev1.HostPathType("DirectoryOrCreate") + initHostPathSource := &corev1.HostPathVolumeSource{ + Path: storage.Path, + Type: &initHostPathType, + } + initVolume := corev1.Volume{ + Name: request.Name + "-" + instanceType + "-" + storageName + "-init", + VolumeSource: corev1.VolumeSource{ + HostPath: initHostPathSource, + }, + } + initVolumeList = append(initVolumeList, initVolume) + statefulSet.Spec.Template.Spec.Volumes = append(statefulSet.Spec.Template.Spec.Volumes, initVolume) + } + // Configure InitContainers for idx, container := range statefulSet.Spec.Template.Spec.InitContainers { (&statefulSet.Spec.Template.Spec.InitContainers[idx]).Image = config.Spec.ServiceConfiguration.Containers[container.Name].Image if config.Spec.ServiceConfiguration.Containers[container.Name].Command != nil { (&statefulSet.Spec.Template.Spec.InitContainers[idx]).Command = config.Spec.ServiceConfiguration.Containers[container.Name].Command } + for _, volume := range initVolumeList { + volumeMount := corev1.VolumeMount{ + Name: volume.Name, + MountPath: volume.VolumeSource.HostPath.Path, + } + (&statefulSet.Spec.Template.Spec.InitContainers[idx]).VolumeMounts = append((&statefulSet.Spec.Template.Spec.InitContainers[idx]).VolumeMounts, volumeMount) + } + } + + volumeBindingMode := storagev1.VolumeBindingMode("WaitForFirstConsumer") + storageClass := &storagev1.StorageClass{ + ObjectMeta: metav1.ObjectMeta{ + Name: "local-storage", + Namespace: config.Namespace, + }, + Provisioner: "kubernetes.io/no-provisioner", + VolumeBindingMode: &volumeBindingMode, + } + err = r.Client.Get(context.TODO(), types.NamespacedName{Name: storageClass.Name}, storageClass) + if err != nil && errors.IsNotFound(err) { + if err = controllerutil.SetControllerReference(config, storageClass, r.Scheme); err != nil { + return reconcile.Result{}, err + } + err = r.Client.Create(context.TODO(), storageClass) + if err != nil { + if !errors.IsAlreadyExists(err) { + return reconcile.Result{}, err + } + } + } + + volumeMode := corev1.PersistentVolumeMode("Filesystem") + nodeSelectorMatchExpressions := []corev1.NodeSelectorRequirement{} + for k, v := range config.Spec.CommonConfiguration.NodeSelector { + valueList := []string{v} + expression := corev1.NodeSelectorRequirement{ + Key: k, + Operator: corev1.NodeSelectorOperator("In"), + Values: valueList, + } + nodeSelectorMatchExpressions = append(nodeSelectorMatchExpressions, expression) + } + nodeSelectorTerm := corev1.NodeSelector{ + NodeSelectorTerms: []corev1.NodeSelectorTerm{{ + MatchExpressions: nodeSelectorMatchExpressions, + }}, + } + volumeNodeAffinity := corev1.VolumeNodeAffinity{ + Required: &nodeSelectorTerm, + } + if err != nil { + return reconcile.Result{}, err + } + + storageCount := 1 + for _, storage := range configDefaultConfiguration.Storages { + localVolumeSource := corev1.LocalVolumeSource{ + Path: storage.Path, + } + diskSize, err := resource.ParseQuantity(storage.Size) + if err != nil { + return reconcile.Result{}, err + } + replicasInt := int(*config.Spec.CommonConfiguration.Replicas) + for i := 0; i < replicasInt; i++ { + pv := &corev1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + Name: config.Name + "-pv-" + strconv.Itoa(i) + "-" + strconv.Itoa(storageCount), + Namespace: config.Namespace, + }, + Spec: corev1.PersistentVolumeSpec{ + Capacity: corev1.ResourceList{corev1.ResourceStorage: diskSize}, + VolumeMode: &volumeMode, + AccessModes: []corev1.PersistentVolumeAccessMode{ + "ReadWriteOnce", + }, + PersistentVolumeReclaimPolicy: corev1.PersistentVolumeReclaimPolicy("Delete"), + StorageClassName: "local-storage", + NodeAffinity: &volumeNodeAffinity, + PersistentVolumeSource: corev1.PersistentVolumeSource{ + Local: &localVolumeSource, + }, + }, + } + err = r.Client.Get(context.TODO(), types.NamespacedName{Name: pv.Name, Namespace: request.Namespace}, pv) + if err != nil && errors.IsNotFound(err) { + if err = controllerutil.SetControllerReference(config, pv, r.Scheme); err != nil { + return reconcile.Result{}, err + } + if err = r.Client.Create(context.TODO(), pv); err != nil && !errors.IsAlreadyExists(err) { + return reconcile.Result{}, err + } + } + } + storageCount++ } configChanged := false @@ -724,6 +873,21 @@ func (r *ReconcileConfig) Reconcile(request reconcile.Request) (reconcile.Result if err = config.ManageNodeStatus(podIPMap, r.Client); err != nil { return reconcile.Result{}, err } + labelSelector := labels.SelectorFromSet(map[string]string{"contrail_manager": instanceType, instanceType: request.Name}) + listOps := &client.ListOptions{Namespace: request.Namespace, LabelSelector: labelSelector} + pvcList := &corev1.PersistentVolumeClaimList{} + err = r.Client.List(context.TODO(), pvcList, listOps) + if err != nil { + return reconcile.Result{}, err + } + for _, pvc := range pvcList.Items { + if err = controllerutil.SetControllerReference(config, &pvc, r.Scheme); err != nil { + return reconcile.Result{}, err + } + if err = r.Client.Update(context.TODO(), &pvc); err != nil { + return reconcile.Result{}, err + } + } } if currentConfigExists { diff --git a/pkg/controller/config/config_controller_test.go b/pkg/controller/config/config_controller_test.go index d25e73d5e..0dcb4dbe8 100644 --- a/pkg/controller/config/config_controller_test.go +++ b/pkg/controller/config/config_controller_test.go @@ -2,12 +2,15 @@ package config import ( "context" + "testing" + contrail "github.com/Juniper/contrail-operator/pkg/apis/contrail/v1alpha1" "github.com/Juniper/contrail-operator/pkg/volumeclaims" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" apps "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" + storage "k8s.io/api/storage/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" @@ -15,7 +18,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "testing" ) func TestConfigResourceHandler(t *testing.T) { @@ -42,6 +44,7 @@ func TestConfigResourceHandler(t *testing.T) { require.NoError(t, err, "Failed to build scheme") require.NoError(t, core.SchemeBuilder.AddToScheme(scheme), "Failed core.SchemeBuilder.AddToScheme()") require.NoError(t, apps.SchemeBuilder.AddToScheme(scheme), "Failed apps.SchemeBuilder.AddToScheme()") + require.NoError(t, storage.SchemeBuilder.AddToScheme(scheme), "Failed storage.SchemeBuilder.AddToScheme()") t.Run("Create Event", func(t *testing.T) { evc := event.CreateEvent{ Meta: pod, @@ -103,6 +106,7 @@ func TestConfig(t *testing.T) { require.NoError(t, err, "Failed to build scheme") require.NoError(t, core.SchemeBuilder.AddToScheme(scheme), "Failed core.SchemeBuilder.AddToScheme()") require.NoError(t, apps.SchemeBuilder.AddToScheme(scheme), "Failed apps.SchemeBuilder.AddToScheme()") + require.NoError(t, storage.SchemeBuilder.AddToScheme(scheme), "Failed storage.SchemeBuilder.AddToScheme()") tests := []*TestCase{ testcase1(), @@ -265,8 +269,8 @@ func newZookeeper() *contrail.Zookeeper { }, ServiceConfiguration: contrail.ZookeeperConfiguration{ Containers: map[string]*contrail.Container{ - "init": {Image: "python:alpine"}, - "zookeeper": {Image: "contrail-controller-zookeeper"}, + "init": &contrail.Container{Image: "python:alpine"}, + "zookeeper": &contrail.Container{Image: "contrail-controller-zookeeper"}, }, }, }, @@ -366,8 +370,12 @@ func testcase5() *TestCase { falseVal := false cfg := newConfigInst() - cfg.Spec.ServiceConfiguration.Storage.Path = "my-storage-path" - cfg.Spec.ServiceConfiguration.Storage.Size = "1G" + var storageMap = make(map[string]contrail.Storage) + storageMap["my-storage-path"] = contrail.Storage{ + Path: "my-storage-path", + Size: "1G", + } + cfg.Spec.ServiceConfiguration.Storages = storageMap cfg.Spec.CommonConfiguration.NodeSelector = map[string]string{ "selector1": "1", } diff --git a/pkg/controller/config/sts.go b/pkg/controller/config/sts.go index fd0ec7264..c8f354467 100644 --- a/pkg/controller/config/sts.go +++ b/pkg/controller/config/sts.go @@ -231,10 +231,6 @@ spec: - effect: NoExecute operator: Exists volumes: - - persistentVolumeClaim: {} - name: tftp - - persistentVolumeClaim: {} - name: dnsmasq - hostPath: path: /var/log/contrail/config type: "" @@ -270,7 +266,15 @@ spec: apiVersion: v1 fieldPath: metadata.labels path: pod_labelsx - name: status` + name: status + volumeClaimTemplates: + - metadata: + name: config-data + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 1G` func GetSTS() *appsv1.StatefulSet { sts := appsv1.StatefulSet{} diff --git a/pkg/controller/control/BUILD.bazel b/pkg/controller/control/BUILD.bazel index 619a0b042..b6c9e2092 100644 --- a/pkg/controller/control/BUILD.bazel +++ b/pkg/controller/control/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", "@io_k8s_apimachinery//pkg/api/errors:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_client_go//util/workqueue:go_default_library", diff --git a/pkg/controller/control/control_controller.go b/pkg/controller/control/control_controller.go index 4bce81b8d..67f2fb4d9 100644 --- a/pkg/controller/control/control_controller.go +++ b/pkg/controller/control/control_controller.go @@ -22,6 +22,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logf "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -268,7 +269,20 @@ func (r *ReconcileControl) Reconcile(request reconcile.Request) (reconcile.Resul if err = v1alpha1.CreateAccount("statusmonitor-control", request.Namespace, r.Client, r.Scheme, instance); err != nil { return reconcile.Result{}, err } - + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } statefulSet.Spec.Template.Spec.ServiceAccountName = "serviceaccount-statusmonitor-control" for idx, container := range statefulSet.Spec.Template.Spec.Containers { if container.Name == "control" { @@ -304,8 +318,7 @@ func (r *ReconcileControl) Reconcile(request reconcile.Request) (reconcile.Resul (&statefulSet.Spec.Template.Spec.Containers[idx]).Image = instance.Spec.ServiceConfiguration.Containers[container.Name].Image } if container.Name == "statusmonitor" { - command := []string{"sh", "-c", - "/statusmonitor -config /etc/mycontrail/monitorconfig.${POD_IP}.yaml"} + command := []string{"sh", "-c", "/app/statusmonitor/contrail-statusmonitor-image-debug.binary -config /etc/mycontrail/monitorconfig.${POD_IP}.yaml"} if instance.Spec.ServiceConfiguration.Containers[container.Name].Command == nil { (&statefulSet.Spec.Template.Spec.Containers[idx]).Command = command } else { diff --git a/pkg/controller/enqueue/BUILD.bazel b/pkg/controller/enqueue/BUILD.bazel index 97c7abc1a..798511a96 100644 --- a/pkg/controller/enqueue/BUILD.bazel +++ b/pkg/controller/enqueue/BUILD.bazel @@ -30,14 +30,20 @@ go_test( "enqueue_request_for_object_by_owner_test.go", "enqueue_request_for_object_group_kind_test.go", "enqueue_request_for_owner_group_kind_test.go", - ] + "enqueue_test.go", + ], embed = [":go_default_library"], deps = [ + "//pkg/apis/contrail/v1alpha1:go_default_library", "@com_github_stretchr_testify//assert:go_default_library", + "@com_github_stretchr_testify//require:go_default_library", + "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", + "@io_k8s_apimachinery//pkg/api/meta:go_default_library", "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime/schema:go_default_library", "@io_k8s_client_go//util/workqueue:go_default_library", + "@io_k8s_kubernetes//pkg/apis/core:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/event:go_default_library", ], ) diff --git a/pkg/controller/keystone/keystone_controller.go b/pkg/controller/keystone/keystone_controller.go index 6c7dc839a..b95851853 100644 --- a/pkg/controller/keystone/keystone_controller.go +++ b/pkg/controller/keystone/keystone_controller.go @@ -308,7 +308,6 @@ func (r *ReconcileKeystone) ensureStatefulSetExists(keystone *contrail.Keystone, }, }, } - req := reconcile.Request{ NamespacedName: types.NamespacedName{Name: keystone.Name, Namespace: keystone.Namespace}, } diff --git a/pkg/controller/kubemanager/kubemanager_controller.go b/pkg/controller/kubemanager/kubemanager_controller.go index 2ee017bb9..67029b028 100644 --- a/pkg/controller/kubemanager/kubemanager_controller.go +++ b/pkg/controller/kubemanager/kubemanager_controller.go @@ -415,6 +415,20 @@ func (r *ReconcileKubemanager) Reconcile(request reconcile.Request) (reconcile.R } } statefulSet.Spec.Template.Spec.ServiceAccountName = serviceAccountName + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } for idx, container := range statefulSet.Spec.Template.Spec.Containers { if container.Name == "kubemanager" { command := []string{"bash", "-c", diff --git a/pkg/controller/provisionmanager/BUILD.bazel b/pkg/controller/provisionmanager/BUILD.bazel index 3ff503087..62f179ddc 100644 --- a/pkg/controller/provisionmanager/BUILD.bazel +++ b/pkg/controller/provisionmanager/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", "@io_k8s_apimachinery//pkg/api/errors:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_client_go//util/workqueue:go_default_library", @@ -42,12 +43,11 @@ go_test( "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", + "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", - "@io_k8s_sigs_controller_runtime//pkg/client:go_default_library", + "@io_k8s_client_go//util/workqueue:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/client/fake:go_default_library", - "@io_k8s_sigs_controller_runtime//pkg/reconcile:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/event:go_default_library", - "@io_k8s_client_go//util/workqueue:go_default_library", - "@io_k8s_apimachinery//pkg/runtime:go_default_library", + "@io_k8s_sigs_controller_runtime//pkg/reconcile:go_default_library", ], ) diff --git a/pkg/controller/provisionmanager/provisionmanager_controller.go b/pkg/controller/provisionmanager/provisionmanager_controller.go index fe6b3cf68..036a9f903 100644 --- a/pkg/controller/provisionmanager/provisionmanager_controller.go +++ b/pkg/controller/provisionmanager/provisionmanager_controller.go @@ -18,6 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -265,11 +266,33 @@ func (r *ReconcileProvisionManager) Reconcile(request reconcile.Request) (reconc cacertificates.CsrSignerCAConfigMapName: csrSignerCaVolumeName, }) instance.AddSecretVolumesToIntendedSTS(statefulSet, map[string]string{secretCertificates.Name: request.Name + "-secret-certificates"}) + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } for idx, container := range statefulSet.Spec.Template.Spec.Containers { if container.Name == "provisioner" { command := []string{"sh", "-c", - "/contrail-provisioner -controlNodes /etc/provision/control/controlnodes.yaml -configNodes /etc/provision/config/confignodes.yaml -analyticsNodes /etc/provision/analytics/analyticsnodes.yaml -vrouterNodes /etc/provision/vrouter/vrouternodes.yaml -databaseNodes /etc/provision/database/databasenodes.yaml -apiserver /etc/provision/apiserver/apiserver-${POD_IP}.yaml -keystoneAuthConf /etc/provision/keystone/keystone-auth-${POD_IP}.yaml -mode watch", + `/app/contrail-provisioner/contrail-provisioner-image-debug.binary \ + -controlNodes /etc/provision/control/controlnodes.yaml \ + -configNodes /etc/provision/config/confignodes.yaml \ + -analyticsNodes /etc/provision/analytics/analyticsnodes.yaml \ + -vrouterNodes /etc/provision/vrouter/vrouternodes.yaml \ + -databaseNodes /etc/provision/database/databasenodes.yaml \ + -apiserver /etc/provision/apiserver/apiserver-${POD_IP}.yaml \ + -keystoneAuthConf /etc/provision/keystone/keystone-auth-${POD_IP}.yaml \ + -mode watch`, } if instance.Spec.ServiceConfiguration.Containers[container.Name].Command == nil { (&statefulSet.Spec.Template.Spec.Containers[idx]).Command = command diff --git a/pkg/controller/rabbitmq/BUILD.bazel b/pkg/controller/rabbitmq/BUILD.bazel index 76d6561d2..46e4144ac 100644 --- a/pkg/controller/rabbitmq/BUILD.bazel +++ b/pkg/controller/rabbitmq/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", "@io_k8s_apimachinery//pkg/api/errors:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_client_go//util/workqueue:go_default_library", diff --git a/pkg/controller/rabbitmq/rabbitmq_controller.go b/pkg/controller/rabbitmq/rabbitmq_controller.go index 97a541bc2..79ce15897 100644 --- a/pkg/controller/rabbitmq/rabbitmq_controller.go +++ b/pkg/controller/rabbitmq/rabbitmq_controller.go @@ -23,6 +23,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logf "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -221,7 +222,20 @@ func (r *ReconcileRabbitmq) Reconcile(request reconcile.Request) (reconcile.Resu }, ) instance.AddSecretVolumesToIntendedSTS(statefulSet, map[string]string{secretCertificates.Name: request.Name + "-secret-certificates"}) - + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } for idx, container := range statefulSet.Spec.Template.Spec.Containers { if container.Name == "rabbitmq" { diff --git a/pkg/controller/webui/webui_controller.go b/pkg/controller/webui/webui_controller.go index a01a2e030..8976bd5d6 100644 --- a/pkg/controller/webui/webui_controller.go +++ b/pkg/controller/webui/webui_controller.go @@ -342,6 +342,20 @@ func (r *ReconcileWebui) Reconcile(request reconcile.Request) (reconcile.Result, } } statefulSet.Spec.Template.Spec.ServiceAccountName = serviceAccountName + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } for idx, container := range statefulSet.Spec.Template.Spec.Containers { if container.Name == "webuiweb" { command := []string{"bash", "-c", diff --git a/pkg/controller/zookeeper/BUILD.bazel b/pkg/controller/zookeeper/BUILD.bazel index 636491785..2404ec3af 100644 --- a/pkg/controller/zookeeper/BUILD.bazel +++ b/pkg/controller/zookeeper/BUILD.bazel @@ -15,6 +15,7 @@ go_library( "@io_k8s_api//apps/v1:go_default_library", "@io_k8s_api//core/v1:go_default_library", "@io_k8s_apimachinery//pkg/api/errors:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_client_go//util/workqueue:go_default_library", diff --git a/pkg/controller/zookeeper/zookeeper_controller.go b/pkg/controller/zookeeper/zookeeper_controller.go index 80a353c87..cde881ce6 100644 --- a/pkg/controller/zookeeper/zookeeper_controller.go +++ b/pkg/controller/zookeeper/zookeeper_controller.go @@ -20,6 +20,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logf "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -201,6 +202,20 @@ func (r *ReconcileZookeeper) Reconcile(request reconcile.Request) (reconcile.Res } instance.AddVolumesToIntendedSTS(statefulSet, map[string]string{configMap.Name: request.Name + "-" + instanceType + "-volume", configMap2.Name: request.Name + "-" + instanceType + "-volume-1"}) + statefulSet.Spec.Template.Spec.Affinity = &corev1.Affinity{ + PodAntiAffinity: &corev1.PodAntiAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{{ + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{{ + Key: instanceType, + Operator: "In", + Values: []string{request.Name}, + }}, + }, + TopologyKey: "kubernetes.io/hostname", + }}, + }, + } for idx, container := range statefulSet.Spec.Template.Spec.Containers { if container.Name == "zookeeper" { diff --git a/pkg/k8s/cluster_info_test.go b/pkg/k8s/cluster_info_test.go index 9e1a3417d..91b2db7ee 100644 --- a/pkg/k8s/cluster_info_test.go +++ b/pkg/k8s/cluster_info_test.go @@ -1,7 +1,6 @@ package k8s_test import ( - "io/ioutil" "testing" "github.com/stretchr/testify/suite" @@ -20,11 +19,37 @@ type ClusterInfoSuite struct { CoreV1Interface typedCorev1.CoreV1Interface } +var kubeadmConfig = `--- +apiServer: + certSANs: + - localhost + - 127.0.0.1 + extraArgs: + authorization-mode: Node,RBAC + timeoutForControlPlane: 4m0s +apiVersion: kubeadm.k8s.io/v1beta2 +certificatesDir: /etc/kubernetes/pki +clusterName: test +controlPlaneEndpoint: 10.255.254.3:6443 +controllerManager: + extraArgs: + enable-hostpath-provisioner: "true" +dns: + type: CoreDNS +etcd: + local: + dataDir: /var/lib/etcd +imageRepository: k8s.gcr.io +kind: ClusterConfiguration +kubernetesVersion: v1.17.0 +networking: + dnsDomain: cluster.local + podSubnet: 10.244.0.0/16 + serviceSubnet: 10.96.0.0/12 +scheduler: {}` + func (suite *ClusterInfoSuite) SetupTest() { - data, err := ioutil.ReadFile("test_files/kubeadm-config.yml") - suite.Assert().NoError(err) - dataString := string(data) - cm := kubeadmConfigMap(dataString) + cm := kubeadmConfigMap(kubeadmConfig) fakeClientset := fake.NewSimpleClientset(cm) coreV1Interface := fakeClientset.CoreV1() suite.ClusterInfo = k8s.ClusterConfig{Client: coreV1Interface} diff --git a/pkg/openshift/cluster_info_test.go b/pkg/openshift/cluster_info_test.go index c1b919ca0..4b89e8a23 100644 --- a/pkg/openshift/cluster_info_test.go +++ b/pkg/openshift/cluster_info_test.go @@ -1,7 +1,6 @@ package openshift_test import ( - "io/ioutil" "testing" "github.com/stretchr/testify/suite" @@ -20,15 +19,71 @@ type ClusterInfoSuite struct { CoreV1Interface typedCorev1.CoreV1Interface } +var clusterConfigV1 = `--- +apiVersion: v1 +baseDomain: user.test.com +compute: +- hyperthreading: Enabled + name: worker + platform: {} + replicas: 3 +controlPlane: + hyperthreading: Enabled + name: master + platform: + aws: + rootVolume: + iops: 0 + size: 120 + type: gp2 + type: m4.large + zones: + - eu-central-1a + - eu-central-1b + - eu-central-1c + replicas: 1 +metadata: + creationTimestamp: null + name: test +networking: + clusterNetwork: + - cidr: 10.128.0.0/14 + hostPrefix: 23 + machineCIDR: 10.0.0.0/16 + networkType: contrailCNI + serviceNetwork: + - 172.30.0.0/16 +platform: + aws: + region: eu-central-1 +publish: External +pullSecret: "" +sshKey: | + ssh-rsa AAAAAAA test@test-user +` + +var consoleConfig = `--- +apiVersion: console.openshift.io/v1 +auth: + clientID: console + clientSecretFile: /var/oauth-config/clientSecret + oauthEndpointCAFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt +clusterInfo: + consoleBaseAddress: https://console-openshift-console.apps.test.user.test.com + masterPublicURL: https://api.test.user.test.com:6443 +customization: + branding: ocp + documentationBaseURL: https://docs.openshift.com/container-platform/4.3/ +kind: ConsoleConfig +providers: {} +servingInfo: + bindAddress: https://0.0.0.0:8443 + certFile: /var/serving-cert/tls.crt + keyFile: /var/serving-cert/tls.key` + func (suite *ClusterInfoSuite) SetupTest() { - ccv1Data, err := ioutil.ReadFile("test_files/cluster-config-v1.yml") - suite.Assert().NoError(err) - ccv1DataString := string(ccv1Data) - ccv1Map := getConfigMap("cluster-config-v1", "kube-system", "install-config", ccv1DataString) - consoleData, err := ioutil.ReadFile("test_files/console-config.yml") - suite.Assert().NoError(err) - consoleDataString := string(consoleData) - consoleMap := getConfigMap("console-config", "openshift-console", "console-config.yaml", consoleDataString) + ccv1Map := getConfigMap("cluster-config-v1", "kube-system", "install-config", clusterConfigV1) + consoleMap := getConfigMap("console-config", "openshift-console", "console-config.yaml", consoleConfig) fakeClientset := fake.NewSimpleClientset(ccv1Map, consoleMap) coreV1Interface := fakeClientset.CoreV1() suite.ClusterInfo = openshift.ClusterConfig{Client: coreV1Interface} diff --git a/statusmonitor/BUILD.bazel b/statusmonitor/BUILD.bazel index 4041ec807..bbb7b08b8 100644 --- a/statusmonitor/BUILD.bazel +++ b/statusmonitor/BUILD.bazel @@ -1,10 +1,13 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") load("@io_bazel_rules_docker//go:image.bzl", "go_image") load("@io_bazel_rules_docker//container:container.bzl", "container_push") go_library( name = "go_default_library", - srcs = ["main.go", "config_status_monitor.go"], + srcs = [ + "config_status_monitor.go", + "main.go", + ], importpath = "github.com/Juniper/contrail-operator/statusmonitor", visibility = ["//visibility:private"], deps = [ @@ -67,6 +70,31 @@ container_push( image = ":contrail-statusmonitor-image-debug", format = "Docker", registry = "gcr.io", - repository = "eng-prod-237922/contrail-statusmonitor", - tag = "{BUILD_SCM_VERSION}", + repository = "eng-prod-237922/contrail-statusmonitor-debug", + tag = "{BUILD_SCM_BRANCH}.{BUILD_SCM_REVISION}", +) + +container_push( + name = "contrail-statusmonitor-push-debug-latest", + image = ":contrail-statusmonitor-image-debug", + format = "Docker", + registry = "gcr.io", + repository = "eng-prod-237922/contrail-statusmonitor-debug", + tag = "{BUILD_SCM_BRANCH}.latest", +) + +go_test( + name = "go_default_test", + srcs = [ + "config_status_monitor_test.go", + "main_test.go", + ], + embed = [":go_default_library"], + deps = [ + "@com_github_stretchr_testify//assert:go_default_library", + "@io_k8s_api//core/v1:go_default_library", + "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", + "@io_k8s_client_go//kubernetes:go_default_library", + "@io_k8s_client_go//kubernetes/fake:go_default_library", + ], ) diff --git a/test/env/update_local_registry.sh b/test/env/update_local_registry.sh index f2a23bc3a..b31340bcb 100755 --- a/test/env/update_local_registry.sh +++ b/test/env/update_local_registry.sh @@ -4,6 +4,11 @@ set -o errexit LOCAL_REPO=localhost:"${INTERNAL_INSECURE_REGISTRY_PORT:-5000}" +CONTRAIL_TAG="${CONTRAIL_TAG:-master.latest}" +CONTRAIL_REGISTRY="${CONTRAIL_REGISTRY:-svl-artifactory.juniper.net/contrail-nightly}" +OPERATOR_TAG="${OPERATOR_TAG:-master.latest}" +OPERATOR_REGISTRY="${OPERATOR_REGISTRY:-svl-artifactory.juniper.net/contrail-operator.gcr.io/eng-prod-237922}" + pull_image() { docker pull $1/$2 @@ -12,25 +17,27 @@ pull_image() } while read line; do - pull_image opencontrailnightly "${line}" + pull_image ${CONTRAIL_REGISTRY} "${line}" done <