Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
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
10 changes: 5 additions & 5 deletions .tools/nvim/__http__/infra/clusters.graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ query: |+ #graphql
}
variables:
cluster:
displayName: "Sample Cluster 2"
displayName: "do not use this cluster"
metadata:
name: "{{.gcpClusterName}}"
name: "{{.gcpClusterName}}3"
spec:
cloudflareEnabled: true
availabilityMode: dev
Expand All @@ -59,7 +59,7 @@ variables:
credentialsRef:
name: "{{.gcpCloudproviderName}}"
region: asia-south1
gcpProjectID: "rich-wavelet-412321"
# gcpProjectID: "rich-wavelet-412321"
---

label: List Clusters
Expand Down Expand Up @@ -277,8 +277,8 @@ query: |+ #graphql
infra_upgradeHelmKloudliteAgent(clusterName: $clusterName)
}
variables:
clusterName: "{{.clusterName}}"
# clusterName: "{{.gcpClusterName}}"
# clusterName: "{{.clusterName}}"
clusterName: "{{.gcpClusterName}}"
---

label: Delete Cluster
Expand Down
50 changes: 50 additions & 0 deletions .tools/nvim/__http__/infra/global-vpn-devices.graphql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
global:
gvpn: "default"
deviceName: "first-device"
# deviceName: "second-device"
---
label: "Create GlobalVPN Device"
query: |+
mutation Infra_createGlobalVPNDevice($gvpnDevice: GlobalVPNDeviceIn!) {
infra_createGlobalVPNDevice(gvpnDevice: $gvpnDevice) {
metadata {
name
}
}
}
variables:
gvpnDevice:
metadata:
name: "{{.deviceName}}"
globalVPNName: "{{.gvpn}}"
---

label: "delete global vpn device"
query: |+
mutation Infra_deleteGlobalVPNDevice($gvpn: String!, $deviceName: String!) {
infra_deleteGlobalVPNDevice(gvpn: $gvpn, deviceName: $deviceName)
}
variables:
gvpn: "{{.gvpn}}"
deviceName: "{{.deviceName}}"

---
label: "get global vpn device"
query: |+
query Infra_getGlobalVPNDevice($gvpn: String!, $deviceName: String!) {
infra_getGlobalVPNDevice(gvpn: $gvpn, deviceName: $deviceName) {
metadata {
name
}
ipAddr
wireguardConfig {
encoding
value
}
}
}
variables:
gvpn: "{{.gvpn}}"
deviceName: "{{.deviceName}}"
---
1 change: 0 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ tasks:
# - mkdir -p mocks/pkg/kafka
# - mocki --package github.com/kloudlite/api/pkg/kafka --interface Producer > mocks/pkg/kafka/producer.go
# - mocki --package github.com/kloudlite/api/pkg/kafka --interface Consumer > mocks/pkg/kafka/consumer.go
#
10 changes: 9 additions & 1 deletion apps/console/internal/domain/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ func (d *domain) UpdateApp(ctx ResourceContext, appIn entities.App) (*entities.A
}

// FIXME: hotfix till volume mounts for PVCs are not added in UI

pvcMounts := make(map[int][]crdsv1.ContainerVolume)
for i := range xapp.Spec.Containers {
for _, volume := range xapp.Spec.Containers[i].Volumes {
Expand Down Expand Up @@ -176,6 +175,15 @@ func (d *domain) UpdateApp(ctx ResourceContext, appIn entities.App) (*entities.A
}
}

// readiness and liveness probes
if xapp.Spec.Containers[0].LivenessProbe != nil && appIn.Spec.Containers[0].LivenessProbe == nil {
appIn.Spec.Containers[0].LivenessProbe = xapp.Spec.Containers[0].LivenessProbe
}

if xapp.Spec.Containers[0].ReadinessProbe != nil {
appIn.Spec.Containers[0].ReadinessProbe = xapp.Spec.Containers[0].ReadinessProbe
}

patchDoc := repos.Document{
fc.AppCiBuildId: appIn.CIBuildId,
fc.AppSpec: appIn.Spec,
Expand Down
5 changes: 3 additions & 2 deletions apps/infra/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ tasks:
--struct github.com/kloudlite/api/apps/infra/internal/entities.MsvcTemplate
--struct github.com/kloudlite/api/apps/infra/internal/entities.Node
--struct github.com/kloudlite/api/apps/infra/internal/entities.NodePool
--struct github.com/kloudlite/api/apps/infra/internal/entities.ClusterGroup
--struct github.com/kloudlite/api/apps/infra/internal/entities.GlobalVPN
--struct github.com/kloudlite/api/apps/infra/internal/entities.GlobalVPNDevice
--struct github.com/kloudlite/api/apps/infra/internal/entities.CloudProviderSecret
--struct github.com/kloudlite/api/apps/infra/internal/entities.DomainEntry
--struct github.com/kloudlite/api/apps/infra/internal/entities.HelmRelease
Expand All @@ -36,7 +37,7 @@ tasks:
> ./internal/app/_struct-to-graphql/main.go
- |+
pushd ./internal/app/_struct-to-graphql
go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Cluster,Node,NodePool,ClusterGroup,CloudProviderSecret,DomainEntry,PersistentVolumeClaim,ClusterManagedService,HelmRelease,Namespace,VolumeAttachment,PersistentVolume
go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Cluster,Node,NodePool,GlobalVPN,GlobalVPNDevice,CloudProviderSecret,DomainEntry,PersistentVolumeClaim,ClusterManagedService,HelmRelease,Namespace,VolumeAttachment,PersistentVolume
popd
- rm -rf ./internal/app/_struct-to-graphql

Expand Down
13 changes: 10 additions & 3 deletions apps/infra/internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ type (
var Module = fx.Module(
"app",
repos.NewFxMongoRepo[*entities.Cluster]("clusters", "clus", entities.ClusterIndices),
repos.NewFxMongoRepo[*entities.ClusterConnection]("cluster-connections", "clus-cn", entities.ClusterConnIndices),
repos.NewFxMongoRepo[*entities.ClusterGroup]("cluster-groups", "clus-grp", entities.ClusterGroupIndices),
repos.NewFxMongoRepo[*entities.GlobalVPNConnection]("global_vpn_connections", "gvpn-conn", entities.GlobalVPNConnectionIndices),
repos.NewFxMongoRepo[*entities.GlobalVPN]("global_vpn", "gvpn", entities.GlobalVPNIndices),
repos.NewFxMongoRepo[*entities.GlobalVPNDevice]("global_vpn_device", "gvpn-dev", entities.GlobalVPNDeviceIndices),

repos.NewFxMongoRepo[*entities.ClaimDeviceIP]("claim_device_ip", "claim-ip", entities.ClaimDeviceIPIndices),
repos.NewFxMongoRepo[*entities.FreeDeviceIP]("free_device_ip", "free-ip", entities.FreeDeviceIPIndices),
repos.NewFxMongoRepo[*entities.FreeClusterSvcCIDR]("free_cluster_svc_cidr", "free-clus-cidr", entities.FreeClusterSvcCIDRIndices),
repos.NewFxMongoRepo[*entities.ClaimClusterSvcCIDR]("claim_cluster_svc_cidr", "claim-clus-cidr", entities.ClaimClusterSvcCIDRIndices),

// repos.NewFxMongoRepo[*entities.BYOKCluster]("byok_clusters", "byok", entities.BYOKClusterIndices),
repos.NewFxMongoRepo[*entities.BYOKCluster]("clusters", "byok", entities.BYOKClusterIndices),
repos.NewFxMongoRepo[*entities.ClusterManagedService]("cmsvcs", "cmsvcs", entities.ClusterManagedServiceIndices),
repos.NewFxMongoRepo[*entities.ClusterManagedService]("cmsvcs", "cmsvc", entities.ClusterManagedServiceIndices),
repos.NewFxMongoRepo[*entities.DomainEntry]("domain_entries", "de", entities.DomainEntryIndices),
repos.NewFxMongoRepo[*entities.NodePool]("node_pools", "npool", entities.NodePoolIndices),
repos.NewFxMongoRepo[*entities.Node]("node", "node", entities.NodePoolIndices),
Expand Down
12 changes: 8 additions & 4 deletions apps/infra/internal/app/gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ models:
resolver: true
ClusterIn: *cluster-model

ClusterGroup: &cluster-group-model
model: github.com/kloudlite/api/apps/infra/internal/entities.ClusterGroup
GlobalVPN: &cluster-group-model
model: github.com/kloudlite/api/apps/infra/internal/entities.GlobalVPN
GlobalVPNIn: *cluster-group-model

GlobalVPNDevice: &gvpn-device-model
model: github.com/kloudlite/api/apps/infra/internal/entities.GlobalVPNDevice
fields:
adminKubeconfig:
wireguardConfig:
resolver: true
ClusterGroupIn: *cluster-group-model
GlobalVPNDeviceIn: *gvpn-device-model

BYOKCluster: &byok-cluster-model
model: github.com/kloudlite/api/apps/infra/internal/entities.BYOKCluster
Expand Down
47 changes: 0 additions & 47 deletions apps/infra/internal/app/graph/clustergroup.resolvers.go

This file was deleted.

Loading