wso2 / kubernetes-apim

Kubernetes and Helm resources for WSO2 API Manager
Apache License 2.0
113 stars 216 forks source link

WSO2 Helm Chart : Advanced: Pattern 1 : Unable to override default configuration files by passing custom configuration from configmaps #468

Open abhi1git opened 3 years ago

abhi1git commented 3 years ago

Description: I am using WSO2 3.2.0 Pattern1 Helm chart for deploying wso2 api manager. I have a requirement in which I need to change following configuration files

All of the above files are under non persistent path so changes can be lost on pod restart when edited from ssh terminal, also config changes in those files dont get applied if applied at runtime of api manager application.

I have tried following two approaches to pass custom config from configmaps -

  1. Oveririding config file by mounting configmap at exact location of file which leads to following error - [2020-09-07 15:06:10,196] INFO {org.wso2.config.mapper.ConfigParser} - Applying Configurations upon new Templates [2020-09-07 15:06:10,198] WARN {org.wso2.config.mapper.ConfigParser} - Overriding files in configuration directory /home/wso2carbon/wso2am-3.2.0 [2020-09-07 15:06:11,122] SEVERE {org.wso2.carbon.server.Main handleConfiguration} - Error while performing configuration changes org.wso2.config.mapper.ConfigParserException: Error while store new configurations at org.wso2.config.mapper.ConfigParser.parse(ConfigParser.java:132) at org.wso2.carbon.server.Main.handleConfiguration(Main.java:231) at org.wso2.carbon.server.Main.main(Main.java:103) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.wso2.carbon.bootstrap.Bootstrap.loadClass(Bootstrap.java:70) at org.wso2.carbon.bootstrap.Bootstrap.main(Bootstrap.java:51) Caused by: java.io.IOException: Read-only file system at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method) at java.base/java.io.File.createNewFile(File.java:1026) at org.wso2.config.mapper.ConfigParser.deploy(ConfigParser.java:223) at org.wso2.config.mapper.ConfigParser.deployAndStoreMetadata(ConfigParser.java:180) at org.wso2.config.mapper.ConfigParser.parse(ConfigParser.java:127) ... 8 more
  2. Have also tried replicating symlink approach followed for persisting deployment.toml file by mounting my custom configmap for axis2.xml in wso2-config-volume path which is the same used by deployment.toml, but this does not update the file at the original location

Affected Product Version: WSO2 - 3.2.0

OS, DB, other environment details and versions:

Expected Feature

@chirangaalwis

chirangaalwis commented 3 years ago

@abhi1git the approach (2) in which you have used the /home/wso2carbon/wso2-config-volume mount point to mount the relevant, customized configuration files is correct (please refer to guide).

But for this purpose, you have to create extra Kubernetes ConfigMaps (for example, the axis2.xml file resides within the directory <APIM_HOME>/repository/conf/axis2, thus you need to create a new ConfigMap for that directory).

@abhi1git can you please elaborate on the exact steps you have followed in order to mount the content to the /home/wso2carbon/wso2-config-volume mount point?

abhi1git commented 3 years ago

Yes I have created a new configmap for axis2.xml and axis2_client.xml as follows :-

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "am-pattern-1.resource.prefix" . }}-am-config-files
  namespace: {{ .Release.Namespace }}
data:
  axis2.xml: |
       # Full content of axis2.xml

  axis2_client.xml: |
       # Full content of axis2_client.xml    

For Mounting this configmap have tried it in following two ways individually:-

1. Mounting files from configmap without subPath

      volumes:
        - name: custom-config-files
          configMap:
            name: {{ template "am-pattern-1.resource.prefix" . }}-am-config-files
        - name: wso2am-conf
          configMap:
            name: {{ template "am-pattern-1.resource.prefix" . }}-am-1-conf
          volumeMounts:
            - name: custom-config-files
              mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/axis2
            - name: wso2am-conf
              mountPath: /home/wso2carbon/wso2-config-volume/repository/conf

2. Separately mounting files from configmap using subPath feature

      volumes:
        - name: custom-config-files
          configMap:
            name: {{ template "am-pattern-1.resource.prefix" . }}-am-config-files
        - name: wso2am-conf
          configMap:
            name: {{ template "am-pattern-1.resource.prefix" . }}-am-1-conf
          volumeMounts:
             - name: custom-config-files
               mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/axis2
               subPath: axis2.xml
            - name: custom-config-files
              mountPath: /home/wso2carbon/wso2-config-volume/repository/conf/axis2
              subPath: axis2_client.xml
            - name: wso2am-conf
              mountPath: /home/wso2carbon/wso2-config-volume/repository/conf

Following are the startup logs for reference :

kubectl logs wso2am-pattern-1-am-1-deployment-dd667b588-h9nvw -n wso2 -f

Start WSO2 Carbon server
JAVA_HOME environment variable is set to /opt/java/openjdk
CARBON_HOME environment variable is set to /home/wso2carbon/wso2am-3.2.0
Using Java memory options: -Xms1024m -Xmx1024m
[2020-09-29 14:54:16,324]  INFO {org.wso2.config.mapper.ConfigParser} - Applying Configurations upon new Templates
[2020-09-29 14:54:16,326]  WARN {org.wso2.config.mapper.ConfigParser} - Overriding files in configuration directory /home/wso2carbon/wso2am-3.2.0
[2020-09-29 14:54:17,282]  INFO {org.wso2.config.mapper.ConfigParser} - Writing Metadata Entries...
andes [org.wso2.andes.wso2.internal.QpidBundleActivator] INFO : Setting BundleContext in PluginManager
callhome [org.wso2.carbon.callhome.internal.CallHomeActivator] DEBUG : Activating CallHome agent
[2020-09-29 14:54:29,704]  INFO - CarbonCoreActivator Starting WSO2 Carbon...
[2020-09-29 14:54:29,714]  INFO - CarbonCoreActivator Operating System : Linux 4.9.0-11-amd64, amd64
[2020-09-29 14:54:29,714]  INFO - CarbonCoreActivator Java Home        : /opt/java/openjdk
[2020-09-29 14:54:29,714]  INFO - CarbonCoreActivator Java Version     : 11.0.8
[2020-09-29 14:54:29,714]  INFO - CarbonCoreActivator Java VM          : OpenJDK 64-Bit Server VM 11.0.8+10,AdoptOpenJDK
[2020-09-29 14:54:29,714]  INFO - CarbonCoreActivator Carbon Home      : /home/wso2carbon/wso2am-3.2.0
[2020-09-29 14:54:29,715]  INFO - CarbonCoreActivator Java Temp Dir    : /home/wso2carbon/wso2am-3.2.0/tmp
[2020-09-29 14:54:29,715]  INFO - CarbonCoreActivator User             : wso2carbon, en-US, GMT
[2020-09-29 14:54:29,910]  INFO - DefaultCryptoProviderComponent 'CryptoService.Secret' property has not been set. 'org.wso2.carbon.crypto.provider.SymmetricKeyInternalCryptoProvider' won't be registered as an internal crypto provider. Please set the secret if the provider needs to be registered.
[2020-09-29 14:54:30,497]  INFO - KafkaEventAdapterServiceDS Successfully deployed the Kafka output event adaptor service
[2020-09-29 14:54:30,926]  INFO - TemplateDeployerServiceTrackerDS Successfully deployed the execution manager tracker service
[2020-09-29 14:54:34,880]  INFO - ConsentManagerComponent ConsentManagerComponent is activated.
[2020-09-29 14:54:35,120]  INFO - BinaryDataReceiver Started Binary TCP Transport on port : 9611
[2020-09-29 14:54:35,121]  INFO - BinaryDataReceiver Started Binary SSL Transport on port : 9711
[2020-09-29 14:54:35,203]  INFO - DataBridgeDS Successfully deployed Agent Server 
[2020-09-29 14:54:35,893]  INFO - EmbeddedRegistryService Configured Registry in 101ms
[2020-09-29 14:54:35,910]  INFO - EmbeddedRegistryService Connected to mount at configregistry in 3ms
[2020-09-29 14:54:35,910]  INFO - EmbeddedRegistryService Connected to mount at govregistry in 4ms
[2020-09-29 14:54:35,999]  INFO - EmbeddedRegistryService Connected to mount at configregistry in 0ms
[2020-09-29 14:54:36,000]  INFO - EmbeddedRegistryService Connected to mount at govregistry in 1ms
[2020-09-29 14:54:36,007]  INFO - RegistryCoreServiceComponent Registry Mode    : READ-WRITE
[2020-09-29 14:54:36,240]  INFO - JmxReporterBuilder Creating JMX reporter for Metrics with domain 'org.wso2.carbon.metrics'
[2020-09-29 14:54:36,280]  INFO - AbstractReporter Started JMX reporter for Metrics
[2020-09-29 14:54:38,739]  INFO - SolrClient Default Embedded Solr Server Initialized
[2020-09-29 14:54:39,321]  INFO - UserStoreMgtDSComponent Carbon UserStoreMgtDSComponent activated successfully.
[2020-09-29 14:54:41,680]  INFO - UserStoreConfigurationDeployer User Store Configuration Deployer initiated.
[2020-09-29 14:54:41,681]  INFO - UserStoreConfigurationDeployer User Store Configuration Deployer initiated.
[2020-09-29 14:54:42,585]  INFO - WebsocketTransportSender WSS Sender started
[2020-09-29 14:54:42,590]  INFO - PassThroughHttpSender Initializing Pass-through HTTP/S Sender...
[2020-09-29 14:54:42,619]  INFO - PassThroughHttpSender Pass-through HTTP Sender started...
[2020-09-29 14:54:42,619]  INFO - PassThroughHttpSSLSender Initializing Pass-through HTTP/S Sender...
[2020-09-29 14:54:42,631]  INFO - ClientConnFactoryBuilder customSSLProfiles configuration is loaded from path: /home/wso2carbon/wso2am-3.2.0/repository/resources/security/sslprofiles.xml
[2020-09-29 14:54:42,632]  INFO - ClientConnFactoryBuilder HTTPS Loading custom SSL profiles for the HTTPS sender
[2020-09-29 14:54:42,640]  INFO - ClientConnFactoryBuilder HTTPS Custom SSL profiles initialized for 1 servers
[2020-09-29 14:54:42,641]  INFO - PassThroughHttpSSLSender Pass-through HTTPS Sender started...
[2020-09-29 14:54:42,644]  INFO - WebsocketTransportSender WS Sender started
[2020-09-29 14:54:42,698]  INFO - PassThroughHttpListener Initializing Pass-through HTTP/S Listener...
[2020-09-29 14:54:42,717]  INFO - PassThroughHttpMultiSSLListener Initializing Pass-through HTTP/S Listener...
[2020-09-29 14:54:42,728]  INFO - ServerConnFactoryBuilder SSLProfile configuration is loaded from path: /home/wso2carbon/wso2am-3.2.0/repository/resources/security/listenerprofiles.xml
[2020-09-29 14:54:44,291]  INFO - DeploymentInterceptor Deploying Axis2 service: I18nEmailMgtConfigService {super-tenant}
[2020-09-29 14:54:46,555]  INFO - DeploymentInterceptor Deploying Axis2 service: AccountCredentialMgtConfigService {super-tenant}
[2020-09-29 14:54:46,580]  INFO - DeploymentInterceptor Deploying Axis2 service: UserIdentityManagementAdminService {super-tenant}
[2020-09-29 14:54:46,582]  INFO - DeploymentInterceptor Deploying Axis2 service: UserInformationRecoveryService {super-tenant}
[2020-09-29 14:54:49,535]  WARN - DefaultSchemaGenerator We don't support method overloading. Ignoring [generateUpdatedAPIFromSwagger]
[2020-09-29 14:54:50,632]  INFO - CarbonServerManager Repository       : /home/wso2carbon/wso2am-3.2.0/repository/deployment/server/
[2020-09-29 14:54:50,680]  INFO - KafkaEventAdapterServiceHolder Kafka input event adaptor waiting for dependent configurations to load
[2020-09-29 14:54:50,836]  INFO - QueueManagerServiceDS Successfully created the queue manager service
[2020-09-29 14:54:50,879]  INFO - SubscriptionManagerServiceDS Successfully created the subscription manager service
[2020-09-29 14:54:50,914]  INFO - TenantLoadingConfig Using tenant lazy loading policy...
[2020-09-29 14:54:50,928]  INFO - PermissionUpdater Permission cache updated for tenant -1234
[2020-09-29 14:54:51,921]  WARN - ApplicationManagementServiceComponent Templates directory not found at /home/wso2carbon/wso2am-3.2.0/repository/resources/identity/authntemplates
[2020-09-29 14:54:52,491]  INFO - UserStoreMgtDSComponent Claim manager set for class org.wso2.carbon.user.core.common.DefaultRealm
[2020-09-29 14:54:52,495]  INFO - UserStoreMgtDSComponent Claim manager set for class org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager
[2020-09-29 14:54:52,696]  INFO - SchemaBuilder XACML policy schema loaded successfully.
[2020-09-29 14:54:53,055]  INFO - OAuthServerConfiguration The default OAuth token issuer will be used. No custom token generator is set.
[2020-09-29 14:54:54,730]  INFO - JMSConnectionFactory JMS ConnectionFactory : Siddhi-JMS-Consumer initialized
[2020-09-29 14:54:55,329]  INFO - OAuth2ServiceComponent PKCE Support enabled.
[2020-09-29 14:54:57,305]  INFO - SessionDataStore Thread pool size for temporary authentication context data delete task: 20
[2020-09-29 14:55:00,900]  INFO - ServiceBusInitializer Starting ESB...
[2020-09-29 14:55:00,944]  INFO - ServiceBusInitializer Initializing Apache Synapse...
[2020-09-29 14:55:00,949]  INFO - SynapseControllerFactory Using Synapse home : /home/wso2carbon/wso2am-3.2.0/.
[2020-09-29 14:55:00,949]  INFO - SynapseControllerFactory Using synapse.xml location : /home/wso2carbon/wso2am-3.2.0/././repository/deployment/server/synapse-configs/default
[2020-09-29 14:55:00,950]  INFO - SynapseControllerFactory Using server name : localhost
[2020-09-29 14:55:00,974]  INFO - SynapseControllerFactory The timeout handler will run every : 15s
[2020-09-29 14:55:01,002]  INFO - Axis2SynapseController Initializing Synapse at : Tue Sep 29 14:55:01 GMT 2020
[2020-09-29 14:55:01,009]  INFO - CarbonSynapseController Loading the mediation configuration from the file system
[2020-09-29 14:55:01,012]  INFO - MultiXMLConfigurationBuilder Building synapse configuration from the synapse artifact repository at : ././repository/deployment/server/synapse-configs/default
[2020-09-29 14:55:01,013]  INFO - XMLConfigurationBuilder Generating the Synapse configuration model by parsing the XML configuration
[2020-09-29 14:55:01,355]  INFO - DataEndpointConnectionWorker Attempt to connect to the endpoint ssl://wso2am-pattern-1-am-analytics-worker-statefulset-1.wso2am-pattern-1-am-analytics-worker-headless-service:7712 failed.
[2020-09-29 14:55:01,378]  INFO - DataEndpointConnectionWorker Attempt to connect to the endpoint ssl://wso2am-pattern-1-am-analytics-worker-statefulset-0.wso2am-pattern-1-am-analytics-worker-headless-service:7712 failed.
[2020-09-29 14:55:01,388]  INFO - DependencyTracker Sequence : fault was added to the Synapse configuration successfully
[2020-09-29 14:55:01,390]  INFO - DependencyTracker Sequence : _resource_mismatch_handler_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,439]  INFO - DependencyTracker Sequence : main was added to the Synapse configuration successfully
[2020-09-29 14:55:01,480]  INFO - DependencyTracker Sequence : _throttle_out_handler_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,512]  INFO - DependencyTracker Sequence : _threat_fault_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,514]  INFO - DependencyTracker Sequence : _sandbox_key_error_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,518]  INFO - DependencyTracker Sequence : _build_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,539]  INFO - DependencyTracker Sequence : dispatchSeq was added to the Synapse configuration successfully
[2020-09-29 14:55:01,540]  INFO - DependencyTracker Sequence : _auth_failure_handler_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,695]  INFO - DependencyTracker Sequence : _token_fault_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,733]  INFO - DependencyTracker Sequence : _cors_request_handler_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,735]  INFO - DependencyTracker Sequence : outDispatchSeq was added to the Synapse configuration successfully
[2020-09-29 14:55:01,736]  INFO - DependencyTracker Sequence : _graphql_failure_handler was added to the Synapse configuration successfully
[2020-09-29 14:55:01,739]  INFO - DependencyTracker Sequence : _production_key_error_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,804]  INFO - DependencyTracker Proxy service : WorkflowCallbackService was added to the Synapse configuration successfully
[2020-09-29 14:55:01,840]  INFO - DependencyTracker API : _WSO2AMRevokeAPI_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,885]  INFO - DependencyTracker API : _WSO2AMUserInfoAPI_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,918]  INFO - DependencyTracker API : _OpenService_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,959]  INFO - DependencyTracker API : _WSO2AMTokenAPI_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,972]  INFO - DependencyTracker API : _WSO2AMAuthorizeAPI_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,988]  INFO - DependencyTracker API : _WSO2AMOpenIDConfigAPI_ was added to the Synapse configuration successfully
[2020-09-29 14:55:01,992]  INFO - DependencyTracker Inbound Endpoint : WebSocketInboundEndpoint was added to the Synapse configuration successfully
[2020-09-29 14:55:01,993]  INFO - DependencyTracker Inbound Endpoint : SecureWebSocketEP was added to the Synapse configuration successfully
[2020-09-29 14:55:01,993]  INFO - SynapseConfigurationBuilder Loaded Synapse configuration from the artifact repository at : ././repository/deployment/server/synapse-configs/default
[2020-09-29 14:55:01,994]  INFO - DependencyTracker Local entry : SERVER_HOST was added to the Synapse configuration successfully
[2020-09-29 14:55:01,995]  INFO - DependencyTracker Local entry : SERVER_IP was added to the Synapse configuration successfully
[2020-09-29 14:55:02,084]  INFO - Axis2SynapseController Loading mediator extensions...
[2020-09-29 14:55:02,183]  INFO - DeploymentInterceptor Deploying Axis2 service: echo {super-tenant}
[2020-09-29 14:55:02,209]  INFO - DeploymentInterceptor Deploying Axis2 service: Version {super-tenant}
[2020-09-29 14:55:02,224]  INFO - EventStreamDeployer Stream definition is deployed successfully  : id_gov_notify_stream:1.0.0
[2020-09-29 14:55:02,226]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.apimgt.cache.invalidation.stream:1.0.0
[2020-09-29 14:55:02,228]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.apimgt.keymgt.stream:1.0.0
[2020-09-29 14:55:02,229]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.apimgt.notification.stream:1.0.0
[2020-09-29 14:55:02,230]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.apimgt.recommendation.event.stream:1.0.0
[2020-09-29 14:55:02,231]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.apimgt.token.revocation.stream:1.0.0
[2020-09-29 14:55:02,232]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.blocking.request.stream:1.0.0
[2020-09-29 14:55:02,233]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.botDetectionData.request.stream:1.0.0
[2020-09-29 14:55:02,234]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.keytemplate.request.stream:1.0.0
[2020-09-29 14:55:02,235]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:02,236]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.throttle.globalThrottle.stream:1.1.0
[2020-09-29 14:55:02,237]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:02,239]  INFO - EventStreamDeployer Stream definition is deployed successfully  : org.wso2.throttle.request.stream:1.0.0
[2020-09-29 14:55:02,287]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:id_gov_notify_stream:1.0.0
[2020-09-29 14:55:02,290]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : EmailPublisher
[2020-09-29 14:55:02,294]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.apimgt.recommendation.event.stream:1.0.0
[2020-09-29 14:55:02,296]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : HTTP-recommendationEventPublisher
[2020-09-29 14:55:02,299]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.blocking.request.stream:1.0.0
[2020-09-29 14:55:02,322]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : blockingEventJMSPublisher
[2020-09-29 14:55:02,323]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.apimgt.cache.invalidation.stream:1.0.0
[2020-09-29 14:55:02,324]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : cacheInvalidationJMSPublisher
[2020-09-29 14:55:02,325]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:02,325]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : jmsEventPublisher
[2020-09-29 14:55:02,326]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:02,327]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : jmsEventPublisher2
[2020-09-29 14:55:02,327]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.1.0
[2020-09-29 14:55:02,328]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : jmsEventPublisher-1.0.0
[2020-09-29 14:55:02,328]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.1.0
[2020-09-29 14:55:02,329]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : jmsEventPublisher-1.0.0-2
[2020-09-29 14:55:02,330]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.keytemplate.request.stream:1.0.0
[2020-09-29 14:55:02,330]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : keyTemplateEventPublisher
[2020-09-29 14:55:02,331]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.apimgt.keymgt.stream:1.0.0
[2020-09-29 14:55:02,331]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : keymgtEventJMSEventPublisher
[2020-09-29 14:55:02,332]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.apimgt.notification.stream:1.0.0
[2020-09-29 14:55:02,333]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : notificationJMSPublisher
[2020-09-29 14:55:02,333]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.apimgt.token.revocation.stream:1.0.0
[2020-09-29 14:55:02,334]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : tokenRevocationJMSPublisher
[2020-09-29 14:55:02,335]  INFO - EventJunction WSO2EventConsumer added to the junction. Stream:org.wso2.apimgt.token.revocation.stream:1.0.0
[2020-09-29 14:55:02,335]  INFO - EventPublisherDeployer Event Publisher configuration successfully deployed and in active state : tokenRevocationJMSPublisher2
[2020-09-29 14:55:02,346]  INFO - InputAdapterRuntime Connecting receiver blockingWso2EventReceiver
[2020-09-29 14:55:02,346]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.blocking.request.stream:1.0.0
[2020-09-29 14:55:02,347]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: blockingWso2EventReceiver
[2020-09-29 14:55:02,348]  INFO - InputAdapterRuntime Connecting receiver cacheInvalidationWso2EventReceiver
[2020-09-29 14:55:02,349]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.apimgt.cache.invalidation.stream:1.0.0
[2020-09-29 14:55:02,349]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: cacheInvalidationWso2EventReceiver
[2020-09-29 14:55:02,350]  INFO - InputAdapterRuntime Connecting receiver keyMgtWso2EventReceiver
[2020-09-29 14:55:02,379]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.apimgt.keymgt.stream:1.0.0
[2020-09-29 14:55:02,379]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: keyMgtWso2EventReceiver
[2020-09-29 14:55:02,380]  INFO - InputAdapterRuntime Connecting receiver keyTemplateWso2EventReceiver
[2020-09-29 14:55:02,381]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.keytemplate.request.stream:1.0.0
[2020-09-29 14:55:02,381]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: keyTemplateWso2EventReceiver
[2020-09-29 14:55:02,382]  INFO - InputAdapterRuntime Connecting receiver notificationsWSO2EventReceiver
[2020-09-29 14:55:02,382]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.apimgt.notification.stream:1.0.0
[2020-09-29 14:55:02,383]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: notificationsWSO2EventReceiver
[2020-09-29 14:55:02,384]  INFO - InputAdapterRuntime Connecting receiver recommendationWso2EventReceiver
[2020-09-29 14:55:02,384]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.apimgt.recommendation.event.stream:1.0.0
[2020-09-29 14:55:02,384]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: recommendationWso2EventReceiver
[2020-09-29 14:55:02,391]  INFO - InputAdapterRuntime Connecting receiver throttleEventReceiver
[2020-09-29 14:55:02,393]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.request.stream:1.0.0
[2020-09-29 14:55:02,393]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: throttleEventReceiver
[2020-09-29 14:55:02,394]  INFO - InputAdapterRuntime Connecting receiver throttleWSO2EventReceiver
[2020-09-29 14:55:02,394]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.request.stream:1.0.0
[2020-09-29 14:55:02,395]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: throttleWSO2EventReceiver
[2020-09-29 14:55:02,395]  INFO - InputAdapterRuntime Connecting receiver tokenRevocationWso2EventReceiver
[2020-09-29 14:55:02,396]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.apimgt.token.revocation.stream:1.0.0
[2020-09-29 14:55:02,396]  INFO - EventReceiverDeployer Event Receiver configuration successfully deployed and in active state: tokenRevocationWso2EventReceiver
[2020-09-29 14:55:02,718]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:02,719]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.request.stream:1.0.0
[2020-09-29 14:55:02,720]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : requestPreProcessorExecutionPlan
[2020-09-29 14:55:02,885]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:02,885]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:02,886]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_app_10PerMin
[2020-09-29 14:55:02,929]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:02,929]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:02,930]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_app_20PerMin
[2020-09-29 14:55:03,004]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,005]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,005]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_app_50PerMin
[2020-09-29 14:55:03,088]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,088]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,089]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_resource_10KPerMin_default
[2020-09-29 14:55:03,135]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,136]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,136]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_resource_20KPerMin_default
[2020-09-29 14:55:03,213]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,213]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,214]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_resource_50KPerMin_default
[2020-09-29 14:55:03,294]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,295]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,295]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_sub_Bronze
[2020-09-29 14:55:03,386]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,386]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,387]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_sub_Gold
[2020-09-29 14:55:03,438]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,439]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0
[2020-09-29 14:55:03,440]  INFO - EventProcessorDeployer Execution plan is deployed successfully and in active state  : carbon.super_sub_Silver
[2020-09-29 14:55:03,531]  INFO - EventJunction Producer added to the junction. Stream:org.wso2.throttle.globalThrottle.stream:1.0.0
[2020-09-29 14:55:03,532]  INFO - EventJunction Consumer added to the junction. Stream:org.wso2.throttle.processed.request.stream:1.0.0

@chirangaalwis Please let me know if any step followed by me needs correction.

abhi1git commented 3 years ago

Hi @chirangaalwis

Even after mounting configmaps for files like axis2.xml, output-adapters.xml and identity.xml by following the same method(mounting configmaps in wso2-config-volume directory) which is applied for deployment.toml the provided custom changes in config are not reflected in the home directory location for the previously mentioned files.

Also to ensure again I have tried this on a local Linux environment also with the Debian installation. In this case also, the changes done in axis2.xml, identity.xml configuration files are overriden by wso2 application when wso2server is started.

We are soon planning to move wso2 kubernetes setup to production and need to get this custom configurations in place.

Can you please provide a method or any working example for this scenario which lets users provide custom configurations for various files in helm chart.

rafstef commented 3 years ago

We have a similar problem.

When we try to add the deployment.toml with a config map mounted under

/home/wso2carbon/wso2-config-volume/repository/conf/deployment.toml

the entrypoint give the us the follow errors:

Optimizing WSO2 Carbon Server [2021-04-07 14:52:12] INFO - Starting to optimize API Manager for the Gateway worker profile [2021-04-07 14:52:12] INFO - Starting to optimize configs in deployment.toml [2021-04-07 14:52:12] INFO - Renamed the existing ../repository/conf/deployment.toml file as deployment.toml.backup [2021-04-07 14:52:12] INFO - Copied the existing ../repository/resources/conf/deployment-templates/gateway-worker.toml file as ../repository/conf/deployment.to [2021-04-07 14:52:12] INFO - Removed the api#identity#user#v1.0.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#am#admin#v0.17.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the oauth2.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#identity#consent-mgt#v1.0.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#identity#oauth2#v1.0.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the accountrecoveryendpoint file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#am#store.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#identity#recovery#v0.9.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the client-registration#v0.17.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#am#admin.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the am#sample#calculator#v1.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#am#publisher.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the keymanager-operations.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api#identity#oauth2#dcr#v1.1.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the internal#data#v1.war file from ../repository/deployment/server/webapps [2021-04-07 14:52:12] INFO - Removed the api file from ../repository/deployment/server/webapps [2021-04-07 14:52:13] INFO - Removed the authenticationendpoint file from ../repository/deployment/server/webapps [2021-04-07 14:52:13] INFO - Removed devportal directory from ../repository/deployment/server/jaggeryapps [2021-04-07 14:52:13] INFO - Removed publisher directory from ../repository/deployment/server/jaggeryapps [2021-04-07 14:52:13] INFO - Removed admin directory from ../repository/deployment/server/jaggeryapps Finished the optimizations Start WSO2 Carbon server JAVA_HOME environment variable is set to /opt/java/openjdk CARBON_HOME environment variable is set to /home/wso2carbon/wso2am-3.2.0 Using Java memory options: -Xms256m -Xmx1024m [2021-04-07 14:52:14,249] INFO {org.wso2.config.mapper.ConfigParser} - Initializing configurations with deployment configurations [2021-04-07 14:52:15,144] SEVERE {org.wso2.carbon.server.Main handleConfiguration} - Error while performing configuration changes org.wso2.config.mapper.ConfigParserException: Error while store new configurations at org.wso2.config.mapper.ConfigParser.parse(ConfigParser.java:140) at org.wso2.carbon.server.Main.handleConfiguration(Main.java:236) at org.wso2.carbon.server.Main.main(Main.java:107) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.wso2.carbon.bootstrap.Bootstrap.loadClass(Bootstrap.java:69) at org.wso2.carbon.bootstrap.Bootstrap.main(Bootstrap.java:51) Caused by: java.io.IOException: Permission denied at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method) at java.base/java.io.File.createNewFile(File.java:1026) at org.wso2.config.mapper.ConfigParser.deploy(ConfigParser.java:231) at org.wso2.config.mapper.ConfigParser.deployAndStoreMetadata(ConfigParser.java:188) at org.wso2.config.mapper.ConfigParser.parse(ConfigParser.java:135)