在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):KohlsTechnology/eunomia开源软件地址(OpenSource Url):https://github.com/KohlsTechnology/eunomia开源编程语言(OpenSource Language):Go 70.9%开源软件介绍(OpenSource Introduction):Eunomia - a GitOps Operator for KubernetesProject Deprication and ArchivalAs of March 9, 2022 this project is no longer maintained. This repository is being archived(marked as read only). Who is EunomiaAccording to Wikipedia:
How to Pronounce itEunomia is pronounced: yuˈnoʊ mi ə. The English phonetic respelling is yoo-noh-mee-uh. You can listen to it here and here. What is GitOpsGitOps is all about turning day 2 operations into code! Not just that, it means you start thinking about day 2 on day 1. This is a dream come true for any Operations team! GitOps leverages the strength of automation and combines it with the power of git based workflows. It is a natural evolution beyond infrastructure-as-code and builds on top of DevOps best practices. Next Generation Change ManagementEspecially in large Enterprises, Change Management is usually a painful experience. GitOps allows to take a lot of that pain out and streamline the process itself. It does so by still providing what the process tries to accomplish (and thus still meet audit requirements), but does so in a way that is much faster, much more secure, and much more reliable. Your changes now all of a sudden provide:
What's your backout plan for your change? How about simply moving back to the previous commit and getting EXACTLY what you had before? PurposeThe Eunomia provides the ability to implement these git-based flows for any resources in Kubernetes. Eunomia does not care if you have a plain Kubernetes, a cloud based Kubernetes (like GKE), or a complete PaaS platform based on Kubernetes (like OpenShift). Eunomia also does not care how you want to structure your data, how many repos you want to use, or which templating engine is your favourite. Eunomia can handle straight-up (static) yaml files with the complete definition or create dynamic ones based on your templating engine of choice. Eunomia already supports Helm Charts, OpenShift Templates, and Jinja2 Templates, but can easily be extended to support others. These templates will be merged and processed with a set of environment-specific parameters to get a list of resource manifests. Then these manifest can be created/updated/deleted in Kubernetes. Getting startedIf you want to deploy Eunomia from scratch to a local Minikube cluster, begin with the Getting started document. It will guide your through the setup step-by-step. VisionWhile this controller can certainly be used to directly populate an individual namespace with a configuration stored in git, the vision is that a hierarchy of controllers will be used to populate multiple namespaces. Ideally this approach will be used to bring a newly created cluster to a desired configured state. Only the initial seeding CR (Custom Resource) should have cluster-level permissions. Any sub-CRs should have progressively less access assigned to their service accounts. Here is a very simple example of how the hierarchy might look like: The main sections of the GitOpsConfig CRD (Custom Resource Definition) are described below. ExampleThe configuration is described in the GitOpsConfig CRD, here is an example: apiVersion: eunomia.kohls.io/v1alpha1
kind: GitOpsConfig
metadata:
name: simple-test
spec:
# Add fields here
templateProcessorArgs: "-e cluster_name=my_cluster_name"
templateSource:
uri: https://github.com/KohlsTechnology/eunomia
ref: master
contextDir: simple/templates
secretRef: template-gitconfig
parameterSource:
contextDir: simple/parameters
secretRef: parameter-gitconfig
triggers:
- type: Change
- type: Webhook
- type: Periodic
cron: "0 * * * *"
serviceAccountRef: "mysvcaccount"
templateProcessorImage: "quay.io/kohlstechnology/eunomia-base:latest"
resourceDeletionMode: "Delete"
resourceHandlingMode: "Apply" TemplateSource and ParameterSource and TemplateProcessorArgsThe The The fields of this section are: templateProcessorArgs: "-e cluster_name=my_cluster_name"
templateSource:
uri: https://github.com/KohlsTechnology/eunomia
ref: master
contextDir: simple/templates
httpProxy: <http proxy>
httpsProxy: <https proxy>
noProxy: <no Proxy>
SecretRef: <gitconfig and credentials secret>
parameterSource:
uri: https://github.com/KohlsTechnology/eunomia
ref: master
contextDir: seed/parameters
httpProxy: <http proxy>
httpsProxy: <https proxy>
noProxy: <no Proxy>
SecretRef: <gitconfig and credentials secret> These are the mandatory constraints and default behaviors of the fields:
If a secret is provided, then it is assumed that the connection to Git requires authentication. See the [Git Authentication](#git\ authentication) section below for more details. If the Git SubmodulesSome helm charts might require the configuration to be part of the chart itself (you can't read files from outside the chart). Loading files into a configmap is one example of this. Separating the charts (templateSource) from the actual configuration (parameterSource) is a best practice. This allows you to separate your code (templates) from your configuration, which helps tremendously with change management. One way to go about this is to use the config repo as a submodule and point to the master branch. During development you can of course point against another branch, just make sure you correct it in Add submodule to track master branch
Checking out a repo with submodules
parameterSource processingEunomia uses the yq command to merge all yaml files in the specified folder. You have to be careful, if you have the same variable name in multiple files. Dictionaries will merge, lists will get overwritten. Variable HierarchyYou can provide a file The contents of the file are simply relative path names, with the base being Example
In this case it will load all yaml files from Upcoming featuresOnce issue #4 is resolved, you will be able to specify variable names to dynamically determine the correct folder. This will allow you to only have one Git AuthenticationSpecifying a This secret will be linked from Username and password authenticationFor username and password based authentication create the following [http]
sslCAInfo = /template-gitconfig/ca.crt
[user]
name = gitconfig
[credential]
helper = store When the credential helper is of type
Don't forget to provide the Certificate based authenticationFor certificate based authentication, create the following [core]
sshCommand = "ssh -i /template-gitconfig/mykey.rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" and add the Job templatesFor Eunomia to work properly there is a need for a specific A If you want to provide your own job templates, set the env variables TriggersYou can enable one or multiple triggers.
GitHub webhook configurationTo set up GitHub webhook follow this GitHub documentation.
Create route on port 8080 to eunomia-service and use this route as GitHub webhook Content type needs to be set to Choose Template EngineWhen it's time to apply a configuration, the GitOps controller runs a job pod. The image of the job pod can be specified in the
Currently the following templating engines are supported (follow the link to see examples of how new template processors can be added): serviceAccountRefThis is the service account used by the job pod that will process the resources. The service account must be present in the same namespace as the one where the GitOpsConfig CR is and must have enough permission to manage the resources. It is out of scope of this controller how that service account is provisioned, although you can use a different GitOpsConfig CR to provision it (seeding CR). In the Helm deployment, the Resource Handling ModeThis field specifies how resources should be handled, once the templates are processed. The following modes are currently supported:
Resource Deletion ModeThis field specifies how to handle resources when the GitOpsConfig object is deleted. Two options are available:
Installing EunomiaInstalling on Kubernetes Using HelmSee the helm README for details. Installing on Kubernetes Using Operator HubSee the getting started document for details. Examples / DemosWe've created several examples for you to test out Eunomia. See EXAMPLES for details. MonitoringMonitoring with PrometheusPrometheus is an open-source systems monitoring and alerting toolkit. Prometheus collects metrics from monitored targets by scraping metrics HTTP endpoints.
By default, the metrics in Operator SDK are exposed on For more information, see Metrics in Operator SDK Usage:
You can find additional examples on their GitHub page. Verify metrics port:kubectl exec (e.g. Kubernetes EventsEunomia emits the following events in the namespace of the GitOpsConfig CR:
DevelopmentPlease see our development documentation for details. TroubleshootingPlease see our troubleshooting guide for details. LicenseSee LICENSE for details. Code of ConductSee CODE_OF_CONDUCT.md for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论