I need help about deploying about spring cloud data flow server. I want to deploy the app using helm and deploy streams into different namespaces. Even though I update the skipper configmap with multiple accounts and namespaces, checking stream platforms shows accounts with the namespace I deployed the spring cloud and skipper. It seems it ignores namespace values in spring.application.json. Can anyone help me about this?
This is the template I deploy to the cluster:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "scdf.fullname" . }}-skipper
labels:
app: {{ template "scdf.name" . }}
component: skipper
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
spring.application.json:
'{"spring.cloud.skipper.server.enableLocalPlatform" : false,
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformName }}.environmentVariables" :
"SPRING_RABBITMQ_HOST=${{ printf "{" }}{{ template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${{ printf "{" }}{{
template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_PORT_AMQP},SPRING_RABBITMQ_USERNAME={{
.Values.rabbitmq.rabbitmqUsername }},
SPRING_RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformName }}.memory" : "{{
.Values.deployer.resourceLimits.memory }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformName }}.cpu" : "{{
.Values.deployer.resourceLimits.cpu }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformName }}.createDeployment" : true,
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameDev }}.environmentVariables" :
"SPRING_RABBITMQ_HOST=${{ printf "{" }}{{ template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_HOST}, SPRING_RABBITMQ_PORT=${{ printf "{" }}{{
template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_PORT_AMQP},SPRING_RABBITMQ_USERNAME={{
.Values.rabbitmq.rabbitmqUsername
}},SPRING_RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameDev }}.memory" : "{{
.Values.deployer.resourceLimits.memory }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameDev }}.cpu" : "{{
.Values.deployer.resourceLimits.cpu }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameDev }}.createDeployment" : true,
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameDev }}.namespace" : "str-runtime-dev",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNamePreview }}.environmentVariables" :
"SPRING_RABBITMQ_HOST=${{ printf "{" }}{{ template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_HOST}, SPRING_RABBITMQ_PORT=${{ printf "{" }}{{
template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_PORT_AMQP},SPRING_RABBITMQ_USERNAME={{
.Values.rabbitmq.rabbitmqUsername
}},SPRING_RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNamePreview }}.memory" : "{{
.Values.deployer.resourceLimits.memory }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNamePreview }}.cpu" : "{{
.Values.deployer.resourceLimits.cpu }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNamePreview }}.createDeployment" : true,
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNamePreview }}.namespace" : "str",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameUat }}.environmentVariables" :
"SPRING_RABBITMQ_HOST=${{ printf "{" }}{{ template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_HOST}, SPRING_RABBITMQ_PORT=${{ printf "{" }}{{
template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_PORT_AMQP},SPRING_RABBITMQ_USERNAME={{
.Values.rabbitmq.rabbitmqUsername
}},SPRING_RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameUat }}.memory" : "{{
.Values.deployer.resourceLimits.memory }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameUat }}.cpu" : "{{
.Values.deployer.resourceLimits.cpu }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameUat }}.createDeployment" : true,
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameUat }}.namespace" : "str-runtime-uat",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameProd }}.environmentVariables" :
"SPRING_RABBITMQ_HOST=${{ printf "{" }}{{ template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_HOST}, SPRING_RABBITMQ_PORT=${{ printf "{" }}{{
template "scdf.envrelease" .
}}_RABBITMQ_SERVICE_PORT_AMQP},SPRING_RABBITMQ_USERNAME={{
.Values.rabbitmq.rabbitmqUsername
}},SPRING_RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameProd }}.memory" : "{{
.Values.deployer.resourceLimits.memory }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameProd }}.cpu" : "{{
.Values.deployer.resourceLimits.cpu }}",
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameProd }}.createDeployment" : true,
"spring.cloud.skipper.server.platform.kubernetes.accounts.{{
.Values.skipper.platformNameProd }}.namespace" : "str-runtime-prod"}'
And this is the output of the stream platforms:
runtime-uat │kubernetes│master url = [https://10.96.0.1:443/], namespace = [str], api version = [v1]║
runtime-prod│kubernetes│master url = [https://10.96.0.1:443/], namespace = [str], api version = [v1]║
preview │kubernetes│master url = [https://10.96.0.1:443/], namespace = [str], api version = [v1]║
minikube │kubernetes│master url = [https://10.96.0.1:443/], namespace = [str], api version = [v1]║
runtime-dev │kubernetes│master url = [https://10.96.0.1:443/], namespace = [str], api version = [v1]║e
Edit: I tried the values below and here are the results:
Skipper deployment yaml file:
- name: SPRING_APPLICATION_JSON
value: '{"spring.cloud.skipper.server.enableLocalPlatform" : false,"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_ENVIRONMENT_VARIABLES" :"SPRING_RABBITMQ_HOST=${RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${RABBITMQ_SERVICE_PORT}","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_MEMORY" : "1024Mi","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_CREATE_DEPLOYMENT" : true,"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_NAMESPACE" : "namespace1","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_ENVIRONMENT_VARIABLES" : "SPRING_RABBITMQ_HOST=${RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${RABBITMQ_SERVICE_PORT}","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_MEMORY" : "1024Mi","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_CREATE_DEPLOYMENT" : true,"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_NAMESPACE" : "namespace2"}'
1- Env variable of the skipper pod
SPRING_APPLICATION_JSON= .
{"spring.cloud.skipper.server.enableLocalPlatform" :
false,"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_ENVIRONMENT_VARIABLES":"SPRING_RABBITMQ_HOST=${RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${RABBITMQ_SERVICE_PORT}","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_MEMORY" : "1024Mi","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_CREATE_DEPLOYMENT" : true,"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_NAMESPACE" : "namespace1","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_ENVIRONMENT_VARIABLES" : "SPRING_RABBITMQ_HOST=${RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${RABBITMQ_SERVICE_PORT}","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_MEMORY" : "1024Mi","SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_CREATE_DEPLOYMENT" : true,"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_NAMESPACE" : "namespace2"}
2 - Screenshot for the platforms Output of the stream platform-list
It is unclear how and where you're setting the namespace
for different platform profiles. If you can edit the post to clarify that, it'd help to relate to the problem in hand.
Normally, to create multiple platform profiles with different "deployer properties" [see KubernetesDeployerProperties] including different namespace
for each profile, it typically is changed in the deployment YAML of Skipper. For instance, here's an example value
portion of skipper-deployment.yaml.
value: "{\"spring.cloud.skipper.server.enableLocalPlatform\" : false, \"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_ENVIRONMENT_VARIABLES\" : \"SPRING_RABBITMQ_HOST=${RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${RABBITMQ_SERVICE_PORT}\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_MEMORY\" : \"1024Mi\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_CREATE_DEPLOYMENT\" : true,\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_NAMESPACE\" : namespace1,\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_ENVIRONMENT_VARIABLES\" : \"SPRING_RABBITMQ_HOST=${RABBITMQ_SERVICE_HOST},SPRING_RABBITMQ_PORT=${RABBITMQ_SERVICE_PORT}\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_MEMORY\" : \"1024Mi\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_CREATE_DEPLOYMENT\" : true,\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_NAMESPACE\" : namespace2,\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_URL\" : \"https://api.run.pivotal.io\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_ORG\" : \"scdf-ci\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_SPACE\" : \"space-sabby\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_DOMAIN\" : \"cfapps.io\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_USERNAME\" : \"TEST@TEST.io\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_PASSWORD\" : \"***\",\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_CONNECTION_SKIP_SSL_VALIDATION\" : false,\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_DEPLOYMENT_DELETE_ROUTES\" : false,\"SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[cf-dev]_DEPLOYMENT_SERVICES\" : \"rabbit\"}"
There are 3 platform profiles in this example. 1) k8s-dev
2) k8s-qa
and 3) cf-dev
.
For #1 and #2, notice that we have SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-dev]_NAMESPACE
and SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS[k8s-qa]_NAMESPACE
pointing to "namespace1" and "namespace2" respectively. Unless you establish configurations with an explicit namespace setting to each platform profile, it won't reflect the settings - it will fall back to the defaults.
The helm-experience doesn't provide the flexibility to override granular settings like this, though. You can still directly update the configmap, but you'd have to make sure to override all the deployer properties associated with each of the namespace.