Skip to content

Instantly share code, notes, and snippets.

View hadoan's full-sized avatar
🏠
Working from home

Ha Doan hadoan

🏠
Working from home
View GitHub Profile
kubectl get pods --field-selector=status.phase=Failed
kubectl delete pods --field-selector=status.phase=Failed
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
apiVersion: v1
metadata:
name: your-sslcerts
data:
tls.crt: your base-64 string
tls.key: your base-64 string
apiVersion: apps/v1
kind: Deployment
metadata:
name: angular-app
labels:
app: angular-app
spec:
replicas: 1
selector:
matchLabels:
env:
REGISTRY_NAME: your-container-register-name
CLUSTER_NAME: your-aks-cluster
CLUSTER_RESOURCE_GROUP: your-cluster-group
NAMESPACE: default
APP_NAME: angular-frontned
SOURCE_FOLDER: ./
name: Angular Frontend dev AKS
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
import { DeploymentConsts } from "../../common/consts";
export class ApiService {
New() {
const config = new pulumi.Config();
const service = new k8s.core.v1.Service(DeploymentConsts.TMDB_API, {
metadata: {
import * as k8s from "@pulumi/kubernetes";
import { DeploymentConsts } from "../../common/consts";
import * as pulumi from "@pulumi/pulumi";
export class ApiDeployment {
config = new pulumi.Config();
configMap = DeploymentConsts.TMDB_API;
New() {
return new k8s.apps.v1.Deployment(DeploymentConsts.TMDB_API + "-deployment", {
# Stage 1
FROM node:14.4.0-alpine as node
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as azuread from "@pulumi/azuread";
import { DeploymentConsts } from '../common/consts';
import * as config from '../common/config';
//create Azure AD Application for AKS
export function newAks(resourceGroup: azure.core.ResourceGroup) {
const adApp = new azuread.Application(DeploymentConsts.APP_NAME + '-ad-app');
const adSp = new azuread.ServicePrincipal(DeploymentConsts.APP_NAME + "-aksSp", { applicationId: adApp.applicationId });
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import { DeploymentConsts } from '../common/consts';
export const dbUserName = "sql";
export const dbUserPwd = "your-password";//hard-code, please use Pulumi config for this setting
export function newSqlServer(resourceGroup: azure.core.ResourceGroup) {
const serverName = DeploymentConsts.APP_NAME + "-sql-server";
return new azure.sql.SqlServer(serverName, {
import React from "react"
import Layout from './components/layout'
export default function Home() {
return (
<Layout>
<span>Hello!</span>
</Layout>
)
}