Git Product home page Git Product logo

avionix's People

Contributors

joshdrake-minted avatar viral95 avatar zbrookle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

avionix's Issues

KeyError: 'NAME' when kube config has wrong permissions

What i'm trying to do:
install chart with ChartBuilder, sample code

 if builder.is_installed:
        builder.upgrade_chart()
 else:
        builder.install_chart()

What i'd expect to happen:
either install or upgrade chart

What actually happens:
i get a weird KeyError on this object:

  File "/home/federico/.local/lib/python3.8/site-packages/avionix/chart/chart_builder.py", line 316, in upgrade_chart
    self.__check_if_installed()
  File "/home/federico/.local/lib/python3.8/site-packages/avionix/chart/chart_builder.py", line 245, in __check_if_installed
    if not self.is_installed:
  File "/home/federico/.local/lib/python3.8/site-packages/avionix/chart/chart_builder.py", line 336, in is_installed
    return self.chart_info.name in installations["NAME"]
KeyError: 'NAME'

Solution:
after debugging and keeping note of the object i found the problem and solved it: if the kube config file in /home//.kube/config is group or world readable, when you run helm list helm returns a warning "YOUR KUBE CONFIG IS WORLD READABLE; THIS IS INSECURE" and your parser mixes the error message in the dictionary which is supposed to contain the installed charts.
As a result anyone with wrong permissions on the config file won't be able to install/upgrade charts.

if you could raise an exception or something to let the user know they should fix the permissions on their file it could be useful for the next guy who has the same problem.

Thank you!

Deploying existing charts without building

Hi @zbrookle , I came accross your post on stackoverflow while looking for a viable solution to deploy helm charts with Python 3.
What I need might be already baked into Avionix already but couldn't find a documentation regarding how to do this so just wanted to reach out to you.
I'm looking to simply deploy existing helm charts from existing repositories without having to build the specs from ground up. As an example, let's suppose I just want to deploy harbor chart and what I do basically is:

helm repo add harbor https://helm.goharbor.io
helm install my-release harbor/harbor

Is this possible with Avionix? If not, are there any plans for the implementation?
Thanks

Helm 2 and 3 support

Is there a chance Helm 2 will be officially supported by avionix? So far it is unclear how it operates with Helm 2.

Add support for values.yaml

Create an implementation of values.yaml that will allow for it's use in a similar way to classic helm charts, allowing for backwards compatibility if a user wants to publish their chart in the Helm eco system

output_directory in chart builder is ignored

Hi,
changing the output directory in chart builder lead to unwanted behaviors, indeed it is considered only when writing out new chart files, not when deleting them after installation:

def __delete_chart_directory(self):
    if os.path.exists(self.chart_info.name):
        shutil.rmtree(self.chart_info.name)

(chart_info.name doesn't include the set output_directory).
Especially during upgrades, this cause merging values from old installations, differently from the expected program behavior.
I think the fix is really easy to implement (I also noticed there is a pretty old issue request to resolve this bug).
Please let me know if you prefer I fix this in a new merge request.

is it still active?

is this repo still active?

are future updates to be expected or is it up for maintenance? i am asking for the fast paced nature of kubernetes and its api.

Installing charts from local folders

Is it possible lo load and install charts from local repo without creating them? The same way it is done by pyhelm. It was hard to find any info in the documentation - it showed how to build the chart first from an external URL, but is there a simple command for a local repo?

Example from pyhelm:

chart = ChartBuilder(json)
tiller.install_release(chart=chart.get_helm_chart(), namespace='default', dry_run=False)

If I look into the source code, ChartDependency takes a URL and then checks out the local repo. But what if I already have a local repo? Can it be a new feature?

Can avionix build a CustomResource?

I see there are some classes to build CustomResourceDefinitions but I can't see anything in the code to build a CustomResource. Is there a way to use avionix to build a CustomResource and package it as a helm chart?

get_helm_installations doesn't support --kube-context

def get_helm_installations(namespace: Optional[str] = None):

Without taking an options dict, we can't pass kube-context to tell helm which cluster to get the installations from. (Well we can, because the string handling isn't secure, we can just use f"{namespace} --kube-context {context}" for the namespace name, but that seems abusive).

def is_installed(self):

is_installed as a property also has no way to pass the context. But that seems like a bigger lift to improve.

Change chart name and set chart path

Howdy,

So I have read over the documentation a little bit and noticed there does not appear to be a way to override the chart path for the class ChartBuilder. The class uses the chart_info name property when building the path. I made an update to deal with this in my local work but was curious if there is a better way to do this?

For context, I need to deploy multiple charts with similar configurations but with different chart names.

Built-in object support

Hi,

Is it possible to use built-in objects such as?

metadata:
  name: {{.Release.Name}}-{{.Chart.Name}}

Thanks
Schmil

Add support for new Ingress APIs

Ingress with the extensions/v1beta1 API was deprecated in 1.16. The following two API versions map to the corresponding k8s versions:

API Version Kubernetes Version
networking.k8s.io/v1beta1 1.14 - 1.18
networking.k8s.io/v1 1.19+

Furthermore, the current Ingress class has the _non_standard_version set to v1beta1, which makes it impossible to override the apiVersion with the parameter when instantiating it.

I'm fairly new to using this library (thanks, by the way!), so I'm unsure how you'd prefer to handle this. If it's relatively straightforward, feel free to provide some high-level guidance and I can work on a PR.

Design decisions and discussion

Hi there!

I saw your comment over on cdk8s-team/cdk8s#21 but didn't want to answer there as it goes off-topic quite fast. Just like you I am working on something similar to cdk8s. I started it after finding cdk8s and getting frustrated with it ๐Ÿ˜… (or actually frustrated with myself as I tried patching cdk8s but was to lazy to understand all the typescript-binding magic) So I thought maybe we could have a discussion about some design decisions as we might have similar goals. At least the python and helm focus is there so far ;)

I looked through your repo but didn't find any examples of how avionix looks in action. In the issue you said you generate helm charts - just like me :) But my helm charts are just single yamls with all the definitions inside. I thought about implementing something to also support values but I decided against it as the generation of the yamls is already dynamic and wanted to keep it simple. What is your use case? ArgoCD as well? Why not have "values" for your python chart?

The use case of @cweidinger for different environments / regions within ArgoCD I have not yet looked into, will have to talk to a colleague who knows more about ArgoCD. But in our use cases so far where we use my pdk8s deployment is generation time of the chart. So I can just access env variables or even execute kubectl to get state ouf of my target.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.