Skip to content

Commit c41071c

Browse files
authored
Longw/arc openshift (#1511)
* add support for arc openshift
1 parent 1378731 commit c41071c

File tree

4 files changed

+134
-1
lines changed

4 files changed

+134
-1
lines changed

charts/azuremonitor-containers/templates/ama-logs-daemonset.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
{{- end }}
3939
containers:
4040
{{- if and (ne .Values.Azure.Cluster.ResourceId "<your_cluster_id>") (.Values.amalogs.useAADAuth) }}
41+
{{- if not (eq .Values.Azure.Cluster.Distribution "openshift") }}
4142
- name: addon-token-adapter
4243
imagePullPolicy: IfNotPresent
4344
env:
@@ -46,6 +47,58 @@ spec:
4647
- name: TOKEN_NAMESPACE
4748
value: "azure-arc"
4849
{{- .Values.Azure.Identity.MSIAdapterYaml | nindent 7 }}
50+
{{- else }}
51+
- name: msi-adapter
52+
env:
53+
- name: AZMON_COLLECT_ENV
54+
value: "false"
55+
- name: TOKEN_NAMESPACE
56+
value: azure-arc
57+
- name: CLUSTER_IDENTITY
58+
value: "false"
59+
- name: CLUSTER_TYPE
60+
value: {{ (split "/" .Values.Azure.Cluster.ResourceId)._7 }}
61+
- name: EXTENSION_ARMID
62+
value: {{ .Values.Azure.Extension.ResourceId }}
63+
- name: EXTENSION_NAME
64+
value: {{ .Values.Azure.Extension.Name }}
65+
- name: MSI_ADAPTER_LISTENING_PORT
66+
value: "8421"
67+
- name: MANAGED_IDENTITY_AUTH
68+
value: "true"
69+
- name: MSI_ADAPTER_LIVENESS_PORT
70+
value: "9090"
71+
- name: TEST_MODE
72+
value: "false"
73+
- name: TEST_FILE
74+
value: /data/token
75+
image: mcr.microsoft.com/azurearck8s/msi-adapter:1.29.3
76+
securityContext:
77+
privileged: true
78+
capabilities:
79+
add:
80+
- NET_ADMIN
81+
- NET_RAW
82+
livenessProbe:
83+
failureThreshold: 3
84+
httpGet:
85+
path: /healthz
86+
port: 9090
87+
scheme: "HTTP"
88+
initialDelaySeconds: 10
89+
periodSeconds: 15
90+
resources:
91+
limits:
92+
cpu: 50m
93+
memory: 100Mi
94+
requests:
95+
cpu: 20m
96+
memory: 50Mi
97+
lifecycle:
98+
postStart:
99+
exec:
100+
command: ["/data/msi-adapter-ready-watcher"]
101+
{{- end }}
49102
{{- end }}
50103
- name: ama-logs
51104
image: {{ printf "%s:%s" .Values.amalogs.image.repo .Values.amalogs.image.tag }}

charts/azuremonitor-containers/templates/ama-logs-deployment.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
{{- end }}
3535
containers:
3636
{{- if and (ne .Values.Azure.Cluster.ResourceId "<your_cluster_id>") (.Values.amalogs.useAADAuth) }}
37+
{{- if not (eq .Values.Azure.Cluster.Distribution "openshift") }}
3738
- name: addon-token-adapter
3839
imagePullPolicy: IfNotPresent
3940
env:
@@ -42,6 +43,58 @@ spec:
4243
- name: TOKEN_NAMESPACE
4344
value: "azure-arc"
4445
{{- .Values.Azure.Identity.MSIAdapterYaml | nindent 7 }}
46+
{{- else }}
47+
- name: msi-adapter
48+
env:
49+
- name: AZMON_COLLECT_ENV
50+
value: "false"
51+
- name: TOKEN_NAMESPACE
52+
value: azure-arc
53+
- name: CLUSTER_IDENTITY
54+
value: "false"
55+
- name: CLUSTER_TYPE
56+
value: {{ (split "/" .Values.Azure.Cluster.ResourceId)._7 }}
57+
- name: EXTENSION_ARMID
58+
value: {{ .Values.Azure.Extension.ResourceId }}
59+
- name: EXTENSION_NAME
60+
value: {{ .Values.Azure.Extension.Name }}
61+
- name: MSI_ADAPTER_LISTENING_PORT
62+
value: "8421"
63+
- name: MANAGED_IDENTITY_AUTH
64+
value: "true"
65+
- name: MSI_ADAPTER_LIVENESS_PORT
66+
value: "9090"
67+
- name: TEST_MODE
68+
value: "false"
69+
- name: TEST_FILE
70+
value: /data/token
71+
image: mcr.microsoft.com/azurearck8s/msi-adapter:1.29.3
72+
securityContext:
73+
privileged: true
74+
capabilities:
75+
add:
76+
- NET_ADMIN
77+
- NET_RAW
78+
livenessProbe:
79+
failureThreshold: 3
80+
httpGet:
81+
path: /healthz
82+
port: 9090
83+
scheme: "HTTP"
84+
initialDelaySeconds: 10
85+
periodSeconds: 15
86+
resources:
87+
limits:
88+
cpu: 50m
89+
memory: 100Mi
90+
requests:
91+
cpu: 20m
92+
memory: 50Mi
93+
lifecycle:
94+
postStart:
95+
exec:
96+
command: ["/data/msi-adapter-ready-watcher"]
97+
{{- end }}
4598
{{- end }}
4699
- name: ama-logs
47100
image: {{ printf "%s:%s" .Values.amalogs.image.repo .Values.amalogs.image.tag }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- if eq .Values.Azure.Cluster.Distribution "openshift" }}
2+
apiVersion: security.openshift.io/v1
3+
kind: SecurityContextConstraints
4+
metadata:
5+
name: ama-logs-scc
6+
allowPrivilegedContainer: true
7+
allowPrivilegeEscalation: true
8+
allowHostDirVolumePlugin: true
9+
allowedCapabilities:
10+
- NET_ADMIN
11+
- NET_RAW
12+
readOnlyRootFilesystem: false
13+
runAsUser:
14+
type: RunAsAny
15+
seLinuxContext:
16+
type: RunAsAny
17+
fsGroup:
18+
type: RunAsAny
19+
supplementalGroups:
20+
type: RunAsAny
21+
volumes:
22+
- hostPath
23+
- configMap
24+
- secret
25+
users:
26+
- system:serviceaccount:kube-system:ama-logs
27+
{{- end }}

deployment/arc-k8s-extension-release-v2/ServiceGroupRoot/Scripts/arcExtensionRelease.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ REGISTER_REGIONS_BATCH='"'$(echo "$REGISTER_REGIONS_BATCH" | sed 's/,/","/g')'"'
99
IS_CUSTOMER_HIDDEN=$IS_CUSTOMER_HIDDEN
1010
CHART_VERSION=${CHART_VERSION}
1111

12-
PACKAGE_CONFIG_NAME="${PACKAGE_CONFIG_NAME:-microsoft.azuremonitor.containers-pkg022022}"
12+
PACKAGE_CONFIG_NAME="${PACKAGE_CONFIG_NAME:-microsoft.azuremonitor.containers-pkg092025}"
1313
API_VERSION="${API_VERSION:-2021-05-01}"
1414
METHOD="${METHOD:-put}"
1515
REGISTRY_PATH_CANARY_STABLE="https://mcr.microsoft.com/azuremonitor/containerinsights/canary/stable/azuremonitor-containers"

0 commit comments

Comments
 (0)