forked from ansible/awx-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,302 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
/bundle | ||
/bundle_tmp* | ||
/bundle.Dockerfile | ||
/charts | ||
/.cr-release-packages | ||
.vscode/ | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
appVersion: "0.26.0-60-gfd44676" | ||
description: A Helm chart for the AWX Operator | ||
name: awx-operator | ||
type: application | ||
version: 0.26.0-60-gfd44676 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# AWX Operator Helm Chart | ||
|
||
This chart installs the AWX Operator resources configured in [this](https://github.com/ansible/awx-operator) repository. | ||
|
||
## Getting Started | ||
To configure your AWX resource using this chart, create your own `yaml` values file. The name is up to personal preference since it will explicitly be passed into the helm chart. Helm will merge whatever values you specify in your file with the default `values.yaml`, overriding any settings you've changed while allowing you to fall back on defaults. Because of this functionality, `values.yaml` should not be edited directly. | ||
|
||
In your values config, enable `AWX.enabled` and add `AWX.spec` values based on the awx operator's [documentation](https://github.com/ansible/awx-operator/blob/devel/README.md). Consult the docs below for additional functionality. | ||
|
||
### Installing | ||
The operator's [helm install](https://github.com/ansible/awx-operator/blob/devel/README.md#helm-install-on-existing-cluster) guide provides key installation instructions. | ||
|
||
Example: | ||
``` | ||
helm install my-awx-operator awx-operator/awx-operator -n awx --create-namespace -f myvalues.yaml | ||
``` | ||
|
||
Argument breakdown: | ||
* `-f` passes in the file with your custom values | ||
* `-n` sets the namespace to be installed in | ||
* This value is accessed by `{{ $.Release.Namespace }}` in the templates | ||
* Acts as the default namespace for all unspecified resources | ||
* `--create-namespace` specifies that helm should create the namespace before installing | ||
|
||
To update an existing installation, use `helm upgrade` instead of `install`. The rest of the syntax remains the same. | ||
|
||
## Configuration | ||
The goal of adding helm configurations is to abstract out and simplify the creation of multi-resource configs. The `AWX.spec` field maps directly to the spec configs of the `AWX` resource that the operator provides, which are detailed in the [main README](https://github.com/ansible/awx-operator/blob/devel/README.md). Other sub-config can be added with the goal of simplifying more involved setups that require additional resources to be specified. | ||
|
||
These sub-headers aim to be a more intuitive entrypoint into customizing your deployment, and are easier to manage in the long-term. By design, the helm templates will defer to the manually defined specs to avoid configuration conflicts. For example, if `AWX.spec.postgres_configuration_secret` is being used, the `AWX.postgres` settings will not be applied, even if enabled. | ||
|
||
### External Postgres | ||
The `AWX.postgres` section simplifies the creation of the external postgres secret. If enabled, the configs provided will automatically be placed in a `postgres-config` secret and linked to the `AWX` resource. For proper secret management, the `AWX.postgres.password` value, and any other sensitive values, can be passed in at the command line rather than specified in code. Use the `--set` argument with `helm install`. | ||
|
||
|
||
## Values Summary | ||
|
||
### AWX | ||
| Value | Description | Default | | ||
|---|---|---| | ||
| `AWX.enabled` | Enable this AWX resource configuration | `false` | | ||
| `AWX.name` | The name of the AWX resource and default prefix for other resources | `"awx"` | | ||
| `AWX.spec` | specs to directly configure the AWX resource | `{}` | | ||
| `AWX.postgres` | configurations for the external postgres secret | - | | ||
|
||
|
||
# Contributing | ||
|
||
## Adding abstracted sections | ||
Where possible, defer to `AWX.spec` configs before applying the abstracted configs to avoid collision. This can be facilitated by the `(hasKey .spec what_i_will_abstract)` check. | ||
|
||
## Building and Testing | ||
This chart is built using the Makefile in the [awx-operator repo](https://github.com/ansible/awx-operator). Clone the repo and run `make helm-chart`. This will create the awx-operator chart in the `charts/awx-operator` directory. In this process, the contents of the `.helm/starter` directory will be added to the chart. | ||
|
||
## Future Goals | ||
All values under the `AWX` header are focused on configurations that use the operator. Configurations that relate to the Operator itself could be placed under an `Operator` heading, but that may add a layer of complication over current development. |
116 changes: 116 additions & 0 deletions
116
charts/awx-operator/crds/customresourcedefinition-awxbackups.awx.ansible.com.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
labels: | ||
helm.sh/chart: awx-operator-0.26.0-60-gfd44676 | ||
name: awxbackups.awx.ansible.com | ||
spec: | ||
group: awx.ansible.com | ||
names: | ||
kind: AWXBackup | ||
listKind: AWXBackupList | ||
plural: awxbackups | ||
singular: awxbackup | ||
scope: Namespaced | ||
versions: | ||
- name: v1beta1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Schema validation for the AWXBackup CRD | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
backup_pvc: | ||
description: Name of the backup PVC | ||
type: string | ||
backup_pvc_namespace: | ||
description: (Deprecated) Namespace the PVC is in | ||
type: string | ||
backup_resource_requirements: | ||
description: Resource requirements for the management pod used to create a backup | ||
properties: | ||
limits: | ||
properties: | ||
cpu: | ||
type: string | ||
memory: | ||
type: string | ||
type: object | ||
requests: | ||
properties: | ||
cpu: | ||
type: string | ||
memory: | ||
type: string | ||
type: object | ||
type: object | ||
backup_storage_class: | ||
description: Storage class to use when creating PVC for backup | ||
type: string | ||
backup_storage_requirements: | ||
description: Storage requirements for backup PVC (may be similar to existing postgres PVC backing up from) | ||
type: string | ||
clean_backup_on_delete: | ||
description: Flag to indicate if backup should be deleted on PVC if AWXBackup object is deleted | ||
type: boolean | ||
deployment_name: | ||
description: Name of the deployment to be backed up | ||
type: string | ||
no_log: | ||
default: true | ||
description: Configure no_log for no_log tasks | ||
type: boolean | ||
postgres_image: | ||
description: Registry path to the PostgreSQL container to use | ||
type: string | ||
postgres_image_version: | ||
description: PostgreSQL container image version to use | ||
type: string | ||
postgres_label_selector: | ||
description: Label selector used to identify postgres pod for backing up data | ||
type: string | ||
set_self_labels: | ||
default: true | ||
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self) | ||
type: boolean | ||
required: | ||
- deployment_name | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
status: | ||
properties: | ||
backupClaim: | ||
description: Backup persistent volume claim | ||
type: string | ||
backupDirectory: | ||
description: Backup directory name on the specified pvc | ||
type: string | ||
conditions: | ||
description: The resulting conditions when a Service Telemetry is instantiated | ||
items: | ||
properties: | ||
lastTransitionTime: | ||
type: string | ||
reason: | ||
type: string | ||
status: | ||
type: string | ||
type: | ||
type: string | ||
type: object | ||
type: array | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
114 changes: 114 additions & 0 deletions
114
charts/awx-operator/crds/customresourcedefinition-awxrestores.awx.ansible.com.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
labels: | ||
helm.sh/chart: awx-operator-0.26.0-60-gfd44676 | ||
name: awxrestores.awx.ansible.com | ||
spec: | ||
group: awx.ansible.com | ||
names: | ||
kind: AWXRestore | ||
listKind: AWXRestoreList | ||
plural: awxrestores | ||
singular: awxrestore | ||
scope: Namespaced | ||
versions: | ||
- name: v1beta1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Schema validation for the AWXRestore CRD | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
backup_dir: | ||
description: Backup directory name, set as a status found on the awxbackup object (backupDirectory) | ||
type: string | ||
backup_name: | ||
description: AWXBackup object name | ||
type: string | ||
backup_pvc: | ||
description: Name of the PVC to be restored from, set as a status found on the awxbackup object (backupClaim) | ||
type: string | ||
backup_pvc_namespace: | ||
description: (Deprecated) Namespace the PVC is in | ||
type: string | ||
backup_source: | ||
description: Backup source | ||
enum: | ||
- CR | ||
- PVC | ||
type: string | ||
deployment_name: | ||
description: Name of the restored deployment. This should be different from the original deployment name if the original deployment still exists. | ||
type: string | ||
no_log: | ||
default: true | ||
description: Configure no_log for no_log tasks | ||
type: boolean | ||
postgres_image: | ||
description: Registry path to the PostgreSQL container to use | ||
type: string | ||
postgres_image_version: | ||
description: PostgreSQL container image version to use | ||
type: string | ||
postgres_label_selector: | ||
description: Label selector used to identify postgres pod for backing up data | ||
type: string | ||
restore_resource_requirements: | ||
description: Resource requirements for the management pod that restores AWX from a backup | ||
properties: | ||
limits: | ||
properties: | ||
cpu: | ||
type: string | ||
memory: | ||
type: string | ||
type: object | ||
requests: | ||
properties: | ||
cpu: | ||
type: string | ||
memory: | ||
type: string | ||
type: object | ||
type: object | ||
set_self_labels: | ||
default: true | ||
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self) | ||
type: boolean | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
status: | ||
properties: | ||
conditions: | ||
description: The resulting conditions when a Service Telemetry is instantiated | ||
items: | ||
properties: | ||
lastTransitionTime: | ||
type: string | ||
reason: | ||
type: string | ||
status: | ||
type: string | ||
type: | ||
type: string | ||
type: object | ||
type: array | ||
restoreComplete: | ||
description: Restore process complete | ||
type: boolean | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
Oops, something went wrong.