diff --git a/Chart.yaml b/Chart.yaml deleted file mode 100644 index 8ee298a..0000000 --- a/Chart.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: agent -apiVersion: v2 -appVersion: 2.7.0 -version: 0.1.0 -description: Optimizely Agent - use Optimizely Full Stack and Rollouts with a microservice -type: application -keywords: - - Optimizely - - Optimizely Agent - - Full Stack - - Rollouts - - Feature Flags -home: https://docs.developers.optimizely.com/full-stack/docs/optimizely-agent -sources: - - https://github.com/optimizely/agent -maintainers: - - name: Optimizely Dev X Team - email: devx@optimizely.com diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 42b43d8..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2022 Optimizely - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md index 80d7f62..f30002c 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,91 @@ # Optimizely Agent Helm Chart -The Optimizely Agent allows you to run a proxy to Optimizely in your own infrastructure, to help prevent adblockers from interfering with A/B tests. This repository contains a Helm chart to make it easy to host the Optimizely Agent in your own Kubernetes infrastructure. +This repository contains a Helm chart to make it easy to host Optimizely Agent in your own Kubernetes infrastructure. The Optimizely Agent allows you to run a proxy to Optimizely in your own infrastructure, to help prevent adblockers from interfering with A/B tests. + +## Installation + +To install the chart with the release name `my-agent`: + +```shell +helm repo add optimizely-agent https://optimizely.github.io/optimizely-agent-helm +helm install my-agent optimizely-agent/agent +``` + +## Modifying values + +- To override values in a chart: + - use the `--values` flag and pass in a file. + - use the `--set` flag and pass configuration from the command line. +- Use the `--set-file` flag to set individual values from a file when the value itself is too long for the command line or is dynamically generated. +- To force a string value use `--set-string`. + +For example: + +```shell +helm install --values myvalues.yaml my-agent optimizely-agent/agent --version [CURRENT_VERSION] +``` + +or + +```shell +helm install --set nameOverride=abc123 my-agent optimizely-agent/agent --version [CURRENT_VERSION] +``` + +For more information, view the [Helm install documentation](https://helm.sh/docs/helm/helm_install/) or install through [Artifact Hub](https://artifacthub.io/packages/helm/optimizely-agent/agent). + + +## Uninstalling the Chart + +To uninstall/delete the `my-agent` deployment: + +```console +helm delete my-agent +``` # Configurations +To see all configurable options with detailed comments, visit the [values.yaml](https://github.com/optimizely/optimizely-agent-helm/blob/main/values.yaml) file or run: + +```shell +helm show values optimizely-agent/agent +``` -| Property | Description | -|--- |--- | -|replicaCount| Number of deployment replicas | -|image |Docker image to be used | -| autoscaling | To allow and configure autoscaling | -| nameOverride | Replaces the name of the chart in the Chart.yaml file | -|fullnameOverride | Completely replaces the generated name | -| serviceAccount | Specifies whether a service account should be created | -| podAnnotations | A map with Kubernetes annotations | -| podSecurityContext | The security settings that you specify for a Pod apply to all Containers in the Pod | -| securityContext | The security settings that you specify for agent container | -| env | Environment variables and secrets | -| service | The type of network service to use and mapping of incoming ports to targetPorts | -| ingress | Exposes HTTP and HTTPS routes from outside the cluster to services within the cluster | -| nodeSelector | To constrain Pods to nodes with specific labels | -| tolerations | Tolerations to apply to Pods | -| affinity | Sets the affinity Kubernetes attribute for Pods | -| config | Optimizely client instance configuration properties | +| Property | Description | Defalut value | +| --- |--- | --- | +| nameOverride | Replaces the name of the chart in the Chart.yaml file | "" | +| fullnameOverride | Completely replaces the generated name | "" | +| image.repository | Docker image to be used | optimizely/agent | +| image.tag | Docker image tag | "" | +| image.pullPolicy | Sets the policy for a container and tag when pulling the image | IfNotPresent | +| imagePullSecrets | If you are using a private registry | [] | +| serviceAccount.create | Specifies whether a service account should be created | true | +| serviceAccount.name| Optional - the name of the service account to use | "" | +| serviceAccount.annotations | Optional - annotations to add to the service account | {} | +| replicaCount | Number of deployment replicas | 1 | +| autoscaling.enabled | To allow and configure autoscaling | false | +| autoscaling.minReplicas | Minimum number of replicas | 1 | +| autoscaling.maxReplicas | Maximum number of replicas | 100 | +| autoscaling.targetCPUUtilizationPercentage | Set target percent of CPU utilization | 80 | +| autoscaling.targetMemoryUtilizationPercentage | Set target percent of memory utilization | 80 | +| nodeSelector | To constrain Pods to nodes with specific labels | {} | +| affinity | Sets the affinity Kubernetes attribute for Pods | {} | +| tolerations | Tolerations to apply to Pods | [] | +| podAnnotations | A map with Kubernetes annotations | {} | +| podSecurityContext | The security settings that you specify for a Pod apply to all Containers in the Pod | {} | +| securityContext | The security settings that you specify for agent container | {} | +| service.type | The type of network service to use and mapping of incoming ports to targetPorts | ClusterIP | +| service.ports | Ports exposed for Optimizely's Agent functionality | port: 8080, port: 8085, port: 8088 | +| ingress.enabled | Exposes HTTP and HTTPS routes from outside the cluster to services within the cluster | false | +| resources | Set a custom container | {} | +| logs.level | Configure logging level for Optimizely specific logs | debug | +| logs.pretty | Enable pretty print for Optimizely specific logs | true | +| log.includeSdkKey | Enable SDK key in logs for Optimizely specific logs | true | +| env.variables | Environment values for variables | {} | +| env.secrets | Environment values for secrets | {} | +| config | Optimizely client instance configuration properties | See [values.yaml](https://github.com/optimizely/optimizely-agent-helm/blob/main/values.yaml) for defaults | ## Links * -* -* -* [Config file reference](https://github.com/optimizely/agent/blob/master/config.yaml) +* +* [Optimizely Agent Helm Chart](https://artifacthub.io/packages/helm/optimizely-agent/agent) +* [Configuration file reference](https://github.com/optimizely/agent/blob/master/config.yaml) diff --git a/artifacthub-repo.yml b/artifacthub-repo.yml new file mode 100644 index 0000000..3856adc --- /dev/null +++ b/artifacthub-repo.yml @@ -0,0 +1,5 @@ + +repositoryID: c15985c6-2b20-4185-88f9-1a75db71e78a +owners: # (optional, used to claim repository ownership) + - name: optimizely-fullstack + email: optimizely-fullstack@optimizely.com diff --git a/index.yaml b/index.yaml new file mode 100644 index 0000000..3e62a40 --- /dev/null +++ b/index.yaml @@ -0,0 +1,163 @@ +apiVersion: v1 +entries: + agent: + - apiVersion: v2 + appVersion: 4.0.0 + created: "2024-01-23T16:46:43.765385+06:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: 71dd92cbc25ac19c7162633eb3d0f6a3f19d7faac165ff838be2db056c1e4705 + home: https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-agent + icon: https://raw.githubusercontent.com/optimizely/optimizely-agent-helm/main/Optimizely-icon.png + keywords: + - Optimizely + - Optimizely Agent + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.4.0.tgz + version: 1.4.0 + - apiVersion: v2 + appVersion: 3.2.0 + created: "2023-12-19T19:15:40.686472+06:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: 964d48b55bf52809b78bce5a81cee28fd57b432f39880c3ef31cb1f67aa1c847 + home: https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-agent + icon: https://raw.githubusercontent.com/optimizely/optimizely-agent-helm/main/Optimizely-icon.png + keywords: + - Optimizely + - Optimizely Agent + - Feature Experimentation + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.3.0.tgz + version: 1.3.0 + - apiVersion: v2 + appVersion: 3.1.0 + created: "2023-11-14T20:28:59.863924964+06:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: 8c95f9dad10753db0d94d56fa25d65c6514e2c07f4df133638f8c799c5260d6f + home: https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + icon: https://raw.githubusercontent.com/optimizely/optimizely-agent-helm/main/Optimizely-icon.png + keywords: + - Optimizely + - Optimizely Agent + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.2.0.tgz + version: 1.2.0 + - apiVersion: v2 + appVersion: 3.0.0 + created: "2023-02-28T13:37:17.473913-05:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: a02900ec2d446c4959d57ea598131c8d677ffc0941cca0a9f55496f92a11663e + home: https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + icon: https://raw.githubusercontent.com/optimizely/optimizely-agent-helm/main/Optimizely-icon.png + keywords: + - Optimizely + - Optimizely Agent + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.1.0.tgz + version: 1.1.0 + - apiVersion: v2 + appVersion: 2.7.0 + created: "2022-07-07T13:16:27.768733+05:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: ce611535aca5e0673b282f83a4fc38bfb43ca1f9df3d6f685793c975cd9d9ce6 + home: https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + keywords: + - Optimizely + - Optimizely Agent + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.0.0.tgz + version: 1.0.0 + - apiVersion: v2 + appVersion: 2.7.0 + created: "2022-07-07T13:16:27.781552+05:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: 623473e69f9d01a6fbadeceb37571a16ada0be57ccf8cd4890cf74125cef30b0 + home: https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + keywords: + - Optimizely + - Optimizely Agent + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.0.3-alpha.tgz + version: 1.0.3-alpha + - apiVersion: v2 + appVersion: 2.7.0 + created: "2022-06-02T13:10:35.664275+05:00" + description: Helm chart for the Optimizely Agent https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + digest: 7f15857bd02c2496cc22a2eed95e2027bb31b70224334ba083d6f7adf0286fd3 + home: https://docs.developers.optimizely.com/full-stack-experimentation/docs/optimizely-agent + keywords: + - Optimizely + - Optimizely Agent + - Full Stack + - Rollouts + - Feature Flags + maintainers: + - email: devx@optimizely.com + name: Optimizely Dev X Team + name: agent + sources: + - https://github.com/optimizely/agent + type: application + urls: + - https://optimizely.github.io/optimizely-agent-helm/packages/agent-1.0.2-alpha.tgz + version: 1.0.2-alpha +generated: "2024-01-23T16:46:43.750126+06:00" diff --git a/packages/agent-1.0.0.tgz b/packages/agent-1.0.0.tgz new file mode 100644 index 0000000..bf0d14e Binary files /dev/null and b/packages/agent-1.0.0.tgz differ diff --git a/packages/agent-1.0.2-alpha.tgz b/packages/agent-1.0.2-alpha.tgz new file mode 100644 index 0000000..a00c7b7 Binary files /dev/null and b/packages/agent-1.0.2-alpha.tgz differ diff --git a/packages/agent-1.0.3-alpha.tgz b/packages/agent-1.0.3-alpha.tgz new file mode 100644 index 0000000..fbb8982 Binary files /dev/null and b/packages/agent-1.0.3-alpha.tgz differ diff --git a/packages/agent-1.1.0.tgz b/packages/agent-1.1.0.tgz new file mode 100644 index 0000000..0108aa8 Binary files /dev/null and b/packages/agent-1.1.0.tgz differ diff --git a/packages/agent-1.2.0.tgz b/packages/agent-1.2.0.tgz new file mode 100644 index 0000000..c8d2553 Binary files /dev/null and b/packages/agent-1.2.0.tgz differ diff --git a/packages/agent-1.3.0.tgz b/packages/agent-1.3.0.tgz new file mode 100644 index 0000000..6883e9b Binary files /dev/null and b/packages/agent-1.3.0.tgz differ diff --git a/packages/agent-1.4.0.tgz b/packages/agent-1.4.0.tgz new file mode 100644 index 0000000..8f8a35f Binary files /dev/null and b/packages/agent-1.4.0.tgz differ diff --git a/templates/NOTES.txt b/templates/NOTES.txt deleted file mode 100644 index afd7288..0000000 --- a/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "optimizely-agent.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "optimizely-agent.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "optimizely-agent.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "optimizely-agent.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl deleted file mode 100644 index 0035058..0000000 --- a/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "optimizely-agent.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "optimizely-agent.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "optimizely-agent.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "optimizely-agent.labels" -}} -helm.sh/chart: {{ include "optimizely-agent.chart" . }} -{{ include "optimizely-agent.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "optimizely-agent.selectorLabels" -}} -app.kubernetes.io/name: {{ include "optimizely-agent.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "optimizely-agent.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "optimizely-agent.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/templates/config.yaml b/templates/config.yaml deleted file mode 100644 index 87e26a9..0000000 --- a/templates/config.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: "{{ include "optimizely-agent.name" . }}-config" - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} -data: - {{- range $k, $v := .Values.env.variables }} - {{ $k }}: {{ $v | quote }} - {{- end }} - config.yaml: | - {{- tpl .Values.config . | nindent 4 }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml deleted file mode 100644 index b1d4458..0000000 --- a/templates/deployment.yaml +++ /dev/null @@ -1,79 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "optimizely-agent.fullname" . }} - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} -spec: -{{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} -{{- end }} - selector: - matchLabels: - {{- include "optimizely-agent.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "optimizely-agent.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: {{ include "optimizely-agent.name" . }}-config - configMap: - name: {{ include "optimizely-agent.name" . }}-config - serviceAccountName: {{ include "optimizely-agent.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - env: - - name: OPTIMIZELY_CONFIG_FILENAME - value: /etc/optimizely/config.yaml - envFrom: - - configMapRef: - name: {{ include "optimizely-agent.name" . }}-config - - secretRef: - name: {{ include "optimizely-agent.name" . }}-secrets - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - {{- range .Values.service.ports }} - - containerPort: {{ .targetPort }} - protocol: {{ .protocol }} - name: {{ .name }} - {{- end }} - livenessProbe: - httpGet: - path: /health - port: api - readinessProbe: - httpGet: - path: /health - port: api - volumeMounts: - - name: "{{ include "optimizely-agent.name" . }}-config" - mountPath: /etc/optimizely/config.yaml - subPath: config.yaml - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/templates/hpa.yaml b/templates/hpa.yaml deleted file mode 100644 index c148769..0000000 --- a/templates/hpa.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "optimizely-agent.fullname" . }} - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "optimizely-agent.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/templates/ingress.yaml b/templates/ingress.yaml deleted file mode 100644 index 582bb7b..0000000 --- a/templates/ingress.yaml +++ /dev/null @@ -1,57 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "optimizely-agent.fullname" . -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path | quote }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ .port }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ .port }} - {{- end }} - {{- end }} - {{- end }} - {{- end }} diff --git a/templates/secrets.yaml b/templates/secrets.yaml deleted file mode 100644 index 46ae0f5..0000000 --- a/templates/secrets.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: "{{ include "optimizely-agent.name" . }}-secrets" -type: Opaque -data: - {{- range $k, $v := .Values.env.secrets }} - {{ $k }}: {{ $v | b64enc }} - {{- end }} diff --git a/templates/service.yaml b/templates/service.yaml deleted file mode 100644 index 5242ac8..0000000 --- a/templates/service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "optimizely-agent.fullname" . }} - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - {{- range .Values.service.ports }} - - port: {{ .port }} - protocol: {{ .protocol }} - name: {{ .name }} - targetPort: {{ .targetPort }} - {{- end }} - selector: - {{- include "optimizely-agent.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml deleted file mode 100644 index 796bd2f..0000000 --- a/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "optimizely-agent.serviceAccountName" . }} - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml deleted file mode 100644 index 2318170..0000000 --- a/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "optimizely-agent.fullname" . }}-test-connection" - labels: - {{- include "optimizely-agent.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "optimizely-agent.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/values.yaml b/values.yaml deleted file mode 100644 index 81089fc..0000000 --- a/values.yaml +++ /dev/null @@ -1,290 +0,0 @@ -# Default values for optimizely-agent. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 2 - -image: - repository: optimizely/agent - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -env: - variables: {} - # OPTIMIZELY_SDKKEYS: sdk_keys - # OPTIMIZELY_CLIENT_FLUSHINTERVAL: flush_interval - secrets: {} - # OPTIMIZELY_ADMIN_AUTH_HMACSECRETS: hmac_secrets - # OPTIMIZELY_API_AUTH_HMACSECRETS: hmac_secrets - -service: - type: NodePort - ports: - - port: 8080 - protocol: TCP - name: api - targetPort: 8080 - - port: 8085 - protocol: TCP - name: webhook - targetPort: 8085 - - port: 8088 - protocol: TCP - name: admin - targetPort: 8088 - -ingress: - enabled: false - # annotations: {} - # hosts: - # - host: optimizely-agent.local - # paths: - # - port: 8080 - # path: /api - # pathType: Prefix - # - port: 8085 - # path: /webhook - # pathType: Prefix - # - port: 8088 - # path: /admin - # pathType: Prefix - # tls: [] - -resources: {} # set your own resources - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - # - key: "key1" - # operator: "Equal" - # value: "value1" - # effect: "NoSchedule" - - -affinity: {} - -logs: - level: debug - pretty: true - includeSdkKey: true - -# -- Config file contents -# @default -- See https://github.com/optimizely/agent/blob/master/config.yaml -config: | - ## config.yaml provides a default set of configuration options - - ## service author included in the /info response - author: "Optimizely Inc." - ## name of the running application included in the /info response - name: "{{ include "optimizely-agent.fullname" . }}" - ## version of the application included in the /info response and startup logs - version: {{ .Chart.AppVersion }} - - ## list of SDK keys to be pre-fetched during startup (recommended for production) - #sdkkeys: - # - - # - - - ## - ## log: logger configuration - ## - log: - ## log level used to filter logs of lesser severity (from highest to lowest): - ## panic, fatal, error, warn, info, debug - level: {{ .Values.logs.level }} - ## enable pretty colorized console logging. setting to false will output - ## structured JSON logs. Recommended false in production. - pretty: {{ .Values.logs.pretty }} - ## to set whether or not the SDK key is included in the logging output. - includeSdkKey: {{ .Values.logs.includeSdkKey }} - - ## - ## http server configuration - ## - server: - ## List of allowed request host values. - ## Requests whose host value does not match either the configured server.host, or one of these, will be rejected - ## with a 404 response. - ## To match all subdomains, you can use a leading dot (for example .example.com matches my.example.com, hello.world.example.com, etc.). - ## You can use the value "." to disable allowed host checking, allowing requests with any host. - ## Request host is determined in the following priority order: - ## 1. X-Forwarded-Host header value - ## 2. Forwarded header host= directive value - ## 3. Host property of request (see Host under https://golang.org/pkg/net/http/#Request) - ## Note: don't include port in these hosts values - port is stripped from the request host before comparing against these. - allowedHosts: - - "." - ## the maximum duration for reading the entire request, including the body. - ## Value can be set in seconds (e.g. "5s") or milliseconds (e.g. "5000ms") - readTimeout: 5s - ## the maximum duration before timing out writes of the response. - ## Value can be set in seconds (e.g. "5s") or milliseconds (e.g. "5000ms") - writeTimeout: 10s - ## path for the health status api - healthCheckPath: "/health" - ## the location of the TLS key file - # keyFile: - ## the location of the TLS certificate file - # certFile: - ## IP of the host - host: "127.0.0.1" - ## configure optional Agent interceptors - # interceptors: - # httplog: {} - - ## - ## api service configuration - ## - api: - ## the maximum number of concurrent requests handled by the api listener - # maxConns: 10000 - ## http listener port - {{ with index .Values.service.ports 0 }} - port: {{ .targetPort | quote }} - {{ end }} - ## set to true to enable subscribing to notifications via an SSE event-stream - enableNotifications: false - ## set to true to be able to override experiment bucketing. (recommended false in production) - enableOverrides: true - ## CORS support is provided via chi middleware - ## https://github.com/go-chi/cors - # cors: - # ## If allowedOrigins is nil or empty, value is set to ["*"]. - # allowedOrigins: ["*"] - # ## If allowedMethods is nil or empty, value is set to (HEAD, GET and POST). - # allowedMethods: - # - "HEAD" - # - "GET" - # - "POST" - # - "OPTIONS" - # ## Default value is [] but "Origin" is always appended to the list. - # allowedHeaders: ["*"] - # exposedHeaders: [] - # allowedCredentials: false - # maxAge: 300 - - ## - ## admin service configuration - ## - admin: - ## http listener port - {{ with index .Values.service.ports 2 }} - port: {{ .targetPort | quote }} - {{ end }} - ## - ## webhook service receives update notifications to your Optimizely project. Receipt of the webhook will - ## trigger an immediate download of the datafile from the CDN - ## - webhook: - ## http listener port - {{ with index .Values.service.ports 1 }} - port: {{ .targetPort | quote }} - {{ end }} - # ## a map of Optimizely Projects to one or more SDK keys - # projects: - # ## : Optimizely project id as an integer - # : - # ## sdkKeys: a list of SDKs linked to this project - # sdkKeys: - # - - # - - # ## secret: webhook secret used the validate the notification - # secret: - # ## skipSignatureCheck: override the signature check (not recommended for production) - # skipSignatureCheck: true - - ## - ## optimizely client configurations (options passed to the underlying go-sdk) - ## - client: - ## the time between successive polls for updated project configuration - pollingInterval: 1m - ## the number of events in a batch - batchSize: 10 - ## the max number of events pending dispatch, setting this too low may result in events being dropped - queueSize: 1000 - ## the maximum time between events being dispatched - flushInterval: 30s - ## Template URL for SDK datafile location. The template should specify a "%s" token for SDK key substitution. - datafileURLTemplate: "https://cdn.optimizely.com/datafiles/%s.json" - ## URL for dispatching events. - eventURL: "https://logx.optimizely.com/v1/events" - ## Validation Regex on the request SDK Key - ## By default Agent assumes only alphanumeric characters as part of the SDK Key string. - ## https://github.com/google/re2/wiki/Syntax - sdkKeyRegex: "^\\w+(:\\w+)?$" - ## configure optional User profile service - userProfileService: - default: "" - services: - # in-memory: - # capacity: 0 - # storageStrategy: "fifo" - # redis: - # host: "localhost:6379" - # password: "" - # database: 0 - # rest: - # host: "http://localhost" - # lookupPath: "/ups/lookup" - # lookupMethod: "POST" - # savePath: "/ups/save" - # saveMethod: "POST" - # userIDKey: "user_id" - # headers: - # Content-Type: "application/json" - # Auth-Token: "12345" - - ## - ## optimizely runtime configuration can be used for debugging and profiling the go runtime. - ## These should only be configured when debugging in a non-production environment. - ## - runtime: - ## SetBlockProfileRate controls the fraction of goroutine blocking events - ## that are reported in the blocking profile. The profiler aims to sample - ## an average of one blocking event per rate nanoseconds spent blocked. - ## - ## To include every blocking event in the profile, pass rate = 1. - ## To turn off profiling entirely, pass rate <= 0. - blockProfileRate: 0 - - ## mutexProfileFraction controls the fraction of mutex contention events - ## that are reported in the mutex profile. On average 1/rate events are - ## reported. The previous rate is returned. - ## - ## To turn off profiling entirely, pass rate 0. - ## To just read the current rate, pass rate < 0. - ## (For n>1 the details of sampling may change.) - mutexProfileFraction: 0