Skip to content

Commit 95f2848

Browse files
authored
chore: update to api7-ingress-controller (#187)
1 parent b26c0fb commit 95f2848

File tree

13 files changed

+100
-59
lines changed

13 files changed

+100
-59
lines changed

charts/ingress-controller/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Ingress Controller for API7
2828
| config.provider.initSyncDelay | string | `"20m"` | |
2929
| config.provider.syncPeriod | string | `"0s"` | |
3030
| config.provider.type | string | `"api7ee"` | |
31-
| config.secureMetrics | string | `""` | |
31+
| config.secureMetrics | bool | `false` | |
3232
| deployment.affinity | object | `{}` | |
3333
| deployment.annotations | object | `{}` | |
3434
| deployment.image.pullPolicy | string | `"IfNotPresent"` | |
@@ -38,7 +38,6 @@ Ingress Controller for API7
3838
| deployment.podAnnotations | object | `{}` | |
3939
| deployment.podSecurityContext | object | `{}` | |
4040
| deployment.replicas | int | `1` | |
41-
| deployment.securityContext | object | `{}` | |
4241
| deployment.tolerations | list | `[]` | |
4342
| deployment.topologySpreadConstraints | list | `[]` | |
4443
| fullnameOverride | string | `""` | |

charts/ingress-controller/crds/apisix-crds.yaml

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ spec:
1010
kind: ApisixConsumer
1111
listKind: ApisixConsumerList
1212
plural: apisixconsumers
13+
shortNames:
14+
- ac
1315
singular: apisixconsumer
1416
scope: Namespaced
1517
versions:
@@ -355,6 +357,8 @@ spec:
355357
kind: ApisixGlobalRule
356358
listKind: ApisixGlobalRuleList
357359
plural: apisixglobalrules
360+
shortNames:
361+
- agr
358362
singular: apisixglobalrule
359363
scope: Namespaced
360364
versions:
@@ -492,6 +496,8 @@ spec:
492496
kind: ApisixPluginConfig
493497
listKind: ApisixPluginConfigList
494498
plural: apisixpluginconfigs
499+
shortNames:
500+
- apc
495501
singular: apisixpluginconfig
496502
scope: Namespaced
497503
versions:
@@ -630,10 +636,40 @@ spec:
630636
kind: ApisixRoute
631637
listKind: ApisixRouteList
632638
plural: apisixroutes
639+
shortNames:
640+
- ar
633641
singular: apisixroute
634642
scope: Namespaced
635643
versions:
636-
- name: v2
644+
- additionalPrinterColumns:
645+
- description: HTTP Hosts
646+
jsonPath: .spec.http[].match.hosts
647+
name: Hosts
648+
type: string
649+
- description: HTTP Paths
650+
jsonPath: .spec.http[].match.paths
651+
name: URIs
652+
type: string
653+
- description: Backend Service for HTTP
654+
jsonPath: .spec.http[].backends[].serviceName
655+
name: Target Service (HTTP)
656+
priority: 1
657+
type: string
658+
- description: TCP Ingress Port
659+
jsonPath: .spec.tcp[].match.ingressPort
660+
name: Ingress Port (TCP)
661+
priority: 1
662+
type: integer
663+
- description: Backend Service for TCP
664+
jsonPath: .spec.tcp[].match.backend.serviceName
665+
name: Target Service (TCP)
666+
priority: 1
667+
type: string
668+
- description: Creation time
669+
jsonPath: .metadata.creationTimestamp
670+
name: Age
671+
type: date
672+
name: v2
637673
schema:
638674
openAPIV3Schema:
639675
description: ApisixRoute is the Schema for the apisixroutes API.
@@ -1092,7 +1128,26 @@ spec:
10921128
singular: apisixtls
10931129
scope: Namespaced
10941130
versions:
1095-
- name: v2
1131+
- additionalPrinterColumns:
1132+
- jsonPath: .spec.hosts
1133+
name: SNIs
1134+
type: string
1135+
- jsonPath: .spec.secret.name
1136+
name: Secret Name
1137+
type: string
1138+
- jsonPath: .spec.secret.namespace
1139+
name: Secret Namespace
1140+
type: string
1141+
- jsonPath: .metadata.creationTimestamp
1142+
name: Age
1143+
type: date
1144+
- jsonPath: .spec.client.ca.name
1145+
name: Client CA Secret Name
1146+
type: string
1147+
- jsonPath: .spec.client.ca.namespace
1148+
name: Client CA Secret Namespace
1149+
type: string
1150+
name: v2
10961151
schema:
10971152
openAPIV3Schema:
10981153
description: ApisixTls is the Schema for the apisixtls API.
@@ -1251,6 +1306,8 @@ spec:
12511306
kind: ApisixUpstream
12521307
listKind: ApisixUpstreamList
12531308
plural: apisixupstreams
1309+
shortNames:
1310+
- au
12541311
singular: apisixupstream
12551312
scope: Namespaced
12561313
versions:
@@ -1932,7 +1989,7 @@ spec:
19321989
When HashOn is `header` or `cookie`, specifies the name of the header or cookie.
19331990
When HashOn is `consumer`, key is not required, as the consumer name is used automatically.
19341991
When HashOn is `vars` or `vars_combinations`, key refers to one or a combination of
1935-
[built-in variables](/enterprise/reference/built-in-variables).
1992+
[APISIX variable](https://apisix.apache.org/docs/apisix/apisix-variable/).
19361993
type: string
19371994
type:
19381995
default: roundrobin
@@ -2700,8 +2757,9 @@ spec:
27002757
type: boolean
27012758
required:
27022759
- auth
2703-
- endpoints
27042760
type: object
2761+
x-kubernetes-validations:
2762+
- rule: has(self.endpoints) != has(self.service)
27052763
type:
27062764
description: Type specifies the type of provider. Can only be
27072765
`ControlPlane`.

charts/ingress-controller/templates/_helpers.tpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "apisix-ingress-controller-manager.name" -}}
4+
{{- define "api7-ingress-controller-manager.name" -}}
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77
{{/*
88
Create a default fully qualified app name.
99
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1010
If release name contains chart name it will be used as a full name.
1111
*/}}
12-
{{- define "apisix-ingress-controller-manager.name.fullname" -}}
12+
{{- define "api7-ingress-controller-manager.name.fullname" -}}
1313
{{- if .Values.fullnameOverride }}
1414
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
1515
{{- else }}
@@ -24,15 +24,15 @@ If release name contains chart name it will be used as a full name.
2424
{{/*
2525
Create chart name and version as used by the chart label.
2626
*/}}
27-
{{- define "apisix-ingress-controller-manager.chart" -}}
27+
{{- define "api7-ingress-controller-manager.chart" -}}
2828
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
2929
{{- end }}
3030
{{/*
3131
Common labels
3232
*/}}
33-
{{- define "apisix-ingress-controller-manager.labels" -}}
34-
helm.sh/chart: {{ include "apisix-ingress-controller-manager.chart" . }}
35-
{{ include "apisix-ingress-controller-manager.selectorLabels" . }}
33+
{{- define "api7-ingress-controller-manager.labels" -}}
34+
helm.sh/chart: {{ include "api7-ingress-controller-manager.chart" . }}
35+
{{ include "api7-ingress-controller-manager.selectorLabels" . }}
3636
{{- if .Chart.AppVersion }}
3737
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
3838
{{- end }}
@@ -42,11 +42,11 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4242
{{/*
4343
Selector labels
4444
*/}}
45-
{{- define "apisix-ingress-controller-manager.selectorLabels" -}}
45+
{{- define "api7-ingress-controller-manager.selectorLabels" -}}
4646
{{- if .Values.labelsOverride }}
4747
{{- tpl (.Values.labelsOverride | toYaml) . }}
4848
{{- else }}
49-
app.kubernetes.io/name: {{ include "apisix-ingress-controller-manager.name" . }}
49+
app.kubernetes.io/name: {{ include "api7-ingress-controller-manager.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252
{{- end }}

charts/ingress-controller/templates/cluster_role.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: {{ .Release.Name }}-apisix-ingress-manager-role
4+
name: {{ .Release.Name }}-api7-ingress-manager-role
55
rules:
66
- apiGroups:
77
- ""
@@ -139,7 +139,7 @@ rules:
139139
apiVersion: rbac.authorization.k8s.io/v1
140140
kind: ClusterRole
141141
metadata:
142-
name: {{ .Release.Name }}-apisix-ingress-metrics-auth-role
142+
name: {{ .Release.Name }}-api7-ingress-metrics-auth-role
143143
rules:
144144
- apiGroups:
145145
- authentication.k8s.io
@@ -157,7 +157,7 @@ rules:
157157
apiVersion: rbac.authorization.k8s.io/v1
158158
kind: ClusterRole
159159
metadata:
160-
name: {{ .Release.Name }}-apisix-ingress-metrics-reader
160+
name: {{ .Release.Name }}-api7-ingress-metrics-reader
161161
rules:
162162
- nonResourceURLs:
163163
- /metrics

charts/ingress-controller/templates/cluster_role_binding.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
44
labels:
5-
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
6-
name: {{ .Release.Name }}-apisix-ingress-manager-rolebinding
5+
{{- include "api7-ingress-controller-manager.labels" . | nindent 4 }}
6+
name: {{ .Release.Name }}-api7-ingress-manager-rolebinding
77
roleRef:
88
apiGroup: rbac.authorization.k8s.io
99
kind: ClusterRole
10-
name: {{ .Release.Name }}-apisix-ingress-manager-role
10+
name: {{ .Release.Name }}-api7-ingress-manager-role
1111
subjects:
1212
- kind: ServiceAccount
1313
name: {{ .Release.Name }}
@@ -16,11 +16,11 @@ subjects:
1616
apiVersion: rbac.authorization.k8s.io/v1
1717
kind: ClusterRoleBinding
1818
metadata:
19-
name: {{ .Release.Name }}-apisix-ingress-metrics-auth-rolebinding
19+
name: {{ .Release.Name }}-api7-ingress-metrics-auth-rolebinding
2020
roleRef:
2121
apiGroup: rbac.authorization.k8s.io
2222
kind: ClusterRole
23-
name: {{ .Release.Name }}-apisix-ingress-metrics-auth-role
23+
name: {{ .Release.Name }}-api7-ingress-metrics-auth-role
2424
subjects:
2525
- kind: ServiceAccount
2626
name: {{ .Release.Name }}

charts/ingress-controller/templates/configmap.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,19 @@ metadata:
66
data:
77
config.yaml: |
88
log_level: {{ .Values.config.logLevel | default "info" }}
9-
109
controller_name: {{ .Values.config.controllerName | default "apisix.apache.org/apisix-ingress-controller" }}
11-
1210
leader_election_id: {{ .Values.config.leaderElection.id | default "apisix-ingress-controller-leader" }}
13-
1411
leader_election:
15-
1612
leaseDuration: {{ .Values.config.leaderElection.leaseDuration | default "15s" }}
17-
1813
renewDeadline: {{ .Values.config.leaderElection.renewDeadline | default "10s" }}
19-
2014
retryPeriod: {{ .Values.config.leaderElection.retryPeriod | default "2s" }}
21-
2215
disable: {{ .Values.config.leaderElection.disable | default false }}
23-
2416
metrics_addr: {{ .Values.config.metricsAddr | default ":8080" }}
25-
2617
enable_http2: {{ .Values.config.enableHTTP2 | default false }}
27-
2818
probe_addr: {{ .Values.config.probeAddr | default ":8081" }}
29-
30-
secure_metrics: {{ .Values.config.secureMetrics | default "" }}
31-
19+
secure_metrics: {{ .Values.config.secureMetrics | default false }}
3220
exec_adc_timeout: {{ .Values.config.execADCTimeout | default "15s" }}
33-
3421
provider:
3522
type: {{ .Values.config.provider.type | default "api7ee" }}
36-
3723
sync_period: {{ .Values.config.provider.syncPeriod | default "0s" }}
38-
3924
init_sync_delay: {{ .Values.config.provider.initSyncDelay | default "20m" }}

charts/ingress-controller/templates/deployment.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
labels:
5-
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
6-
name: {{ .Release.Name }}
4+
name: {{ include "api7-ingress-controller-manager.name.fullname" . }}
75
namespace: {{ .Release.Namespace }}
86
annotations:
97
{{- range $key, $value := .Values.deployment.annotations }}
108
{{ $key }}: {{ $value | quote }}
119
{{- end }}
10+
labels:
11+
{{- include "api7-ingress-controller-manager.labels" . | nindent 4 }}
1212
spec:
1313
replicas: {{ .Values.deployment.replicas }}
1414
selector:
1515
matchLabels:
16-
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 6 }}
16+
{{- include "api7-ingress-controller-manager.selectorLabels" . | nindent 6 }}
1717
template:
1818
metadata:
1919
annotations:
20+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
2021
{{- if .Values.deployment.podAnnotations }}
2122
{{- range $key, $value := $.Values.deployment.podAnnotations }}
2223
{{ $key }}: {{ $value | quote }}
2324
{{- end }}
2425
{{- end }}
2526
labels:
26-
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 8 }}
27+
{{- include "api7-ingress-controller-manager.selectorLabels" . | nindent 8 }}
2728
spec:
2829
containers:
2930
- env:
@@ -83,6 +84,6 @@ spec:
8384
configMap:
8485
name: {{ .Release.Name }}-ingress-config
8586
securityContext:
86-
{{- toYaml .Values.deployment.securityContext | nindent 8 }}
87+
runAsNonRoot: false
8788
serviceAccountName: {{ .Release.Name }}
8889
terminationGracePeriodSeconds: 10
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
2-
{{- if and .Values.podDisruptionBudget.enabled (or (and .Values.autoscaling.enabled (gt (.Values.autoscaling.minReplicas | int) 1)) (and (not .Values.autoscaling.enabled) (gt (.Values.replicaCount | int) 1))) }}
1+
{{- 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))) }}
32
{{ if semverCompare "<1.21-0" .Capabilities.KubeVersion.Version -}}
43
apiVersion: policy/v1beta1
54
{{- else -}}
65
apiVersion: policy/v1
76
{{- end }}
87
kind: PodDisruptionBudget
98
metadata:
10-
name: {{ include "apisix-ingress-controller.fullname" . }}
9+
name: {{ include "api7-ingress-controller.fullname" . }}
1110
namespace: {{ .Release.Namespace }}
1211
labels:
13-
{{- include "apisix-ingress-controller.labels" . | nindent 4 }}
12+
{{- include "api7-ingress-controller.labels" . | nindent 4 }}
1413
spec:
1514
{{- if .Values.podDisruptionBudget.minAvailable }}
1615
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
@@ -19,5 +18,5 @@ spec:
1918
{{- end }}
2019
selector:
2120
matchLabels:
22-
{{- include "apisix-ingress-controller.selectorLabels" . | nindent 6 }}
21+
{{- include "api7-ingress-controller.selectorLabels" . | nindent 6 }}
2322
{{- end }}

charts/ingress-controller/templates/role.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: Role
33
metadata:
44
labels:
5-
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
6-
name: {{ .Release.Name }}-apisix-ingress-leader-election-role
5+
{{- include "api7-ingress-controller-manager.labels" . | nindent 4 }}
6+
name: {{ .Release.Name }}-api7-ingress-leader-election-role
77
namespace: {{ .Release.Namespace }}
88
rules:
99
- apiGroups:

charts/ingress-controller/templates/role_binding.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ apiVersion: rbac.authorization.k8s.io/v1
22
kind: RoleBinding
33
metadata:
44
labels:
5-
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
6-
name: {{ .Release.Name }}-apisix-ingress-leader-election-rolebinding
5+
{{- include "api7-ingress-controller-manager.labels" . | nindent 4 }}
6+
name: {{ .Release.Name }}-api7-ingress-leader-election-rolebinding
77
namespace: {{ .Release.Namespace }}
88
roleRef:
99
apiGroup: rbac.authorization.k8s.io
1010
kind: Role
11-
name: {{ .Release.Name }}-apisix-ingress-leader-election-role
11+
name: {{ .Release.Name }}-api7-ingress-leader-election-role
1212
subjects:
1313
- kind: ServiceAccount
1414
name: {{ .Release.Name }}

0 commit comments

Comments
 (0)