This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: source.toolkit.fluxcd.io/v1beta1 | |
kind: GitRepository | |
metadata: | |
name: app-repository | |
namespace: flux-system | |
spec: | |
interval: 10m | |
url: https://github.com/<my-organization>/<my-repo> | |
branch: master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flux bootstrap \ | |
github \ | |
--owner <your-github-user> \ | |
--repository <repo-name> \ | |
--path ./ \ | |
--branch master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 | |
kind: Kustomization | |
metadata: | |
name: app-sync | |
namespace: flux-system | |
spec: | |
interval: 10m | |
path: "./app" | |
sourceRef: | |
kind: GitRepository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
resources: | |
- app-system/app-system-sync.yaml | |
- networking/networking-sync.yaml | |
- namespaces/namespaces-sync.yaml | |
- app/app-sync.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- kustomize.yaml | |
- networking | |
- networking-sync.yaml | |
- nginx-ingress-controller.yaml | |
- kustomize.yaml | |
- namespaces | |
- namespaces-sync.yaml | |
- ingress-controller-ns.yaml | |
- my-app-ns.yaml | |
- kustomize.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fetchUrl(url string, send_channel chan<- string){ | |
response, err := http.Get(url) | |
if(err != nil){ | |
log.Fatal(err) | |
} | |
bytes, err := io.Copy(ioutil.Discard, response.Body) | |
response.Body.Close() | |
if(err != nil){ | |
log.Fatal(err) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func worker(pid int, wg *sync.WaitGroup, file *os.File){ | |
defer wg.Done() | |
fmt.Printf("Worker Process %d writing to file...\n", pid) | |
content := fmt.Sprintf("Worker %d wrote to the file\n", pid) | |
file.WriteString(content) | |
file.Sync() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for _, url := range urls { | |
go fetchUrl(url, send_channel) | |
} | |
for _, url := range urls { | |
fmt.Println("Fetching channel content for URL: ", url) | |
receive_channel = <-send_channel | |
fmt.Println(receive_channel) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f, err := os.Create("/tmp/concurrency_in_go.txt") | |
if err != nil{ | |
panic(err) | |
} | |
defer f.Close() | |
for i := 1; i <= 3; i++ { | |
wg.Add(1) | |
go worker(i, &wg, f) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urls := [2]string{"https://vmware.com", "https://dell.com"} | |
var receive_channel string | |
send_channel := make(chan string) | |
var wg sync.WaitGroup |
NewerOlder