Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm chart container image related parameter (pullsecret, pullpolicy) support added. #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/logan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ Charts for sending Kubernetes platform logs, compute logs, and Kubernetes Object
| fluentd.tailPlugin | object | `{"flushInterval":60,"readFromHead":true}` | Config for Logs Collection using fluentd tail plugin |
| global.namespace | string | `"oci-onm"` | Kubernetes Namespace for creating monitoring resources. Ignored if oci-kubernetes-monitoring-common.createNamespace set to false. |
| global.resourceNamePrefix | string | `"oci-onm"` | Resource names prefix used, where allowed. |
| image.imagePullPolicy | string | `"Always"` | Image pull policy |
| image.imagePullSecrets | string | `nil` | |
| image.imagePullPolicy | string | `"Always"` | Container image pull policy. |
| image.imagePullSecret | string | `nil` | Image pull secret name to use for pulling container image |
| image.url | string | `"container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.0.0"` | Replace this value with actual docker image url |
| kubernetesClusterID | string | `nil` | OKE Cluster OCID e.g. ocid1.cluster.oc1.phx.aaaaaaaahhbadf3rxa62faaeixanvr7vftmkg6hupycbf4qszctf2wbmqqxq |
| kubernetesClusterName | string | `nil` | Kubernetes Cluster name. Need not be the OKE Cluster display name. e.g. production-cluster |
Expand Down
7 changes: 2 additions & 5 deletions charts/logan/templates/fluentd-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

---
{{- $authtype := .Values.authtype | lower }}
{{- $imagePullSecrets := .Values.image.imagePullSecrets }}
{{- $resourceNamePrefix := (include "logan.resourceNamePrefix" .) }}
apiVersion: apps/v1
kind: DaemonSet
Expand Down Expand Up @@ -33,14 +32,12 @@ spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
{{- if $imagePullSecrets }}
imagePullSecrets:
- name: {{ .Values.image.imagePullSecrets }}
{{- end}}
- name: {{ .Values.image.imagePullSecret }}
containers:
- name: {{ $resourceNamePrefix }}-fluentd
image: {{ .Values.image.url }}
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
env:
- name: FLUENTD_CONF
value: {{ .Values.fluentd.path }}/{{ .Values.fluentd.file }}
Expand Down
7 changes: 2 additions & 5 deletions charts/logan/templates/fluentd-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

---
{{- $authtype := .Values.authtype | lower }}
{{- $imagePullSecrets := .Values.image.imagePullSecrets }}
{{- $resourceNamePrefix := (include "logan.resourceNamePrefix" .) }}
apiVersion: apps/v1
kind: Deployment
Expand All @@ -30,14 +29,12 @@ spec:
version: v1
spec:
serviceAccountName: {{ include "logan.serviceAccount" . }}
{{- if $imagePullSecrets }}
imagePullSecrets:
- name: {{ .Values.image.imagePullSecrets }}
{{- end}}
- name: {{ .Values.image.imagePullSecret }}
containers:
- name: {{ $resourceNamePrefix }}-fluentd
image: {{ .Values.image.url }}
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
env:
- name: FLUENTD_CONF
value: {{ .Values.fluentd.path }}/{{ .Values.fluentd.file }}
Expand Down
6 changes: 3 additions & 3 deletions charts/logan/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ resourceNamePrefix: "{{ .Values.global.resourceNamePrefix }}"
# -- Kubernetes ServiceAccount
serviceAccount: "{{ .Values.global.resourceNamePrefix }}"
image:
# Image pull secrets for. Secret must be in the namespace defined by namespace
imagePullSecrets:
# -- Replace this value with actual docker image url
url: container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.0.0
# Image pull secrets for. Secret must be in the namespace defined by namespace
imagePullSecret: ""
# -- Image pull policy
imagePullPolicy: Always
imagePullPolicy: IfNotPresent

# -- Logging Analytics namespace. Can be found in OCI console --> Logging Analytics --> Administration --> Service
ociLANamespace:
Expand Down
5 changes: 3 additions & 2 deletions charts/mgmt-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ A Helm chart for collecting Kubernetes Metrics using OCI Management Agent into O
| kubernetesCluster.compartmentId | string | `nil` | OCI Compartment Id to push Kubernetes Monitoring metrics. If not specified default is same as Agent compartment |
| kubernetesCluster.name | string | `nil` | Kubernetes cluster name |
| kubernetesCluster.namespace | string | `"*"` | Kubernetes cluster namespace(s) to monitor. This can be a comma-separated list of namespaces or '*' to monitor all the namespaces |
| mgmtagent.image.secret | string | `nil` | Image secrets to use for pulling container image (base64 encoded content of ~/.docker/config.json file) |
| mgmtagent.image.url | string | `nil` | Replace this value with actual docker image URL for Management Agent |
| mgmtagent.image.url | string | `"container-registry.oracle.com/oci_observability_management/oci-management-agent:1.0.0"` | Replace this value with actual docker image URL for Management Agent |
| mgmtagent.image.imagePullPolicy | string | `IfNotPresent` | Container image pull policy. |
| mgmtagent.image.imagePullSecret | string | `""` | Image pull secret name to use for pulling container image |
| mgmtagent.installKey | string | `"resources/input.rsp"` | Copy the downloaded Management Agent Install Key file under root helm directory as resources/input.rsp |
| mgmtagent.installKeyFileContent | string | `nil` | Provide the base64 encoded content of the Management Agent Install Key file |
| namespace | string | `"{{ .Values.global.namespace }}"` | Kubernetes namespace to create and install this helm chart in |
Expand Down
14 changes: 0 additions & 14 deletions charts/mgmt-agent/templates/mgmt-agent-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,3 @@ data:
{{ else }}
{{ .Files.Get .Values.mgmtagent.installKey | b64enc }}
{{- end }}

---
{{- if .Values.mgmtagent.image.secret }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "mgmt-agent.resourceNamePrefix" . }}-mgmt-agent-container-registry-key
namespace: {{ include "mgmt-agent.namespace" . }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: |
{{ .Values.mgmtagent.image.secret }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/mgmt-agent/templates/mgmt-agent-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ spec:
fsGroup: {{ default 0 .Values.deployment.security.fsGroup }}
serviceAccountName: {{ include "mgmt-agent.serviceAccount" . }}
imagePullSecrets:
- name: {{ include "mgmt-agent.resourceNamePrefix" . }}-mgmt-agent-container-registry-key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niravg75 , please review the Mgmt Agent changes suggested in this PR.

- name: {{ .Values.mgmtagent.image.imagePullSecret }}
restartPolicy: Always
containers:
- name: {{ include "mgmt-agent.resourceNamePrefix" . }}-mgmt-agent
imagePullPolicy: {{ .Values.mgmtagent.image.imagePullPolicy }}
image: {{ .Values.mgmtagent.image.url }}
resources:
requests:
Expand Down
7 changes: 4 additions & 3 deletions charts/mgmt-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ mgmtagent:
# Follow steps documented at https://github.com/oracle/docker-images/tree/main/OracleManagementAgent to build docker image.
image:
# -- Replace this value with actual docker image URL for Management Agent
url:
url: container-registry.oracle.com/oci_observability_management/oci-management-agent:1.0.0
# -- Image secrets to use for pulling container image (base64 encoded content of ~/.docker/config.json file)
secret:
imagePullSecret: ""
imagePullPolicy: IfNotPresent

# -- Kubernetes namespace to create and install this helm chart in
namespace: "{{ .Values.global.namespace }}"
Expand Down Expand Up @@ -76,6 +77,6 @@ deployment:
cpuCore: 500m
# specify the memory
memory: 1Gi

# Provide the storage class for StatefulSet's PVC. If not provided then the Cluster's default storage class will be used.
storageClass:
2 changes: 1 addition & 1 deletion charts/oci-onm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Helm chart for collecting Kubernetes logs & objects and metrics using Fluentd an
| oci-onm-logan.ociLANamespace | string | `nil` | |
| oci-onm-logan.serviceAccount | string | `"{{ .Values.global.resourceNamePrefix }}"` | |
| oci-onm-mgmt-agent.kubernetesCluster.name | string | `"{{ .Values.global.kubernetesClusterName }}"` | |
| oci-onm-mgmt-agent.mgmtagent.image.secret | string | `nil` | |
| oci-onm-mgmt-agent.mgmtagent.image.imagePullSecret | string | `nil` | |
| oci-onm-mgmt-agent.mgmtagent.image.url | string | `nil` | |
| oci-onm-mgmt-agent.mgmtagent.installKey | string | `"resources/input.rsp"` | |
| oci-onm-mgmt-agent.mgmtagent.installKeyFileContent | string | `nil` | |
Expand Down
5 changes: 4 additions & 1 deletion charts/oci-onm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ oci-onm-logan:
kubernetesClusterName: "{{ .Values.global.kubernetesClusterName }}"
image:
url: container-registry.oracle.com/oci_observability_management/oci-la-fluentd-collector:1.0.0
imagePullSecret:
imagePullPolicy: IfNotPresent
# Go to OCI Logging Analytics Administration, click Service Details, and note the namespace value.
ociLANamespace:
# OCI Logging Analytics Default Log Group OCID
Expand All @@ -52,4 +54,5 @@ oci-onm-mgmt-agent:
# Replace this value with actual docker image URL for Management Agent
url: container-registry.oracle.com/oci_observability_management/oci-management-agent:1.0.0
# Image secrets to use for pulling container image (base64 encoded content of ~/.docker/config.json file)
secret:
imagePullSecret:
imagePullPolicy: IfNotPresent
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
## Uncomment the following section if a secret is associated to pull the image
#imagePullSecrets:
# Replace this value with actual image pull secrets.
# Make sure the secret is in the same namespace as defined above.
#- name: <IMAGE_PULL_SECRET>
imagePullSecrets:
- name: {{ .Values.image.imagePullSecret }}
containers:
- name: oci-la-fluentd-logs
# Replace this value with actual docker image url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ spec:
version: v1
spec:
serviceAccountName: oci-la-fluentd-serviceaccount
## Uncomment the following section if a secret is associated to pull the image
#imagePullSecrets:
# Replace this value with actual image pull secrets.
# Make sure the secret is in the same namespace as defined above.
#- name: <IMAGE_PULL_SECRET>
imagePullSecrets:
- name: {{ .Values.image.imagePullSecret }}
containers:
- name: oci-la-fluentd-objects
# Replace this value with actual docker image url
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/helm/helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ locals {
# oci-onm-logan
"oci-onm-logan.ociLANamespace" = var.oci_la_namespace
"oci-onm-logan.ociLALogGroupID" = var.oci_la_logGroup_id
"oci-onm-logan.image.url" = var.logan_container_image_url
"oci-onm-logan.image.url" = var.logan_container_image_url
"oci-onm-logan.fluentd.baseDir" = var.fluentd_baseDir_path

#oci-onm-mgmt-agent
"oci-onm-mgmt-agent.mgmtagent.installKeyFileContent" = var.mgmt_agent_install_key_content
"oci-onm-mgmt-agent.mgmtagent.image.url" = var.mgmt_agent_container_image_url
"oci-onm-mgmt-agent.mgmtagent.image.url" = var.mgmt_agent_container_image_url
"oci-onm-mgmt-agent.deployMetricServer" = var.opt_deploy_metric_server
}

Expand Down