I have created a framework which I am integrating into an app via cocoapods. I need to add a functionality to it which is dependent on another pod. The pod which is needed for my framework to function is not open source. Is there a possibility of specifying the path in the podspec?
Related
I need to automate the provisioning of a complex application in Kubernetes. It's a complex, multi-step process that involves provisioning of some cluster-wide resources and some app-specific resources. The cluster-wide resources are:
Istio
A few Operators (Cert Manager, Prometheus Operator, Postgres Operator, among others)
Then I want to create an application (let's call it Foo) which leverages Istio and the aforementioned operators. It will create statefulsets, services, Certificates, a Postgres database, Istio gateways, Prometheus PodMonitors, etc.
There will be multiple Foo's created, each configured differently (since the Kubernetes cluster will be used to provide Foo applications as a multi-tenant service).
What's the idiomatic way to do this? I think I should write a Foo controller which assumes that Istio and the other operators (prometheus, cert-manager, postgres, etc) already exist.
Is it possible to write a meta ClusterOfFoos operator that installs Istio, installs the required operators, and then installs the Foo controller?
If so, how does one go about provisioning operators (normally installed through Helm) from within a controller?
So far I have looked into using helm to do this, but there are too many dependencies and Helm just tends to create all resources at once, which makes some things fail (eg. when a deployment refers to a Secret that hasn't yet been created by cert-manager).
The Operator Lifecycle Manager is really well suited for the task.
When you create operator Foo, you can package it in the OLM way by creating a bundle which contains the ClusterServiceVersion needed to inform OLM of dependencies that need to be resolved before install and during upgrades. These can just be a list of APIs you need - and OLM will find and install the set of latest versions of the operators that own each API.
All your dependencies are operators available in the Operatorhub.io Catalog so they are available for install and dependency resolution as soon as you install OLM.
You can also configure certain dependencies by including these objects in the bundle itself. According to the docs, the following objects are supported as of the time of this post:
Secret
ClusterRole
ClusterRoleBinding
ConfigMap
ServiceAccount
Service
Role
RoleBinding
PrometheusRule
ServiceMonitor
PodDisruptionBudget
PriorityClasse
VerticalPodAutoscaler
ConsoleYAMLSample
ConsoleQuickStart
ConsoleCLIDownload
ConsoleLink
The Operator SDK can help you with bootstrapping the bundle.
By using GitOps workflow you can automate complex applications in Kubernetes.
You need to define cluster-wide resources and application specific resources in a YAML file.
By using GitOps tools you can continuously deploy kubernetes resources and they will automatically deploy the changes in the cluster.
Use Helm chart to install Istio and make sure dependencies in the Helm chart are created in order.
You can create a custom controller by FOO where it can read configuration of YAML files.
Use kubernetes CRDs to define configuration of each FOO; they will allow you to create custom resources which are specific for each application.
By using Helm; it will read the configuration from the CRD and generate correct YAML values.
The above described approach will allow you to create multiple FOO applications with different configurations and ensure that the required resources are installed in correct order.
You can check this article from codefresh regarding GitOps Workflow and official kubernetes page.
You can also check Working with Multiple Applications and Environments and how Argo CD is useful for this scenario.
I have an HTTP application (Odoo). This app support install/updating modules(addons) dynamically.
I would like to run this app in a Kubernetes cluster. And I would like to dynamically install/update the modules.
I have 2 solutions for this problem. However, I was wondering if there are other solutions.
Solution 1:
Include the custom modules with the app in the Docker image
Every time I made a change in the custom module and push it to a git repository. Jinkins pull the changes and create a new image and then apply the new changes to the Kubernetes cluster.
Advantages: I can manage the docker image version and restart an image if something happens
Drawbacks: This solution is not bad for production however the list of all custom module repositories should all be included in the docker file. Suppose that I have two custom modules each in its repository a change to one of them will lead to a rebuild of the whole docker image.
Solution 2:
Have a persistent volume that contains only the custom modules.
If a change is made to a custom module it is updated in the persistent volume.
The changes need to apply to each pod running the app (I don't know maybe doing a restart)
Advantages: Small changes don't trigger image build. We don't need to recreate the pods each time.
Drawbacks: Controlling the versions of each update is difficult (I don't know if we have version control for persistent volume in Kubernetes).
Questions:
Is there another solution to solve this problem?
For both methods, there is a command that should be executed in order to take the module changes into consideration odoo --update "module_name". This command should include the module name. For solution 2, How to execute a command in each pod?
For solution 2 is it better to restart the app service(odoo) instead of restarting all the nodes? Meaning, if we can execute a command on each pod we can just restart the service of the app.
Thank you very much.
You will probably be better off with your first solution. Specially if you already have all the toolchain to rebuild and deploy images. It will be easier for you to rollback to previous versions and also to troubleshoot (since you know exactly which version is running in each pod).
There is an alternative solution that is sometime used to provision static assets on web servers: You can add an emptyDir volume and a sidecar container to the pod. The sidecar pull the changes from your plugins repositories into the emptyDir at fixed interval. Finally your app container, sharing the same emptyDir volume will have access to the plugins.
In any case running the command to update the plugin is going to be complicated. You could do it at fixed interval but your app might not like it.
I have created custom frameworks to use in my current iOS app.
profileManager.Framework
messagemanager.Framework
requestManager.Framework
Now both profileManager.Framework & messagemanager.Framework are actually using requestManager.Framework methods so what I want is that in my Xcode project of app I only want to keep only one physical copy of the requestManager.Framework code.I want that my request manager code should have only one copy per app and the reference should be linked with other framework.
We have created this frameworks on local machine & now my problem is we can't add dependencies in profileManager.Framework or either in messagemanager.Framework. I want to know that how it can be possible that my both framework will use network manager from app with a single copy of its in application.
Have that framework at your single view application level and make sure the framework path is given correct in build settings of App and as well as Framework.
This way you maintains only one copy of framework that too at Project level and feel free to use in Project or Project Framework level.
How about trying to manage the dependencies of those frameworks with CocoaPods?
In the podspec of UserManager.Framework and InboxManager.Framework , configure the dependencey like s.dependency 'NetworkManager', '~> 1.0'. In this way, you can have only one physical copy of the NetworkManager.framework code in your app.
For example, AlamofireImage and Alamofire-SwiftyJSON both have the dependency on Alamofire but only one physical copy of the Alamofire.framework installed in the app with running pod install.
Reference: AlamofireImage.podspec, Alamofire-SwiftyJSON.podspec
I'm trying to add pod support to custom framework. I have added Speechkit as dependency in pod spec. while running pod lib lint, i'm getting following error message
Error Message
Thanks in advance
I'm not very sure about that, but it seems that until the static library dependency you rely on is changed into a dynamic framework, you have no other choice than waiting for it to happen : check this issue.
I usually use the same pods for multiple projects, however I find myself having to run pod install each time. Isn't there a way to reuse existing pods for every new project?
I know in rails the way to do this is by copying Gemfile.lock and then running bundle install and that would avoid having to download all the gems (ie packages/libraries) from their respective repos.. further, Podfile.lock is pretty much coacoa pod's counterpart to Gemlock.file (ie it keeps track of the specific pod versions that got copied over). I'm guessing there must be a way to transfer specific pods from one project to another similar to how it's done on rails.