Add VictoriaMetrics observability stack + sync catalog for monitoring test

- VM stack 10 charts: victoria-metrics-cluster/auth, victoria-logs-cluster,
  victoria-metrics-agent/alert, opentelemetry-collector, kube-state-metrics,
  prometheus-node-exporter, alertmanager, perses (JWT/OIDC, Infisical-ready)
- ArgoCD ApplicationSet (syncWave) + per-chart dip-values overlays
- doc/victoria-metrics-architecture.md, define-chart-resources updates
- includes pending working-tree changes (mlflow, kubeflow, apisix, CLAUDE.md)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
wbsong111
2026-06-25 11:10:51 +09:00
parent a55427730e
commit 6290322f1b
514 changed files with 68103 additions and 40 deletions
@@ -0,0 +1,89 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
{{/*
Expand the name of the chart.
*/}}
{{- define "apisix-ingress-controller-manager.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 "apisix-ingress-controller-manager.name.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 "apisix-ingress-controller-manager.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "apisix-ingress-controller-manager.labels" -}}
helm.sh/chart: {{ include "apisix-ingress-controller-manager.chart" . }}
{{ include "apisix-ingress-controller-manager.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "apisix-ingress-controller-manager.selectorLabels" -}}
{{- if .Values.labelsOverride }}
{{- tpl (.Values.labelsOverride | toYaml) . }}
{{- else }}
app.kubernetes.io/name: {{ include "apisix-ingress-controller-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- end }}
{{/*
Webhook service name - ensure it stays within 63 character limit
*/}}
{{- define "apisix-ingress-controller-manager.webhook.serviceName" -}}
{{- $suffix := "-webhook-svc" -}}
{{- $maxLen := sub 63 (len $suffix) | int -}}
{{- $baseName := include "apisix-ingress-controller-manager.name.fullname" . | trunc $maxLen | trimSuffix "-" -}}
{{- printf "%s%s" $baseName $suffix -}}
{{- end }}
{{/*
Webhook secret name - ensure it stays within 63 character limit
*/}}
{{- define "apisix-ingress-controller-manager.webhook.secretName" -}}
{{- $suffix := "-webhook-cert" -}}
{{- $maxLen := sub 63 (len $suffix) | int -}}
{{- $baseName := include "apisix-ingress-controller-manager.name.fullname" . | trunc $maxLen | trimSuffix "-" -}}
{{- printf "%s%s" $baseName $suffix -}}
{{- end }}
@@ -0,0 +1,182 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-apisix-ingress-manager-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- namespaces
- pods
- secrets
- services
verbs:
- get
- list
- watch
- apiGroups:
- apisix.apache.org
resources:
- apisixconsumers
- apisixglobalrules
- apisixpluginconfigs
- apisixroutes
- apisixtlses
- apisixupstreams
- backendtrafficpolicies
- consumers
- gatewayproxies
- httproutepolicies
- pluginconfigs
verbs:
- get
- list
- watch
- apiGroups:
- apisix.apache.org
resources:
- apisixconsumers/status
- apisixglobalrules/status
- apisixpluginconfigs/status
- apisixroutes/status
- apisixtlses/status
- apisixupstreams/status
- backendtrafficpolicies/status
- consumers/status
- httproutepolicies/status
verbs:
- get
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- gatewayclasses
verbs:
- get
- list
- update
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- gatewayclasses/status
- gateways/status
- grpcroutes/status
- httproutes/status
- tcproutes/status
- udproutes/status
- tlsroutes/status
- referencegrants/status
verbs:
- get
- update
- apiGroups:
- gateway.networking.k8s.io
resources:
- gateways
- grpcroutes
- httproutes
- tcproutes
- udproutes
- tlsroutes
- referencegrants
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingressclasses
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses/status
verbs:
- get
- update
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-apisix-ingress-metrics-auth-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-apisix-ingress-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
@@ -0,0 +1,43 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
name: {{ .Release.Name }}-apisix-ingress-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Release.Name }}-apisix-ingress-manager-role
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-apisix-ingress-metrics-auth-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Release.Name }}-apisix-ingress-metrics-auth-role
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
@@ -0,0 +1,49 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-ingress-config
namespace: {{ .Release.Namespace }}
data:
config.yaml: |
log_level: {{ .Values.config.logLevel | default "info" }}
controller_name: {{ .Values.config.controllerName | default "apisix.apache.org/apisix-ingress-controller" }}
leader_election_id: {{ .Values.config.leaderElection.id | default "apisix-ingress-controller-leader" }}
leader_election:
leaseDuration: {{ .Values.config.leaderElection.leaseDuration | default "15s" }}
renewDeadline: {{ .Values.config.leaderElection.renewDeadline | default "10s" }}
retryPeriod: {{ .Values.config.leaderElection.retryPeriod | default "2s" }}
disable: {{ .Values.config.leaderElection.disable | default false }}
metrics_addr: {{ .Values.config.metricsAddr | default ":8080" }}
enable_http2: {{ .Values.config.enableHTTP2 | default false }}
probe_addr: {{ .Values.config.probeAddr | default ":8081" }}
secure_metrics: {{ .Values.config.secureMetrics | default false }}
exec_adc_timeout: {{ .Values.config.execADCTimeout | default "15s" }}
disable_gateway_api: {{ .Values.config.disableGatewayAPI | default false }}
provider:
type: {{ .Values.config.provider.type | default "apisix" }}
sync_period: {{ .Values.config.provider.syncPeriod | default "1s" }}
init_sync_delay: {{ .Values.config.provider.initSyncDelay | default "20m" }}
{{- if .Values.webhook.enabled }}
webhook:
enable: true
port: {{ .Values.webhook.port }}
tls_cert_file: "tls.crt"
tls_key_file: "tls.key"
tls_cert_dir: "/certs"
{{- end }}
@@ -0,0 +1,166 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}
namespace: {{ .Release.Namespace }}
annotations:
{{- range $key, $value := .Values.deployment.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
matchLabels:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.deployment.podAnnotations }}
{{- range $key, $value := $.Values.deployment.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 8 }}
spec:
containers:
- env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ADC_SERVER_URL
value: "unix:/sockets/adc.sock"
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}"
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
ports:
- containerPort: {{ splitList ":" .Values.config.metricsAddr | last | int }}
name: metrics
protocol: TCP
{{- if .Values.webhook.enabled }}
- containerPort: {{ .Values.webhook.port }}
name: webhook
protocol: TCP
{{- end }}
volumeMounts:
- name: {{ .Release.Name }}-ingress-config
mountPath: /app/conf/config.yaml
subPath: config.yaml
- name: socket-volume
mountPath: /sockets
{{- if .Values.webhook.enabled }}
- name: webhook-certs
mountPath: /certs
readOnly: true
{{- end }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.deployment.resources | nindent 10 }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 10 }}
- name: adc-server
image: "{{ .Values.deployment.adcContainer.image.repository }}:{{ .Values.deployment.adcContainer.image.tag }}"
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }}
args:
- "server"
- "--listen"
- "unix:/sockets/adc.sock"
- "--listen-status"
- "3001"
env:
- name: ADC_RUNNING_MODE
value: "ingress"
- name: ADC_EXPERIMENTAL_FEATURE_FLAGS
value: "remote-state-file,parallel-backend-request"
- name: ADC_INGRESS_LOG_LEVEL
value: "{{ .Values.deployment.adcContainer.config.logLevel }}"
ports:
- name: http-status
containerPort: 3001
protocol: TCP
livenessProbe:
httpGet:
path: /healthz/ready
port: 3001
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /healthz/ready
port: 3001
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts:
- name: socket-volume
mountPath: /sockets
resources:
{{- toYaml .Values.deployment.resources | nindent 10 }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 10 }}
{{- with .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl (. | toYaml) $ | nindent 8 }}
{{- end }}
volumes:
- name: {{ .Release.Name }}-ingress-config
configMap:
name: {{ .Release.Name }}-ingress-config
- name: socket-volume
emptyDir: {}
{{- if .Values.webhook.enabled }}
- name: webhook-certs
secret:
secretName: {{ include "apisix-ingress-controller-manager.webhook.secretName" . }}
{{- end }}
securityContext:
{{- toYaml .Values.deployment.podSecurityContext | nindent 8 }}
serviceAccountName: {{ .Release.Name }}
terminationGracePeriodSeconds: 10
@@ -0,0 +1,76 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
{{- if .Values.gatewayProxy.createDefault }}
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-config
spec:
provider:
type: {{ .Values.gatewayProxy.provider.type }}
controlPlane:
{{- if .Values.gatewayProxy.provider.controlPlane.endpoints }}
endpoints:
{{- toYaml .Values.gatewayProxy.provider.controlPlane.endpoints | nindent 8 }}
{{- else if .Values.gatewayProxy.provider.controlPlane.service.name }}
service:
name: {{ .Values.gatewayProxy.provider.controlPlane.service.name }}
port: {{ .Values.gatewayProxy.provider.controlPlane.service.port }}
{{- else }}
service:
name: {{ .Values.apisix.adminService.name }}
port: {{ .Values.apisix.adminService.port }}
{{- end }}
{{- with .Values.gatewayProxy.provider.controlPlane.tlsVerify }}
tlsVerify: {{ . }}
{{- end }}
{{- with .Values.gatewayProxy.provider.controlPlane.auth }}
auth:
type: {{ .type }}
{{- with .adminKey }}
adminKey:
{{- if .valueFrom }}
valueFrom:
{{- toYaml .valueFrom | nindent 12 }}
{{- else if .value }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.gatewayProxy.publishService }}
publishService: {{ . | quote }}
{{- end }}
{{- with .Values.gatewayProxy.statusAddress }}
statusAddress:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gatewayProxy.plugins }}
plugins:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gatewayProxy.pluginMetadata }}
pluginMetadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,34 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: {{ .Values.config.kubernetes.ingressClass }}
{{- if .Values.config.kubernetes.defaultIngressClass }}
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
{{- end }}
spec:
controller: {{ .Values.config.controllerName | default "apisix.apache.org/apisix-ingress-controller" }}
{{- if .Values.gatewayProxy.createDefault }}
parameters:
apiGroup: apisix.apache.org
kind: GatewayProxy
name: {{ .Release.Name }}-config
namespace: {{ .Release.Namespace }}
scope: Namespace
{{- end}}
@@ -0,0 +1,38 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
{{- if and .Values.podDisruptionBudget.enabled (or (and .Values.autoscaling.enabled (gt (.Values.autoscaling.minReplicas | int) 1)) (and (not .Values.autoscaling.enabled) (gt (.Values.deployment.replicas | int) 1))) }}
{{ if semverCompare "<1.21-0" .Capabilities.KubeVersion.Version -}}
apiVersion: policy/v1beta1
{{- else -}}
apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ include "apisix-ingress-controller.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "apisix-ingress-controller.labels" . | nindent 4 }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- else }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "apisix-ingress-controller.selectorLabels" . | nindent 6 }}
{{- end }}
@@ -0,0 +1,55 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
name: {{ .Release.Name }}-apisix-ingress-leader-election-role
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
@@ -0,0 +1,31 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
name: {{ .Release.Name }}-apisix-ingress-leader-election-rolebinding
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Release.Name }}-apisix-ingress-leader-election-role
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
@@ -0,0 +1,23 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
@@ -0,0 +1,31 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
apiVersion: v1
kind: Service
metadata:
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
selector:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 4 }}
@@ -0,0 +1,48 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
{{- if .Values.serviceMonitor.labels }}
labels: {{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.annotations }}
annotations: {{- toYaml .Values.serviceMonitor.annotations | nindent 4 }}
{{- end }}
spec:
endpoints:
- targetPort: metrics
scheme: http
{{- if .Values.serviceMonitor.interval }}
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
{{- with .Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 6 }}
{{- end }}
@@ -0,0 +1,342 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
{{- if .Values.webhook.enabled }}
{{- $certCert := "" -}}
{{- $certKey := "" -}}
{{- $caCert := "" -}}
{{- if not .Values.webhook.certificate.provided }}
{{- $cn := printf "%s.%s.svc" (include "apisix-ingress-controller-manager.webhook.serviceName" .) .Release.Namespace -}}
{{- $ca := genCA "apisix-ingress-webhook-ca" 3650 -}}
{{- $cert := genSignedCert $cn nil (list $cn) 3650 $ca -}}
{{- $certCert = $cert.Cert -}}
{{- $certKey = $cert.Key -}}
{{- $caCert = $ca.Cert -}}
{{- $certSecret := (lookup "v1" "Secret" .Release.Namespace (include "apisix-ingress-controller-manager.webhook.secretName" .)) -}}
{{- if $certSecret }}
{{- $certCert = (b64dec (get $certSecret.data "tls.crt")) -}}
{{- $certKey = (b64dec (get $certSecret.data "tls.key")) -}}
{{- $caCert = (b64dec (get $certSecret.data "ca.crt")) -}}
{{- end }}
{{- end }}
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}-webhook
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
webhooks:
- name: vapisixroute-v2.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-apisix-apache-org-v2-apisixroute
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["apisix.apache.org"]
apiVersions: ["v2"]
resources: ["apisixroutes"]
- name: vapisixconsumer-v2.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-apisix-apache-org-v2-apisixconsumer
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["apisix.apache.org"]
apiVersions: ["v2"]
resources: ["apisixconsumers"]
- name: vapisixtls-v2.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-apisix-apache-org-v2-apisixtls
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["apisix.apache.org"]
apiVersions: ["v2"]
resources: ["apisixtlses"]
- name: vconsumer-v1alpha1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-apisix-apache-org-v1alpha1-consumer
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["apisix.apache.org"]
apiVersions: ["v1alpha1"]
resources: ["consumers"]
- name: vgatewayproxy-v1alpha1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-apisix-apache-org-v1alpha1-gatewayproxy
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["apisix.apache.org"]
apiVersions: ["v1alpha1"]
resources: ["gatewayproxies"]
- name: vingress-v1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-networking-k8s-io-v1-ingress
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["networking.k8s.io"]
apiVersions: ["v1"]
resources: ["ingresses"]
- name: vingressclass-v1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-networking-k8s-io-v1-ingressclass
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["networking.k8s.io"]
apiVersions: ["v1"]
resources: ["ingressclasses"]
- name: vgateway-v1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-gateway-networking-k8s-io-v1-gateway
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["gateway.networking.k8s.io"]
apiVersions: ["v1"]
resources: ["gateways"]
- name: vgrpcroute-v1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-gateway-networking-k8s-io-v1-grpcroute
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["gateway.networking.k8s.io"]
apiVersions: ["v1"]
resources: ["grpcroutes"]
- name: vhttproute-v1.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-gateway-networking-k8s-io-v1-httproute
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["gateway.networking.k8s.io"]
apiVersions: ["v1"]
resources: ["httproutes"]
- name: vtcproute-v1alpha2.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-gateway-networking-k8s-io-v1alpha2-tcproute
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["gateway.networking.k8s.io"]
apiVersions: ["v1alpha2"]
resources: ["tcproutes"]
- name: vudproute-v1alpha2.kb.io
admissionReviewVersions: ["v1"]
clientConfig:
{{- if not .Values.webhook.certificate.provided }}
caBundle: {{ b64enc $caCert }}
{{- else }}
caBundle: {{ .Values.webhook.certificate.caBundle }}
{{- end }}
service:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
path: /validate-gateway-networking-k8s-io-v1alpha2-udproute
failurePolicy: {{ .Values.webhook.failurePolicy }}
{{- with .Values.webhook.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
sideEffects: None
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["gateway.networking.k8s.io"]
apiVersions: ["v1alpha2"]
resources: ["udproutes"]
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "apisix-ingress-controller-manager.webhook.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
spec:
ports:
- name: webhook
port: 443
protocol: TCP
targetPort: webhook
selector:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 4 }}
{{- if not .Values.webhook.certificate.provided }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "apisix-ingress-controller-manager.webhook.secretName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
type: kubernetes.io/tls
data:
tls.crt: {{ b64enc $certCert }}
tls.key: {{ b64enc $certKey }}
ca.crt: {{ b64enc $caCert }}
{{- end }}
{{- end }}