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

kustomize deploy #104

Merged
merged 6 commits into from
Sep 5, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ _output
charts/*/charts
cmd/ops
.turbo
.dockerconfigjson
3 changes: 3 additions & 0 deletions artifacts/dashboard/karmada-dashboard-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
name: karmada-dashboard-api
image: karmada/karmada-dashboard-api:main
RainbowMango marked this conversation as resolved.
Show resolved Hide resolved
imagePullPolicy: IfNotPresent
env:
- name: GIN_MODE
value: release
Comment on lines +37 to +39
Copy link
Member

Choose a reason for hiding this comment

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

What's the environment used for? I searched over the code base but didn't find any reference to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the env for gin, more details can refer: https://github.com/gin-gonic/gin/blob/master/mode.go

livenessProbe:
failureThreshold: 8
httpGet:
Expand Down
11 changes: 11 additions & 0 deletions artifacts/dashboard/karmada-dashboard-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ spec:
- --static-dir=/static
- --insecure-bind-address=0.0.0.0
- --bind-address=0.0.0.0
- --dashboard-config-path=/config/dashboard-config.yaml
name: karmada-dashboard-web
image: karmada/karmada-dashboard-web:main
imagePullPolicy: IfNotPresent
env:
- name: GIN_MODE
value: release
livenessProbe:
failureThreshold: 8
httpGet:
Expand Down Expand Up @@ -58,12 +62,19 @@ spec:
- name: kubeconfig
subPath: kubeconfig
mountPath: /etc/kubeconfig
- name: dashboard-config
subPath: prod.yaml
mountPath: /config/dashboard-config.yaml
restartPolicy: Always
terminationGracePeriodSeconds: 30
volumes:
- name: kubeconfig
secret:
secretName: kubeconfig
- name: dashboard-config
configMap:
name: karmada-dashboard-configmap

---
apiVersion: v1
kind: Service
Expand Down
8 changes: 8 additions & 0 deletions artifacts/dashboard/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- karmada-dashboard-sa.yaml
- karmada-dashboard-web.yaml
- karmada-dashboard-api.yaml
- karmada-dashboard-configmap.yaml
79 changes: 79 additions & 0 deletions artifacts/overlays/ingress-mode/dashboard-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
docker_registries: []
chart_registries: []
# path_prefix: '/karmada'
path_prefix: ''
menu_configs:
- path: /overview
enable: true
sidebar_key: OVERVIEW
- path: /multicloud-resource-manage
enable: true
sidebar_key: MULTICLOUD-RESOURCE-MANAGE
children:
- path: namespace
enable: true
sidebar_key: NAMESPACE
- path: workload
enable: true
sidebar_key: WORKLOAD
- path: service
enable: true
sidebar_key: SERVICE
- path: config
enable: true
sidebar_key: CONFIG
- path: /multicloud-policy-manage
enable: true
sidebar_key: MULTICLOUD-POLICY-MANAGE
children:
- path: propagation-policy
enable: true
sidebar_key: PROPAGATION-POLICY
- path: override-policy
enable: true
sidebar_key: OVERRIDE-POLICY
- path: /cluster-manage
enable: true
sidebar_key: CLUSTER-MANAGE
- path: /basic-config
enable: true
sidebar_key: BASIC-CONFIG
children:
- path: oem
enable: false
sidebar_key: OEM
- path: upgrade
enable: false
sidebar_key: UPGRADE
- path: karmada-config
enable: true
sidebar_key: KARMADA-CONFIG
- path: helm
enable: true
sidebar_key: HELM
- path: registry
enable: true
sidebar_key: REGISTRY
- path: /advanced-config
enable: false
sidebar_key: ADVANCED-CONFIG
children:
- path: failover
enable: true
sidebar_key: FAILOVER
- path: reschedule
enable: true
sidebar_key: RESCHEDULE
- path: permission
enable: true
sidebar_key: PERMISSION
- path: /addon
enable: false
sidebar_key: ADDON
children:
- path: buildin
enable: true
sidebar_key: BUILDIN
- path: thirdparty
enable: true
sidebar_key: THIRDPARTY
14 changes: 14 additions & 0 deletions artifacts/overlays/ingress-mode/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-karmada-dashboard
namespace: karmada-system
spec:
rules:
- http:
paths:
- backend:
serviceName: karmada-dashboard-web
servicePort: 8000
path: /
pathType: ImplementationSpecific
59 changes: 59 additions & 0 deletions artifacts/overlays/ingress-mode/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../dashboard
- ./ingress.yaml

configMapGenerator:
- name: karmada-dashboard-configmap
namespace: karmada-system
behavior: replace
files:
- prod.yaml=dashboard-config.yaml

# If you want to create secret for private registry, uncomment it
#secretGenerator:
# - name: regcred
# namespace: karmada-system
# files:
# - .dockerconfigjson
# type: kubernetes.io/dockerconfigjson

# Uncomment the patch rules to make change to ingress
#patches:
# By default, the ingress-mode will export karmada-dashboard-web with no-domain specified and served with location '/'
# If you want to specify domain or change the location path, you can uncomment the following patch code
# - target:
# kind: Ingress
# name: ingress-karmada-dashboard
# namespace: karmada-system
# patch: |-
# # If you want to specify domain, you can uncomment the first patch rules
# - op: add
# path: /spec/rules/0/host
# value: "www.example.com"
# # If you want to change the location path from '/' to customized path, you can uncomment the following patch rules
# # Noticed: the path value should be consisted with 'path_prefix' field in the './dashboard-config.yaml'
# - op: replace
# path: /spec/rules/0/http/paths/0/path
# value: "/karmada"
# # Uncomment the next two patch rules to add imagePullSecrets to deployment
# - target:
# kind: Deployment
# name: karmada-dashboard-web
# namespace: karmada-system
# patch: |-
# - op: add
# path: /spec/template/spec/imagePullSecrets
# value: [{ name: regcred }]
# - target:
# kind: Deployment
# name: karmada-dashboard-api
# namespace: karmada-system
# patch: |-
# - op: add
# path: /spec/template/spec/imagePullSecrets
# value: [{ name: regcred }]


79 changes: 79 additions & 0 deletions artifacts/overlays/nodeport-mode/dashboard-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
docker_registries: []
chart_registries: []
# path_prefix: '/karmada'
path_prefix: ''
menu_configs:
- path: /overview
enable: true
sidebar_key: OVERVIEW
- path: /multicloud-resource-manage
enable: true
sidebar_key: MULTICLOUD-RESOURCE-MANAGE
children:
- path: namespace
enable: true
sidebar_key: NAMESPACE
- path: workload
enable: true
sidebar_key: WORKLOAD
- path: service
enable: true
sidebar_key: SERVICE
- path: config
enable: true
sidebar_key: CONFIG
- path: /multicloud-policy-manage
enable: true
sidebar_key: MULTICLOUD-POLICY-MANAGE
children:
- path: propagation-policy
enable: true
sidebar_key: PROPAGATION-POLICY
- path: override-policy
enable: true
sidebar_key: OVERRIDE-POLICY
- path: /cluster-manage
enable: true
sidebar_key: CLUSTER-MANAGE
- path: /basic-config
enable: true
sidebar_key: BASIC-CONFIG
children:
- path: oem
enable: false
sidebar_key: OEM
- path: upgrade
enable: false
sidebar_key: UPGRADE
- path: karmada-config
enable: true
sidebar_key: KARMADA-CONFIG
- path: helm
enable: true
sidebar_key: HELM
- path: registry
enable: true
sidebar_key: REGISTRY
- path: /advanced-config
enable: false
sidebar_key: ADVANCED-CONFIG
children:
- path: failover
enable: true
sidebar_key: FAILOVER
- path: reschedule
enable: true
sidebar_key: RESCHEDULE
- path: permission
enable: true
sidebar_key: PERMISSION
- path: /addon
enable: false
sidebar_key: ADDON
children:
- path: buildin
enable: true
sidebar_key: BUILDIN
- path: thirdparty
enable: true
sidebar_key: THIRDPARTY
26 changes: 26 additions & 0 deletions artifacts/overlays/nodeport-mode/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../dashboard

configMapGenerator:
- name: karmada-dashboard-configmap
namespace: karmada-system
behavior: replace
files:
- prod.yaml=dashboard-config.yaml

patches:
- target:
kind: Service
name: karmada-dashboard-web
namespace: karmada-system
version: v1
patch: |-
- op: replace
path: /spec/type
value: NodePort
- op: add
path: /spec/ports/0/nodePort
value: 32000 # you can change the nodePort value