Skip to content

Commit

Permalink
Devops project
Browse files Browse the repository at this point in the history
  • Loading branch information
saiyam1814 committed Aug 20, 2024
1 parent 3be3d44 commit 649dd37
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 31 deletions.
45 changes: 45 additions & 0 deletions argo-gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: app-gateway
namespace: default
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
gatewayClassName: nginx
listeners:
- name: http
port: 80
protocol: HTTP
hostname: "app.kubesimplify.com"
- name: https
hostname: "app.kubesimplify.com"
port: 443
protocol: HTTPS
allowedRoutes:
namespaces:
from: All
tls:
mode: Terminate
certificateRefs:
- name: app-kubesimplify-com-tls
kind: Secret
group: ""
- name: argo-http
port: 80
protocol: HTTP
hostname: "argo.kubesimplify.com"
- name: argo-https
hostname: "argo.kubesimplify.com"
port: 443
protocol: HTTPS
allowedRoutes:
namespaces:
from: All
tls:
mode: Terminate
certificateRefs:
- name: argo-kubesimplify-com-tls
kind: Secret
group: ""

4 changes: 2 additions & 2 deletions bsf.hcl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

packages {
development = ["[email protected]", "[email protected]"]
development = ["[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]"]
runtime = ["[email protected]"]
}

oci "pkgs" {
name = "docker.io/saiyam911/devops-baseimage"
name = "saiyam911/devops-kube-proj"
cmd = []
entrypoint = []
envVars = []
Expand Down
125 changes: 125 additions & 0 deletions bsf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,131 @@
"attr_name": "coreutils-full"
},
"runtime": false
},
{
"package": {
"name": "delve",
"revision": "d7570b04936e9b0f5268e0d834dee40368ad3308",
"version": "1.22.1",
"description": "debugger for the Go programming language",
"homepage": "https://github.com/go-delve/delve",
"free": true,
"spdx_id": "MIT",
"epoch_seconds": 1709830921,
"platforms": [
"x86_64-darwin",
"i686-darwin",
"aarch64-darwin",
"armv7a-darwin",
"aarch64-linux",
"armv5tel-linux",
"armv6l-linux",
"armv7a-linux",
"armv7l-linux",
"i686-linux",
"loongarch64-linux",
"m68k-linux",
"microblaze-linux",
"microblazeel-linux",
"mips-linux",
"mips64-linux",
"mips64el-linux",
"mipsel-linux",
"powerpc64-linux",
"powerpc64le-linux",
"riscv32-linux",
"riscv64-linux",
"s390-linux",
"s390x-linux",
"x86_64-linux"
],
"attr_name": "delve"
},
"runtime": false
},
{
"package": {
"name": "go",
"revision": "7445ccd775d8b892fc56448d17345443a05f7fb4",
"version": "1.22.3",
"description": "The Go Programming language",
"homepage": "https://go.dev/",
"free": true,
"spdx_id": "BSD-3-Clause",
"epoch_seconds": 1716993062,
"platforms": [
"x86_64-darwin",
"i686-darwin",
"aarch64-darwin",
"armv7a-darwin",
"aarch64-linux",
"armv5tel-linux",
"armv6l-linux",
"armv7a-linux",
"armv7l-linux",
"i686-linux",
"loongarch64-linux",
"m68k-linux",
"microblaze-linux",
"microblazeel-linux",
"mips-linux",
"mips64-linux",
"mips64el-linux",
"mipsel-linux",
"powerpc64-linux",
"powerpc64le-linux",
"riscv32-linux",
"riscv64-linux",
"s390-linux",
"s390x-linux",
"x86_64-linux",
"wasm64-wasi",
"wasm32-wasi"
],
"attr_name": "go"
},
"runtime": false
},
{
"package": {
"name": "gotools",
"revision": "d7570b04936e9b0f5268e0d834dee40368ad3308",
"version": "0.18.0",
"description": "Additional tools for Go development",
"homepage": "https://go.googlesource.com/tools",
"free": true,
"spdx_id": "BSD-3-Clause",
"epoch_seconds": 1709830921,
"platforms": [
"x86_64-darwin",
"i686-darwin",
"aarch64-darwin",
"armv7a-darwin",
"aarch64-linux",
"armv5tel-linux",
"armv6l-linux",
"armv7a-linux",
"armv7l-linux",
"i686-linux",
"loongarch64-linux",
"m68k-linux",
"microblaze-linux",
"microblazeel-linux",
"mips-linux",
"mips64-linux",
"mips64el-linux",
"mipsel-linux",
"powerpc64-linux",
"powerpc64le-linux",
"riscv32-linux",
"riscv64-linux",
"s390-linux",
"s390x-linux",
"x86_64-linux"
],
"attr_name": "gotools"
},
"runtime": false
}
]
}
25 changes: 21 additions & 4 deletions bsf/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions bsf/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7.url = "github:nixos/nixpkgs/1ebb7d7bba2953a4223956cfb5f068b0095f84a7";
nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14.url = "github:nixos/nixpkgs/ac5c1886fd9fe49748d7ab80accc4c847481df14";
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4.url = "github:nixos/nixpkgs/7445ccd775d8b892fc56448d17345443a05f7fb4";
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308.url = "github:nixos/nixpkgs/d7570b04936e9b0f5268e0d834dee40368ad3308";

nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

Expand All @@ -29,6 +30,7 @@
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7,
nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14,
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4,
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308,
}: let
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ];

Expand All @@ -39,6 +41,7 @@
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs = import nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7 { inherit system; };
nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs = import nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14 { inherit system; };
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs = import nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4 { inherit system; };
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs = import nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308 { inherit system; };


pkgs = import nixpkgs { inherit system; };
Expand All @@ -54,12 +57,16 @@
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs,
nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs,
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs,
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs,
... }: {
devShell = pkgs.mkShell {
# The Nix packages provided in the environment
packages = [
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs.bash
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.coreutils-full
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs.delve
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.go
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs.gotools

];
};
Expand All @@ -69,7 +76,7 @@



nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: {
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs, ... }: {
runtime = pkgs.buildEnv {
name = "runtimeenv";
paths = [
Expand All @@ -83,12 +90,15 @@



nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, ... }: {
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs, nixpkgs-ac5c1886fd9fe49748d7ab80accc4c847481df14-pkgs, nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs, nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs, ... }: {
development = pkgs.buildEnv {
name = "devenv";
paths = [
nixpkgs-1ebb7d7bba2953a4223956cfb5f068b0095f84a7-pkgs.bash
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.coreutils-full
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs.delve
nixpkgs-7445ccd775d8b892fc56448d17345443a05f7fb4-pkgs.go
nixpkgs-d7570b04936e9b0f5268e0d834dee40368ad3308-pkgs.gotools

];
};
Expand All @@ -103,7 +113,7 @@


ociImage_pkgs_runtime = nix2containerPkgs.nix2container.buildImage {
name = "docker.io/saiyam911/devops-baseimage";
name = "saiyam911/devops-kube-proj";
config = {
cmd = [ ];

Expand All @@ -127,7 +137,7 @@
};

ociImage_pkgs_dev = nix2containerPkgs.nix2container.buildImage {
name = "docker.io/saiyam911/devops-baseimage";
name = "saiyam911/devops-kube-proj";
config = {
cmd = [ ];

Expand Down
22 changes: 22 additions & 0 deletions cluster_issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
# The ACME server URL
server: https://acme-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: [email protected]
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-prod
# Enable the HTTP-01 challenge provider
solvers:
- http01:
gatewayHTTPRoute:
parentRefs:
- kind: Gateway
name: app-gateway
namespace: default

11 changes: 6 additions & 5 deletions deploy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: my-app
image: saiyam911/kubesimplify-demo:sha-60fce6c
image: saiyam911/devops-project:v1
imagePullPolicy: Always
env:
- name: DB_USERNAME
Expand Down Expand Up @@ -68,6 +68,7 @@ spec:
app: my-app
ports:
- protocol: TCP
name: http
port: 80
targetPort: 8080
type: ClusterIP
Expand All @@ -84,9 +85,9 @@ spec:
- name: http
port: 80
protocol: HTTP
hostname: "*.kubesimplify.com"
hostname: "app.kubesimplify.com"
- name: https
hostname: "*.kubesimplify.com"
hostname: "app.kubesimplify.com"
port: 443
protocol: HTTPS
allowedRoutes:
Expand All @@ -97,7 +98,7 @@ spec:
certificateRefs:
- name: app-kubesimplify-com-tls
kind: Secret
group: core
group: ""
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
Expand All @@ -112,7 +113,7 @@ spec:
rules:
- matches:
- path:
type: Exact
type: PathPrefix
value: /
backendRefs:
- name: my-app-service
Expand Down
Loading

0 comments on commit 649dd37

Please sign in to comment.