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

Update the qtap-operator type to support the new functionality for labelling and injection #44

Merged
merged 2 commits into from
Dec 2, 2023
Merged
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/qtap-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v2
name: qtap-operator
description: A Helm chart for a Kubernetes Qtap operator
type: application
version: 0.0.7
version: 0.0.8
# This is the semantic version of https://github.com/qpoint-io/kubernetes-qtap-operator/releases being deployed
appVersion: "v0.0.4"
appVersion: "v0.0.5"
2 changes: 2 additions & 0 deletions charts/qtap-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
command:
- /manager
env:
- name: ENDPOINT
value: {{ quote .Values.controllerManager.manager.env.endpoint }}
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
image: {{ .Values.controllerManager.manager.image.repository }}:{{ .Values.controllerManager.manager.image.tag
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "qtap-operator.fullname" . }}-inject-pod-annotations-configmap
labels:
{{- include "qtap-operator.labels" . | nindent 4 }}
data:
annotations.yaml: {{ .Values.injectPodAnnotationsConfigmap.annotationsYaml | toYaml
| indent 1 }}
43 changes: 43 additions & 0 deletions charts/qtap-operator/templates/manager-cluster-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "qtap-operator.fullname" . }}-manager-cluster-role
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: qtap-operator
app.kubernetes.io/part-of: qtap-operator
{{- include "qtap-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "qtap-operator.fullname" . }}-manager-clusterrolebinding
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: qtap-operator
app.kubernetes.io/part-of: qtap-operator
{{- include "qtap-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "qtap-operator.fullname" . }}-manager-cluster-role'
subjects:
- kind: ServiceAccount
name: '{{ include "qtap-operator.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
20 changes: 6 additions & 14 deletions charts/qtap-operator/templates/manager-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: Role
metadata:
name: {{ include "qtap-operator.fullname" . }}-manager-role
labels:
Expand All @@ -11,31 +11,23 @@ rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
- configmaps
verbs:
- get
- list
- watch
- create
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- get
- list
- watch
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: RoleBinding
metadata:
name: {{ include "qtap-operator.fullname" . }}-manager-rolebinding
labels:
Expand All @@ -45,7 +37,7 @@ metadata:
{{- include "qtap-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
kind: Role
name: '{{ include "qtap-operator.fullname" . }}-manager-role'
subjects:
- kind: ServiceAccount
Expand Down
9 changes: 9 additions & 0 deletions charts/qtap-operator/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if .Values.token }}
apiVersion: v1
kind: Secret
metadata:
name: token
type: Opaque
data:
token: {{ .Values.token | b64enc }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "qtap-operator.fullname" . }}-default-pod-annotations-configmap
name: {{ include "qtap-operator.fullname" . }}-service-pod-annotations-configmap
labels:
{{- include "qtap-operator.labels" . | nindent 4 }}
data:
annotations.yaml: {{ .Values.defaultPodAnnotationsConfigmap.annotationsYaml | toYaml
annotations.yaml: {{ .Values.servicePodAnnotationsConfigmap.annotationsYaml | toYaml
| indent 1 }}
22 changes: 19 additions & 3 deletions charts/qtap-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ controllerManager:
capabilities:
drop:
- ALL
env:
endpoint: https://api.qpoint.io
image:
repository: us-docker.pkg.dev/qpoint-edge/public/kubernetes-qtap-operator
tag: latest
imagePullPolicy: IfNotPresent
resources:
limits:
Expand All @@ -43,12 +46,15 @@ controllerManager:
replicas: 1
serviceAccount:
annotations: {}
defaultPodAnnotationsConfigmap:
injectPodAnnotationsConfigmap:
annotationsYaml: |-
qpoint.io/inject-ca: "true"
qpoint.io/egress-init-tag: "v0.0.7"
qpoint.io/egress-to-domain: "qtap-gateway.qpoint.svc.cluster.local"
qpoint.io/egress-port-mapping: "10080:80,10443:443"
qpoint.io/qtap-tag: "v0.0.10"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

qpoint.io/egress-port-mapping: "10080:80,10443:443,10000:"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will egress route all TCP ports.

qpoint.io/log-level: "info"
qpoint.io/block-unknown: "false"
qpoint.io/dns-lookup-family: "V4_ONLY"
kubernetesClusterDomain: cluster.local
metricsService:
ports:
Expand All @@ -57,9 +63,19 @@ metricsService:
protocol: TCP
targetPort: https
type: ClusterIP
servicePodAnnotationsConfigmap:
annotationsYaml: |-
qpoint.io/inject-ca: "true"
qpoint.io/egress-init-tag: "v0.0.7"
qpoint.io/egress-to-domain: "qtap-gateway.qpoint.svc.cluster.local"
qpoint.io/egress-port-mapping: "10080:80,10443:443"
webhookService:
ports:
- port: 443
protocol: TCP
targetPort: 9443
type: ClusterIP


# API token
token: ""